/* Bulls On Elysium — docs (GitBook-style layout) */

:root, [data-theme="dark"] {
  --bg: #141519;
  --bg-2: #1b1c21;
  --bg-3: #23252c;
  --line: #2a2c33;
  --text: #e9eaee;
  --text-2: #b4b6bf;
  --muted: #858894;
  --accent: #8FC2FF;
  --accent-bg: rgba(119, 181, 254, .12);
  --code-bg: #23252c;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, .6);
  --info: #8FC2FF; --info-bg: rgba(119, 181, 254, .09);
  --ok: #4ccf8b; --ok-bg: rgba(76, 207, 139, .09);
  --warn: #f5c451; --warn-bg: rgba(245, 196, 81, .09);
  --bad: #ff7b7b; --bad-bg: rgba(255, 123, 123, .09);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #ffffff;
  --bg-2: #f6f7f9;
  --bg-3: #eceef2;
  --line: #e7e8ec;
  --text: #16171a;
  --text-2: #3d3f46;
  --muted: #6c6f7a;
  --accent: #2563d8;
  --accent-bg: rgba(37, 99, 216, .08);
  --code-bg: #f1f2f5;
  --shadow: 0 24px 60px -24px rgba(20, 30, 60, .35);
  --info: #2563d8; --info-bg: #eef4ff;
  --ok: #138a4f; --ok-bg: #ecf9f1;
  --warn: #9a6a00; --warn-bg: #fff8e6;
  --bad: #c0262d; --bad-bg: #fff0f0;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-padding-top: 84px; }
body {
  font-family: "Inter", -apple-system, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.6;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img, svg { display: block; }
[hidden] { display: none !important; }
kbd { font-family: inherit; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; background: var(--bg-2); }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 40; height: 64px; display: flex; align-items: center; gap: 16px;
  padding: 0 24px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.top-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 16px; }
.top-brand img { border-radius: 50%; }
.top-link { font-size: 13.5px; color: var(--muted); text-decoration: none; margin-left: 8px; }
.top-link:hover { color: var(--text); }
.search-btn {
  margin-left: auto; display: flex; align-items: center; gap: 8px; width: 240px; height: 38px; padding: 0 10px 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); color: var(--muted); font: inherit; font-size: 14px; cursor: pointer;
  transition: border-color .15s;
}
.search-btn:hover { border-color: var(--muted); }
.search-label { flex: 1; text-align: left; }
.icon-btn { display: none; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); cursor: pointer; place-items: center; }

/* ---------- 3-column shell ---------- */
.shell { display: grid; grid-template-columns: 290px minmax(0, 1fr) 260px; max-width: 1500px; margin: 0 auto; }
.side {
  position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; padding: 22px 16px 90px 20px;
  scrollbar-width: thin;
}
.group { margin-bottom: 22px; }
.group-title { display: block; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text); padding: 0 10px 8px; }
.side ul { list-style: none; }
.side a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; text-decoration: none;
  font-size: 14px; color: var(--text-2); transition: background .12s, color .12s;
}
.side a:hover { background: var(--bg-2); color: var(--text); }
.side a.active { background: var(--accent-bg); color: var(--accent); font-weight: 500; }
.side .ico { width: 18px; text-align: center; font-size: 14px; flex: none; }
.side .lbl { flex: 1; }
.chev { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; width: 22px; height: 22px; border-radius: 6px; cursor: pointer; transition: transform .2s; }
.chev:hover { background: var(--bg-3); }
.chev.open { transform: rotate(90deg); }
.sub { display: none; margin: 2px 0 4px 19px; padding-left: 10px; border-left: 1px solid var(--line); }
.sub.open { display: block; }
.sub a { font-size: 13.5px; padding: 6px 10px; }
.side-foot {
  position: fixed; bottom: 16px; left: max(20px, calc((100vw - 1500px) / 2 + 20px)); width: 254px;
  display: flex !important; gap: 10px; align-items: center; padding: 11px 14px !important; border: 1px solid var(--line);
  background: var(--bg) !important; border-radius: 12px !important; font-size: 13px !important;
}
.side-foot img { border-radius: 50%; }
.scrim { display: none; }

/* ---------- main column ---------- */
.main { padding: 36px 56px 80px; max-width: 860px; width: 100%; margin: 0 auto; }
.page-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.crumb { font-size: 13px; font-weight: 500; color: var(--accent); }
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer;
}
.copy-btn:hover { color: var(--text); border-color: var(--muted); }

