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

:root.light-mode {
  --bg: #f8fafc; --surface: #ffffff; --card: #f1f5f9;
  --border: #e2e8f0; --text: #0f172a; --muted: #64748b;
}
:root {
  --bg: #0a0c10;
  --surface: #111318;
  --card: #14171f;
  --border: #1e2330;
  --gold: #f0b429;
  --gold-dim: #c8961e;
  --green: #22c55e;
  --red: #ef4444;
  --text: #e8eaf0;
  --muted: #6b7280;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 0; opacity: 0.4;
}

nav {
  position: fixed; top: 0; width: 100%; z-index: 100;
  background: rgba(10,12,16,0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem; color: var(--gold); text-decoration: none;
}
.nav-logo span { color: var(--text); }
.nav-back {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); text-decoration: none;
  font-size: 0.9rem; font-weight: 500;
  transition: color 0.2s;
}
.nav-back:hover { color: var(--gold); }

/* HERO IMAGE */
.post-hero {
  margin-top: 64px;
  position: relative;
  height: 480px;
  overflow: hidden;
}
.post-hero img {
  width: 100%; height: 100%; object-fit: cover;
  filter: brightness(0.45);
}
.post-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, transparent 60%);
}
.post-hero-content {
  position: absolute; bottom: 0; left: 0; right: 0;
  max-width: 800px; margin: 0 auto;
  padding: 0 2rem 3rem;
}
.post-category {
  display: inline-block;
  background: rgba(96,165,250,0.15);
  border: 1px solid rgba(96,165,250,0.3);
  color: #60a5fa;
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 20px;
  margin-bottom: 1rem;
}
.post-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.2;
  margin-bottom: 1.2rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.post-meta {
  display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap;
}
.post-author {
  display: flex; align-items: center; gap: 0.6rem;
}
.author-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700; color: #0a0c10;
}
.author-info .name { font-weight: 600; font-size: 0.9rem; }
.author-info .role { font-size: 0.78rem; color: var(--muted); }
.meta-divider { width: 1px; height: 30px; background: var(--border); }
.meta-item {
  display: flex; align-items: center; gap: 5px;
  color: var(--muted); font-size: 0.82rem;
}

/* ARTICLE LAYOUT */
.article-wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
  position: relative; z-index: 1;
}

/* Progress bar */
.progress-bar {
  position: fixed; top: 64px; left: 0;
  height: 3px; background: var(--gold);
  width: 0%; z-index: 99;
  transition: width 0.1s;
}

/* TOC */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 12px;
  padding: 1.4rem 1.6rem;
  margin-bottom: 2.5rem;
}
.toc h4 {
  font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 0.8rem;
}
.toc ol { padding-left: 1.2rem; }
.toc li { margin-bottom: 0.4rem; }
.toc a {
  color: var(--muted); text-decoration: none;
  font-size: 0.9rem; transition: color 0.2s;
}
.toc a:hover { color: var(--gold); }

/* ARTICLE CONTENT */
.article-body h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  margin: 2.5rem 0 1rem;
  color: var(--text);
  padding-top: 1rem;
}
.article-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.8rem 0 0.8rem;
  color: var(--gold);
}
.article-body p {
  color: #c5c9d6;
  line-height: 1.85;
  font-size: 1.02rem;
  margin-bottom: 1.3rem;
}
.article-body strong { color: var(--text); }

/* Candlestick visual */
.candle-demo {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3rem;
}
.candle {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
}
.candle-label { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.candle-visual {
  display: flex; flex-direction: column; align-items: center;
}
.wick { width: 2px; background: currentColor; }
.body { width: 28px; border-radius: 2px; }
.bull { color: var(--green); }
.bear { color: var(--red); }

/* Callout box */
.callout {
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  margin: 1.5rem 0;
  display: flex; gap: 0.8rem;
}
.callout-tip {
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.2);
}
.callout-warning {
  background: rgba(249,115,22,0.08);
  border: 1px solid rgba(249,115,22,0.2);
}
.callout-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; }
.callout-text { font-size: 0.92rem; line-height: 1.6; color: #c5c9d6; }
.callout-text strong { color: var(--text); }

/* Pattern table */
.pattern-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem; margin: 1.5rem 0;
}
.pattern-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
}
.pattern-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.3rem; }
.pattern-signal { font-size: 0.78rem; font-weight: 600; margin-bottom: 0.4rem; }
.pattern-signal.bull { color: var(--green); }
.pattern-signal.bear { color: var(--red); }
.pattern-desc { font-size: 0.82rem; color: var(--muted); line-height: 1.5; }

/* Tags */
.post-tags {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin: 2.5rem 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.tag {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 5px 14px; border-radius: 20px;
  font-size: 0.8rem;
}

/* Related */
.related {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.related h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem; margin-bottom: 1.2rem;
}
.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media(max-width:600px) { .related-grid { grid-template-columns: 1fr; } }
.related-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  text-decoration: none; display: block;
  transition: border-color 0.2s, transform 0.2s;
}
.related-card:hover {
  border-color: rgba(240,180,41,0.3);
  transform: translateY(-3px);
}
.related-card img { width: 100%; height: 140px; object-fit: cover; }
.related-card-body { padding: 1rem; }
.related-card-cat { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.4rem; }
.related-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem; line-height: 1.3; color: var(--text);
}

/* Share bar */
.share-bar {
  position: fixed; right: 2rem; top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 0.8rem;
  z-index: 50;
}
@media(max-width:1100px) { .share-bar { display: none; } }
.share-btn {
  width: 40px; height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted);
  transition: all 0.2s;
  text-decoration: none;
}
.share-btn:hover { border-color: var(--gold); color: var(--gold); }
.share-label { font-size: 0.65rem; text-align: center; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
