/* ============================================================
   Shared CSS for all /learn/* article pages.

   Loaded via <link rel="stylesheet" href="/css/article.css?v=1">
   alongside the existing /css/topbar.css. Each article keeps a
   small inline <style> block ONLY for its own component
   classes (.cbbi-list, .timeline, .sec-list, .fee-tier, etc.).

   Anything in this file is universal across every Learn article.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Space+Grotesk:wght@300;400;500;600;700&display=optional');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0b0d11;
  --bg2: #111318;
  --bg3: #181b22;
  --bg4: #1e2129;
  --border: rgba(255, 255, 255, 0.07);
  --border2: rgba(255, 255, 255, 0.13);
  --text: #e8eaf0;
  --text2: #9aa0ad;
  --text3: #6b7280;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --acc: #f7931a;
  --acc2: #ff6b35;
  --accdim: rgba(247, 147, 26, 0.10);
  --accb: rgba(247, 147, 26, 0.35);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Space Grotesk', system-ui, -apple-system, sans-serif;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--acc);
  text-decoration: none;
  border-bottom: 1px solid rgba(247, 147, 26, 0.25);
  transition: border-color .15s;
}
a:hover { border-bottom-color: var(--acc); }

img, svg { display: block; max-width: 100%; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 13, 17, 0.85);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand a { border: none; }
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 800;
  color: #fff;
  font-size: 16px;
  box-shadow: 0 4px 14px rgba(247, 147, 26, 0.35);
}
.brand-name { font-size: 16px; font-weight: 600; letter-spacing: -.01em; color: var(--text); }

.nav { display: flex; align-items: center; gap: 8px; }
.nav-link {
  font-size: 14px;
  color: var(--text2);
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text); background: var(--bg3); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  color: #fff;
  box-shadow: 0 4px 14px rgba(247, 147, 26, 0.35);
  border: none;
}
.btn-primary:hover { box-shadow: 0 6px 24px rgba(247, 147, 26, 0.5); }
.btn-lg { padding: 14px 22px; font-size: 15px; }

/* ── Article body ───────────────────────────────────────── */
article.container { padding-top: 80px; padding-bottom: 100px; }

.breadcrumb {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 24px;
}
.breadcrumb a { color: var(--text3); border: none; }
.breadcrumb a:hover { color: var(--text2); }
.breadcrumb .sep { margin: 0 8px; color: var(--text3); }

article h1, article h1 {
  font-size: clamp(32px, 4vw, 46px);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.1;
  margin-bottom: 18px;
}

.meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--text3);
  margin-bottom: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.meta .sep { color: var(--text3); }
.meta strong { color: var(--text2); font-weight: 500; }

.tldr {
  background: linear-gradient(180deg, var(--bg2), var(--bg3));
  border: 1px solid var(--accb);
  border-radius: 14px;
  padding: 22px 22px 20px;
  margin-bottom: 40px;
  position: relative;
}
.tldr::before {
  content: "TL;DR";
  position: absolute;
  top: 0;
  left: 22px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
  color: var(--acc);
  background: var(--bg);
  padding: 0 8px;
  line-height: 1;
  transform: translateY(-50%);
}
.tldr p { margin-top: 6px; color: var(--text); font-size: 15px; }

article h2 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.2;
  margin: 48px 0 16px;
  color: var(--text);
}
article h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  margin: 28px 0 12px;
  color: var(--text);
}
article p { margin: 0 0 18px; color: var(--text); font-size: 16px; }
article ul, article ol { margin: 0 0 22px; padding-left: 24px; color: var(--text); }
article li { margin-bottom: 10px; }
article strong { color: var(--text); font-weight: 600; }
article code {
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 14px;
}
article blockquote {
  margin: 22px 0;
  padding: 16px 20px;
  background: var(--bg2);
  border-left: 3px solid var(--acc);
  border-radius: 0 8px 8px 0;
  color: var(--text2);
  font-size: 15px;
}
article blockquote p { margin: 0 0 8px; color: var(--text2); }
article blockquote p:last-child { margin-bottom: 0; }
article blockquote .src {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text3);
  letter-spacing: .04em;
  display: block;
  margin-top: 8px;
}