.page h1 { display: flex; align-items: center; gap: 12px; font-size: 34px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; margin-bottom: 18px; }
.h1-ico { font-size: 30px; }
.page h2 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; margin: 40px 0 12px; padding-top: 28px; border-top: 1px solid var(--line); }
.page h3 { font-size: 18px; font-weight: 600; margin: 28px 0 10px; }
.page p { color: var(--text-2); margin-bottom: 14px; font-size: 15.5px; line-height: 1.75; }
.page b { color: var(--text); font-weight: 600; }
.page a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 3px; }
.page a:hover { text-decoration-color: var(--accent); }
.page code { font-size: 13px; background: var(--code-bg); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
.page ul, .page ol { margin: 4px 0 18px 22px; color: var(--text-2); }
.page li { margin-bottom: 7px; padding-left: 4px; font-size: 15.5px; line-height: 1.7; }
.page li::marker { color: var(--muted); }

.banner { margin: 22px 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.banner img { width: 100%; }

/* hint / callout blocks */
.hint { display: flex; gap: 12px; align-items: flex-start; margin: 20px 0; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); }
.hint p { margin: 0; font-size: 14.5px; line-height: 1.6; }
.hint-icon { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--bg); margin-top: 1px; }
.hint-info { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.hint-info .hint-icon { background: var(--info); }
.hint-success { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.hint-success .hint-icon { background: var(--ok); }
.hint-warning { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.hint-warning .hint-icon { background: var(--warn); }
.hint-danger { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.hint-danger .hint-icon { background: var(--bad); }

/* tables */
.page table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 14px 0 22px; font-size: 14.5px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.page th { text-align: left; font-weight: 600; font-size: 13px; color: var(--text); background: var(--bg-2); padding: 10px 14px; border-bottom: 1px solid var(--line); }
.page td { padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--text-2); vertical-align: top; }
.page tr:last-child td { border-bottom: 0; }
.page td:first-child { color: var(--text); font-weight: 500; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: 0; }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0 8px; }
.facts div { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.facts span { display: block; font-size: 12px; color: var(--muted); }
.facts b { font-size: 20px; font-weight: 700; }

.funds-bar { display: flex; gap: 3px; height: 12px; border-radius: 999px; overflow: hidden; margin: 18px 0 6px; }

/* bull art */
.art { aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.art svg { width: 100%; height: 100%; }
figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
figcaption small { display: block; font-size: 12px; opacity: .8; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 440px; margin: 16px 0 10px; }
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0 18px; }
.gallery figcaption { color: var(--text); font-weight: 500; }
.forge-ex { display: grid; grid-template-columns: 1fr auto 1fr auto 1.2fr; gap: 12px; align-items: center; margin: 18px 0 6px; max-width: 600px; }
.forge-ex > span { font-size: 26px; color: var(--muted); }

.link-list { list-style: none; margin-left: 0 !important; display: flex; flex-direction: column; gap: 8px; }
.link-list li { padding: 0; margin: 0; }
.link-list a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--text) !important; text-decoration: none !important; font-weight: 500; transition: border-color .15s, background .15s; }
.link-list a:hover { border-color: var(--accent); background: var(--accent-bg); }
.link-list i { margin-left: auto; font-style: normal; color: var(--muted); }

/* pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 56px; }
.pager-card {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none;
  transition: border-color .15s, background .15s;
}
.pager-card:hover { border-color: var(--accent); }
.pager-card span { font-size: 12.5px; color: var(--muted); }
.pager-card b { font-weight: 600; font-size: 15px; }
.pager-card.next { text-align: right; grid-column: 2; }
.updated { margin-top: 26px; font-size: 13px; color: var(--muted); }

/* ---------- right outline ---------- */
.toc { position: sticky; top: 64px; height: calc(100vh - 64px); }
.toc-inner { height: 100%; display: flex; flex-direction: column; padding: 38px 24px 24px 8px; }
.toc-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text); margin-bottom: 10px; }
#toc { list-style: none; border-left: 1px solid var(--line); }
#toc a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 1px solid transparent; text-decoration: none; font-size: 13.5px; color: var(--muted); line-height: 1.4; transition: color .12s; }
#toc a:hover { color: var(--text); }
#toc a.active { color: var(--accent); border-left-color: var(--accent); }
#toc .lvl3 a { padding-left: 26px; }
.theme-switch { margin-top: auto; align-self: flex-start; display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.theme-switch button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.theme-switch button:hover { color: var(--text); }
.theme-switch button.active { background: var(--bg-3); color: var(--text); }

/* ---------- search modal ---------- */
.search-modal { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .5); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.search-box { width: 100%; max-width: 620px; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.search-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 56px; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-input input { flex: 1; border: 0; outline: none; background: none; color: var(--text); font: inherit; font-size: 16px; }
.search-results { list-style: none; max-height: 56vh; overflow-y: auto; padding: 8px; }
.search-results a { display: flex; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.search-results li.sel a, .search-results a:hover { background: var(--accent-bg); }
.search-results .r-ico { font-size: 16px; width: 22px; text-align: center; flex: none; }
.search-results b { display: block; font-weight: 600; font-size: 14.5px; }
.search-results small { display: block; font-size: 12px; color: var(--muted); }
.search-results em { display: block; font-style: normal; font-size: 13px; color: var(--text-2); margin-top: 4px; line-height: 1.5; }
.search-results mark { background: var(--accent-bg); color: var(--accent); border-radius: 3px; padding: 0 2px; }
.search-results .empty { padding: 24px; text-align: center; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .shell { grid-template-columns: 270px minmax(0, 1fr); }
  .toc { display: none; }
  .side-foot { width: 234px; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .icon-btn { display: grid; }
  .side {
    position: fixed; top: 64px; left: 0; bottom: 0; z-index: 60; width: 300px; height: auto; background: var(--bg);
    border-right: 1px solid var(--line); transform: translateX(-100%); transition: transform .25s ease-out;
  }
  .side.open { transform: none; }
  .side-foot { position: static; width: auto; margin-top: 10px; }
  .scrim { display: block; position: fixed; inset: 64px 0 0; z-index: 55; background: rgba(0, 0, 0, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .scrim.open { opacity: 1; pointer-events: auto; }
  .main { padding: 28px 20px 64px; }
  .top { padding: 0 14px; gap: 10px; }
  .top-link { display: none; }
  .search-btn { width: 40px; padding: 0; justify-content: center; }
  .search-btn .search-label, .search-btn kbd { display: none; }
}
@media (max-width: 560px) {
  .top-brand span { font-size: 15px; }
  .page h1 { font-size: 27px; }
  .h1-ico { font-size: 24px; }
  .page h2 { font-size: 21px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pager { grid-template-columns: 1fr; }
  .pager-card.next { grid-column: 1; }
  .page table { font-size: 13.5px; }
  .page th, .page td { padding: 9px 10px; }
}

/* overview cards */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 22px 0; }
.page .card {
  display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 14px;
  text-decoration: none; color: var(--text); background: var(--bg-2); transition: border-color .15s, transform .15s;
}
.page .card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card span { font-size: 22px; margin-bottom: 4px; }
.card b { font-size: 15px; }
.card small { font-size: 13px; color: var(--muted); line-height: 1.45; }

/* the core loop */
.page ol.flow { list-style: none; margin: 18px 0 8px; padding: 0; counter-reset: f; display: flex; flex-direction: column; gap: 10px; }
.flow li {
  counter-increment: f; position: relative; display: flex; flex-direction: column; gap: 2px; margin: 0;
  padding: 14px 16px 14px 58px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2);
}
.flow li::before {
  content: counter(f); position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent-bg); color: var(--accent); font-weight: 700; font-size: 13px;
}
.flow li:not(:last-child)::after { content: ""; position: absolute; left: 30px; bottom: -11px; width: 1px; height: 10px; background: var(--line); }
.flow b { color: var(--text); font-size: 15px; }
.flow span { font-size: 14px; color: var(--muted); }
.sub-num { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }

@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr 1fr; }
}

/* coming-soon card */
.soon { margin: 6px 0 10px; padding: 34px 30px; border-radius: 18px; text-align: center; border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-bg); }
.soon-badge { display: inline-block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 999px; padding: 4px 12px; }
.page .soon-title { border: 0; padding: 0; margin: 16px 0 10px; font-size: 26px; }
.soon p { max-width: 460px; margin: 0 auto; }
.gallery-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 560px) { .gallery-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
