/* ============================================================
   Awesome LLM for Finance — TERMINAL
   Bloomberg-style: black glass, amber phosphor, market semantics
   ============================================================ */

:root {
  --bg: #07090a;
  --bg-2: #0b0f10;
  --panel: #0e1315;
  --panel-2: #11181a;
  --line: #1e2a2c;
  --line-hot: #2e4245;
  --amber: #ffb000;
  --amber-dim: #b87d00;
  --up: #22d37f;
  --down: #ff4d4d;
  --cyan: #38c8d8;
  --text: #ccd6d2;
  --text-dim: #7d8f8a;
  --text-faint: #6b7a75;
  --white: #f2f6f3;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --disp: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --glow: 0 0 24px rgba(255, 176, 0, .13);
}

html[data-theme="paper"] {
  --bg: #ece7da;
  --bg-2: #e4ddcd;
  --panel: #f4efe3;
  --panel-2: #fbf7ec;
  --line: #c9bfa8;
  --line-hot: #a89a78;
  --amber: #a36a00;
  --amber-dim: #8a5f10;
  --up: #0c7a44;
  --down: #b3261e;
  --cyan: #0e6b78;
  --text: #26291f;
  --text-dim: #5c5f52;
  --text-faint: #77766a;
  --white: #14160f;
  --glow: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 130px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14.5px;
  line-height: 1.72;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.014) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, rgba(255,176,0,.045), transparent 340px);
}
::selection { background: var(--amber); color: #0a0a0a; }
a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--white); text-decoration: underline; text-underline-offset: 3px; }
.mono { font-family: var(--mono); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--line-hot); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--amber-dim); }

/* ---------- ticker ---------- */
.ticker {
  position: fixed; top: 0; left: 0; right: 0; z-index: 130;
  height: 34px; overflow: hidden; white-space: nowrap;
  background: var(--bg-2); border-bottom: 1px solid var(--line-hot);
  display: flex; align-items: center;
}
.ticker-label {
  flex: none; background: var(--amber); color: #0a0a0a;
  font-weight: 700; font-size: 11px; letter-spacing: .18em;
  padding: 0 14px; height: 100%; display: flex; align-items: center;
  margin-right: 18px;
}
.ticker-track { display: inline-block; animation: tick 64s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span { margin-right: 34px; font-size: 12px; letter-spacing: .04em; }
.ticker-track b { color: var(--white); font-weight: 500; }
.tk-up { color: var(--up); } .tk-dn { color: var(--down); } .tk-fl { color: var(--cyan); } .ticker-track span::after { content: "·"; margin-left: 34px; color: var(--line-hot); }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- topbar ---------- */
.topbar {
  position: fixed; top: 34px; left: 0; right: 0; z-index: 120;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 13px 28px;
  display: flex; align-items: center; gap: 24px;
}
.brand {
  font-family: var(--disp); font-weight: 800; font-size: 17px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--white);
  display: flex; align-items: center; gap: 11px;
}
.brand .box {
  background: var(--amber); color: #0a0a0a; font-family: var(--mono);
  font-size: 11px; font-weight: 700; padding: 2px 7px; letter-spacing: .08em;
}
.brand:hover { text-decoration: none; color: var(--amber); }
.topnav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.topnav a {
  color: var(--text-dim); font-size: 11.5px; letter-spacing: .08em;
  padding: 5px 9px; border: 1px solid transparent; text-transform: uppercase; white-space: nowrap;
}
@media (max-width: 1180px) { .topnav a .fk { display: none; } .topnav a { padding: 5px 7px; } .brand em { display:none; } }
.topnav a:hover { color: var(--amber); border-color: var(--line-hot); text-decoration: none; }
.topnav a .fk { color: var(--amber); margin-right: 6px; }
.topnav .gh { border: 1px solid var(--line-hot); }
.icon-btn {
  border: 1px solid var(--line-hot); background: transparent; color: var(--amber);
  width: 32px; height: 32px; cursor: pointer; display: grid; place-items: center;
  font-size: 14px; transition: all .2s;
}
.icon-btn:hover { background: var(--amber); color: #0a0a0a; }

/* ---------- terminal window ---------- */
.term { border: 1px solid var(--line-hot); background: var(--panel); }
.term-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel-2); border-bottom: 1px solid var(--line-hot);
  padding: 8px 14px; font-size: 11px; letter-spacing: .14em; color: var(--text-dim);
  text-transform: uppercase;
}
.term-bar .sess { color: var(--text-faint); }
.term-bar .sess b { color: var(--amber); font-weight: 600; }
.term-bar .path { color: var(--text-dim); margin-left: auto; }