/* ── CTA card ───────────────────────────────────────────── */
.cta-card {
  background: linear-gradient(135deg, rgba(247, 147, 26, 0.10), rgba(255, 107, 53, 0.05));
  border: 1px solid var(--accb);
  border-radius: 16px;
  padding: 32px;
  margin: 48px 0;
  text-align: center;
}
.cta-card h3 { margin: 0 0 8px; font-size: 22px; }
.cta-card p { color: var(--text2); margin-bottom: 20px; font-size: 15px; }
.cta-card .btn { border: none; }

/* ── Related reading ────────────────────────────────────── */
.related { margin: 56px 0 0; padding-top: 32px; border-top: 1px solid var(--border); }
.related h2 { font-size: 22px; margin-bottom: 18px; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.related-item {
  display: block;
  padding: 18px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color .15s, background .15s, transform .15s;
  color: inherit;
  text-decoration: none;
}
.related-item:hover { border-color: var(--border2); background: var(--bg3); transform: translateY(-2px); }
.related-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--text3);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.related-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; line-height: 1.3; }
.related-desc { font-size: 13px; color: var(--text2); line-height: 1.5; }

/* ── FAQ ────────────────────────────────────────────────── */
.faq { margin-top: 48px; }
.faq h2 { margin-bottom: 20px; }
details {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
}
summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 22px;
  font-size: 15px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-family: var(--mono);
  font-size: 18px;
  color: var(--text3);
  transition: transform .2s;
}
details[open] summary::after { transform: rotate(45deg); color: var(--acc); }
details .answer { padding: 0 22px 18px; color: var(--text2); font-size: 14px; line-height: 1.7; }

/* ── Footer ─────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 60px;
  color: var(--text3);
  font-size: 13px;
}
.foot-grid {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
}
.foot-links { display: flex; gap: 24px; flex-wrap: wrap; }
.foot-links a { color: var(--text3); border: none; }
.foot-links a:hover { color: var(--text); }
.foot-disclaimer {
  max-width: 680px;
  margin: 24px auto 0;
  padding: 0 24px;
  font-size: 12px;
  color: var(--text3);
  line-height: 1.6;
  text-align: center;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 700px) {
  .container, .topbar-inner, .foot-grid, .foot-disclaimer { padding-left: 18px; padding-right: 18px; }
  .topbar-inner { height: 56px; }
  article.container { padding-top: 36px; padding-bottom: 60px; }
  .breadcrumb { margin-bottom: 18px; }
  .meta { margin-bottom: 26px; font-size: 11px; }
  .tldr { padding: 18px 18px 16px; margin-bottom: 30px; }
  .tldr p { font-size: 14px; }
  article h2 { font-size: 24px; margin: 36px 0 12px; }
  article h3 { font-size: 18px; margin: 22px 0 10px; }
  article p, article li { font-size: 15px; }
  .cta-card { padding: 24px 18px; margin: 36px 0; }
  .cta-card h3 { font-size: 19px; }
  .cta-card p { font-size: 14px; }
  summary { padding: 14px 18px; font-size: 14px; }
  details .answer { padding: 0 18px 14px; font-size: 13px; }
  .btn { padding: 9px 14px; font-size: 13px; }
  .foot-grid { flex-direction: column; align-items: flex-start; gap: 14px; }
}
@media (max-width: 420px) {
  .container, .topbar-inner, .foot-grid, .foot-disclaimer { padding-left: 14px; padding-right: 14px; }
  .brand-mark { width: 28px; height: 28px; font-size: 14px; }
  .brand-name { font-size: 14px; }
  .nav .btn { padding: 7px 11px; font-size: 12px; }
  article p, article li { font-size: 14.5px; }
}