/* ---------- hero ---------- */
.hero { padding: 168px 28px 30px; max-width: 1280px; margin: 0 auto; }
.hero-grid { display: grid; grid-template-columns: 1.25fr .9fr; gap: 42px; align-items: start; }
@media (max-width: 1020px) { .hero-grid { grid-template-columns: 1fr; } }
.kicker {
  font-size: 11px; letter-spacing: .34em; text-transform: uppercase;
  color: var(--amber); margin: 0 0 20px; display: flex; align-items: center; gap: 14px;
}
.kicker::before { content: ""; width: 26px; height: 2px; background: var(--amber); }
h1.display {
  font-family: var(--mono); font-weight: 700; text-transform: uppercase;
  font-size: clamp(30px, 4.2vw, 52px); line-height: 1.12; letter-spacing: -.01em;
  margin: 0 0 24px; color: var(--amber); text-shadow: var(--glow);
}
h1.display em { font-style: normal; color: var(--white); }
.lede { max-width: 60ch; color: var(--text-dim); font-size: 14px; margin: 0 0 26px; }
.lede b { color: var(--white); font-weight: 500; }
.boot { padding: 16px 18px 10px; font-size: 12.5px; line-height: 2; }
.boot .ln { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.boot .p { color: var(--amber); }
.boot .ok { color: var(--up); }
.boot .cnt { color: var(--white); }
.cursor { display: inline-block; width: 8px; height: 15px; background: var(--amber); vertical-align: -2px; animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line-hot); background: var(--panel); margin-top: 4px;
}
.stat { padding: 14px 16px 11px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat:nth-child(3n) { border-right: none; }
.stat:nth-last-child(-n+3) { border-bottom: none; }
.stat b {
  display: block; font-family: var(--mono); font-weight: 600; font-size: 24px;
  color: var(--amber); line-height: 1.1; letter-spacing: -.01em;
}
.stat span { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--text-faint); }

/* ---------- filter bar ---------- */
.filterbar {
  position: sticky; top: 92px; z-index: 60;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-hot); border-top: 1px solid var(--line);
}
.filterbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 12px 28px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.search-box { position: relative; flex: 1 1 280px; max-width: 520px; }
.search-box input {
  width: 100%; padding: 9px 14px;
  border: 1px solid var(--line-hot); background: var(--panel);
  color: var(--white); font-family: var(--mono); font-size: 13.5px; outline: none;
  transition: border .2s, box-shadow .2s;
}
.search-box input::placeholder { color: var(--text-faint); }
.search-box input:focus { border-color: var(--amber); box-shadow: var(--glow); }
.chip {
  border: 1px solid var(--line-hot); background: transparent; color: var(--text-dim);
  font-family: var(--mono); font-size: 12px; letter-spacing: .05em;
  padding: 6px 13px; cursor: pointer; transition: all .18s;
}
.chip::before { content: "["; color: var(--amber-dim); margin-right: 4px; }
.chip::after { content: "]"; color: var(--amber-dim); margin-left: 4px; }
.chip:hover { border-color: var(--amber); color: var(--amber); }
.chip.on { background: var(--amber); border-color: var(--amber); color: #0a0a0a; font-weight: 700; }
.chip.on::before, .chip.on::after { color: rgba(0,0,0,.55); }
select.mini {
  font-family: var(--mono); font-size: 12px; color: var(--text-dim);
  background: var(--panel); border: 1px solid var(--line-hot); padding: 6px 10px; outline: none;
}
.count { font-size: 12px; color: var(--text-faint); margin-left: auto; letter-spacing: .08em; }
.count b { color: var(--amber); font-size: 15px; }
.legend-row { padding-top: 0; padding-bottom: 11px; }
.legend { font-size: 11px; color: var(--text-faint); letter-spacing: .05em; }
.legend i { font-style: normal; color: var(--text-dim); }

/* ---------- layout ---------- */
.sheet { max-width: 1280px; margin: 0 auto; padding: 42px 28px 90px; display: grid; grid-template-columns: 240px 1fr; gap: 50px; }
@media (max-width: 980px) { .sheet { grid-template-columns: 1fr; } .toc-wrap { display: none; } }
.toc-wrap { position: relative; }
.toc { position: sticky; top: 150px; max-height: calc(100vh - 175px); overflow-y: auto; padding-right: 8px; }
.toc h4 {
  font-size: 10px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--amber); margin: 24px 0 8px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.toc h4:first-child { margin-top: 0; }
.toc h4::after { content: ""; flex: 1; height: 1px; background: var(--line-hot); }
.toc a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  padding: 5px 0 5px 12px; color: var(--text-dim); font-size: 12.5px; line-height: 1.4;
  border-left: 2px solid transparent; transition: all .18s;
}
.toc a .n { font-size: 11px; color: var(--text-faint); }
.toc a:hover { color: var(--amber); text-decoration: none; background: rgba(255,176,0,.05); }
.toc a.active { color: var(--amber); border-left-color: var(--amber); font-weight: 600; }
.toc a.filtered { opacity: .3; }
.toc .note { font-size: 11px; color: var(--text-faint); margin-top: 16px; padding-left: 12px; border-left: 2px solid var(--line); line-height: 1.6; }

/* ---------- sections ---------- */
.cat { margin-bottom: 54px; scroll-margin-top: 140px; }
.cat-head { border-top: 2px solid var(--amber); padding-top: 14px; margin-bottom: 4px; position: relative; }
.cat-head::before {
  content: attr(data-sector); position: absolute; right: 0; top: 8px;
  font-size: 44px; font-weight: 800; color: var(--panel-2);
  -webkit-text-stroke: 1px var(--line-hot); font-family: var(--disp); letter-spacing: .04em;
}
.cat-head .row { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.cat-no { font-size: 12px; color: var(--amber); letter-spacing: .18em; font-weight: 700; }
.cat-head h2 {
  font-family: var(--disp); font-weight: 800; text-transform: uppercase;
  font-size: clamp(21px, 2.8vw, 30px); letter-spacing: .01em; margin: 0; line-height: 1.12;
  color: var(--white);
}
.cat-count { font-size: 11px; color: var(--up); border: 1px solid color-mix(in srgb, var(--up) 45%, transparent); padding: 2px 10px; letter-spacing: .1em; }
.cat-desc { color: var(--text-dim); max-width: 68ch; margin: 8px 0 18px; font-size: 13px; }

/* ---------- entries ---------- */
.entries { border-top: 1px solid var(--line); }
.entry {
  display: grid; grid-template-columns: 92px 1fr; gap: 16px;
  padding: 11px 10px 10px; border-bottom: 1px solid var(--line);
  transition: background .12s, color .12s;
}
.entry.hidden { display: none; }
.e-no {
  font-size: 13px; color: var(--amber); text-align: left; padding-top: 3px;
  font-weight: 600; letter-spacing: -.01em;
}
.entry:hover { background: var(--amber); }
.entry:hover .e-no, .entry:hover .e-title a, .entry:hover .e-meta,
.entry:hover .e-meta .venue, .entry:hover .e-sum, .entry:hover .subtag, .entry:hover .rlink { color: #0a0a0a; }
.entry:hover .e-no::before { color: #0a0a0a; }
.entry:hover .badge { color: #0a0a0a; border-color: rgba(0,0,0,.5); }
.entry:hover .rtopic { color: rgba(0,0,0,.75); border-color: rgba(0,0,0,.4); }
.entry:hover a { text-decoration: none; }
.e-main { min-width: 0; }
.e-title { font-family: var(--disp); font-weight: 700; font-size: 16px; line-height: 1.3; margin: 0; letter-spacing: .002em; }
.e-title a { color: var(--white); }
.e-title a:hover { color: var(--amber); }
.badge {
  display: inline-block; font-size: 10px; letter-spacing: .14em;
  border: 1px solid var(--line-hot); color: var(--text-dim);
  padding: 1px 7px; vertical-align: 3px; margin-left: 9px; white-space: nowrap; font-weight: 600;
}
.badge.p0 { color: var(--down); border-color: color-mix(in srgb, var(--down) 55%, transparent); }
.badge.p1 { color: var(--text-faint); }
.badge.p2 { color: var(--text-faint); border-style: dashed; }
.badge.lang { color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 40%, transparent); }
.e-meta { font-size: 11.5px; color: var(--text-faint); margin: 4px 0 0; letter-spacing: .04em; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.e-meta .venue { color: var(--text-dim); }
.e-meta .cites { color: var(--up); }
.e-sum { color: var(--text-dim); font-size: 12.5px; margin: 5px 0 0; max-width: 82ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.e-sub { margin-top: 6px; }
.rtopic { font-size: 10px; color: var(--text-faint); border: 1px solid var(--line); padding: 1px 6px; margin-right: 5px; letter-spacing: .04em; }
.rlink { color: var(--text-faint); font-size: 11px; }
.subtag { font-size: 11px; color: var(--cyan); letter-spacing: .05em; }
.subtag::before { content: "◆ "; font-size: 8px; vertical-align: 2px; }

/* ---------- about strip ---------- */
.about-strip {
  max-width: 1280px; margin: 0 auto; padding: 30px 28px 60px;
  border-top: 2px solid var(--amber);
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 38px;
}
@media (max-width: 900px) { .about-strip { grid-template-columns: 1fr; } }
.about-strip h4 { font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--amber); margin: 0 0 10px; font-weight: 600; }
.about-strip p { color: var(--text-dim); font-size: 12.5px; margin: 0; }

footer.legal {
  border-top: 1px solid var(--line-hot); padding: 20px 28px 28px;
  font-size: 11px; color: var(--text-faint); letter-spacing: .06em;
}
footer.legal .wrap { max-width: 1280px; margin: 0 auto; display: flex; justify-content: space-between; width: 100%; flex-wrap: wrap; gap: 12px; }

/* ---------- paper detail ---------- */
.detail { max-width: 1120px; margin: 0 auto; padding: 150px 28px 80px; display: grid; grid-template-columns: 1fr 268px; gap: 50px; }
@media (max-width: 980px) { .detail { grid-template-columns: 1fr; } }
.crumbs { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 22px; }
.crumbs a { color: var(--amber); }
.detail h1 {
  font-family: var(--disp); font-weight: 800; font-size: clamp(24px, 3.4vw, 38px);
  line-height: 1.14; margin: 0 0 14px; max-width: 26ch; color: var(--white); letter-spacing: 0;
}
.authors { color: var(--text-dim); font-size: 13px; margin: 0 0 18px; max-width: 66ch; }
.meta-line {
  display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center;
  font-size: 12px; color: var(--text-dim);
  background: var(--panel); border: 1px solid var(--line-hot); border-left: 3px solid var(--amber);
  padding: 11px 16px; margin-bottom: 30px;
}
.meta-line a { border-bottom: 1px dotted var(--amber-dim); }
.meta-line > span:not(:last-child)::after { content: "·"; margin-left: 20px; color: var(--line-hot); }
.meta-line .cites { color: var(--up); }
.detail section { margin-bottom: 34px; }
.detail h3 {
  font-size: 10.5px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--amber); font-weight: 600; margin: 0 0 12px;
  display: flex; align-items: center; gap: 14px;
}
.detail h3::after { content: ""; flex: 1; height: 1px; background: var(--line-hot); }
.detail p { max-width: 70ch; margin: 0 0 10px; color: var(--text); font-size: 14px; }
.detail ul { max-width: 68ch; margin: 0; padding-left: 18px; color: var(--text); font-size: 13.5px; }
.detail ul li { margin-bottom: 7px; }
.detail ul li::marker { color: var(--amber); }
.detail .abstract p { font-size: 14.5px; }
.callout {
  background: var(--panel); border: 1px solid var(--line-hot); border-left: 3px solid var(--up);
  padding: 16px 20px; max-width: 68ch; font-size: 14px; color: var(--white);
}
.aside { position: relative; }
.aside-sticky { position: sticky; top: 150px; background: var(--panel); border: 1px solid var(--line-hot); padding: 18px; }
.aside h4 { font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: var(--text-faint); margin: 20px 0 6px; font-weight: 600; }
.aside h4:first-child { margin-top: 0; }
.aside .big { font-size: 15px; color: var(--white); line-height: 1.4; font-weight: 600; display: block; }
.aside .kv { font-size: 12.5px; color: var(--text-dim); line-height: 1.6; }
.tagcloud { display: flex; flex-wrap: wrap; gap: 5px; }
.tagcloud span { font-size: 10.5px; border: 1px solid var(--line); padding: 1px 8px; color: var(--text-dim); }
.pn { display: flex; justify-content: space-between; gap: 14px; margin-top: 50px; border-top: 2px solid var(--amber); padding-top: 18px; }
.pn a { flex: 1; font-size: 12px; color: var(--text-dim); line-height: 1.45; }
.pn .dir { display: block; font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: var(--amber); margin-bottom: 5px; }
.pn .next { text-align: right; }
.pn span.t { display: block; font-size: 13.5px; color: var(--white); }

/* ---------- misc ---------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s cubic-bezier(.2,.8,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .reveal { opacity: 1; transform: none; } }
.empty { text-align: center; color: var(--text-faint); padding: 60px 0; display: none; }
