:root {
  --bg:         #07090f;
  --bg-alt:     #09090f;
  --bg-card:    #0d1020;
  --bg-raised:  #12162a;
  --border:     #181d2e;
  --border-mid: #22283e;
  --text:       #f0ede6;
  --text-body:  #a8a6c0;
  --text-muted: #3d3d55;
  --accent:     #7b6fff;
  --accent-lo:  rgba(123,111,255,0.08);
  --glow:       rgba(123,111,255,0.15);
  --mono: 'IBM Plex Mono', monospace;
  --serif: 'Fraunces', serif;
  --sans: 'Manrope', sans-serif;
  --max: 1180px;
  --pad: 40px;
  --r: 8px;
  --article-w: 68ch;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

h1,h2,h3 { font-family: var(--serif); font-weight: 700; letter-spacing: -0.03em; color: var(--text); line-height: 1.1; }
p { color: var(--text-body); line-height: 1.8; }

.eyebrow {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent);
}

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--sans); font-size: 0.85rem; font-weight: 600;
  border-radius: var(--r); padding: 10px 20px; cursor: pointer;
  transition: all 0.18s ease; text-decoration: none; border: none; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 0 20px var(--glow); }
.btn-primary:hover { background: #d9a472; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-body); border: 1px solid var(--border-mid); }
.btn-ghost:hover { border-color: var(--text-muted); color: var(--text); }
.btn-sm { padding: 7px 14px; font-size: 0.78rem; }

/* ── PROGRESS BAR ── */
#progress-bar {
  position: fixed; top: 0; left: 0; height: 2px; z-index: 9998;
  background: var(--accent); width: 0%; transition: width 0.1s linear;
  box-shadow: 0 0 10px var(--accent);
}

/* ── NAV ── */
.nav {
  position: sticky; top: 0; z-index: 200; height: 62px;
  display: flex; align-items: center;
  border-bottom: 1px solid var(--border);
  background: rgba(7,9,15,0.92);
  backdrop-filter: blur(20px) saturate(1.2);
}
.nav-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--pad);
  width: 100%; display: flex; align-items: center;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  font-family: var(--serif); font-size: 1.35rem; font-weight: 700;
  color: var(--text); letter-spacing: -0.03em; flex-shrink: 0;
}
.nav-logo img { width: 24px; height: 24px; object-fit: contain; }
.nav-links { display: flex; gap: 28px; margin: 0 auto; }
.nav-link { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); text-decoration: none; transition: color 0.15s; }
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--accent); }

/* ── ARTICLE HEADER ── */
.article-header {
  padding: 56px 0 0;
  border-bottom: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.article-header-glow {
  position: absolute; top: -40%; right: 10%;
  width: 500px; height: 400px;
  background: radial-gradient(ellipse, rgba(200,147,90,0.06) 0%, transparent 65%);
  pointer-events: none;
}
.back-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted);
  text-decoration: none; transition: color 0.15s; margin-bottom: 32px;
}
.back-link:hover { color: var(--accent); }
.back-link::before { content: '←'; font-size: 0.8rem; }

.article-meta-row {
  display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.meta-tag {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent);
  border: 1px solid rgba(200,147,90,0.3); padding: 4px 10px; border-radius: 2px;
}
.meta-dot { color: var(--text-muted); font-size: 0.5rem; }
.meta-text { font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.08em; color: var(--text-muted); text-transform: uppercase; }

.article-header h1 {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  max-width: 18ch; margin-bottom: 28px; line-height: 1.08;
}

.article-byline {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 0; border-top: 1px solid var(--border);
}
.byline-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-raised); border: 1px solid var(--border-mid);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 0.85rem; color: var(--accent); font-weight: 700;
}
.byline-name { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.byline-role { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.byline-share {
  margin-left: auto; display: flex; gap: 8px;
}
.share-btn {
  width: 32px; height: 32px; border-radius: 5px;
  background: var(--bg-raised); border: 1px solid var(--border-mid);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color 0.15s, color 0.15s; color: var(--text-muted);
  font-family: var(--mono); font-size: 0.65rem; text-decoration: none;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── ARTICLE LAYOUT ── */
.article-layout {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--pad);
  display: grid; grid-template-columns: 1fr 260px; gap: 64px; align-items: start;
  padding-top: 56px; padding-bottom: 80px;
}

/* ── ARTICLE BODY ── */
.article-body { min-width: 0; }

.article-cover-block {
  width: 100%; aspect-ratio: 19/9;
  background: linear-gradient(135deg, #0e0c18 0%, #151228 50%, #0e0c18 100%);
  border: 1px solid var(--border); border-radius: var(--r);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  margin-bottom: 44px; overflow: hidden; position: relative;
}
.article-cover-block::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 70% at 50% 50%, var(--cover-glow, rgba(123,111,255,0.12)) 0%, transparent 70%);
}
.article-cover-block::after {
  content: ''; position: absolute; inset: 0; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40' fill='%23fff' fill-opacity='1'/%3E%3C/svg%3E");
}
.cover-label {
  font-family: var(--mono); font-size: 0.7rem; color: var(--cover-accent, var(--accent));
  letter-spacing: 0.18em; text-transform: uppercase; position: relative; z-index: 1;
  border: 1px solid var(--cover-accent, var(--accent)); border-radius: 3px;
  padding: 5px 12px; opacity: 0.85;
}
.cover-wordmark {
  font-family: var(--serif); font-size: clamp(1.4rem, 4vw, 2.4rem); font-weight: 300;
  color: var(--text); letter-spacing: 0.08em; position: relative; z-index: 1; opacity: 0.18;
}
/* Category colour schemes */
.cover-agents   { --cover-glow: rgba(123,111,255,0.14); --cover-accent: #7b6fff; }
.cover-ai       { --cover-glow: rgba(56,189,248,0.12);  --cover-accent: #38bdf8; }
.cover-venture  { --cover-glow: rgba(52,211,153,0.12);  --cover-accent: #34d399; }
.cover-company  { --cover-glow: rgba(200,147,90,0.12);  --cover-accent: #c8935a; }
.cover-market   { --cover-glow: rgba(251,191,36,0.12);  --cover-accent: #fbbf24; }
.cover-security { --cover-glow: rgba(239,68,68,0.12);   --cover-accent: #ef4444; }
.cover-retail   { --cover-glow: rgba(167,139,250,0.12); --cover-accent: #a78bfa; }
.cover-data     { --cover-glow: rgba(99,102,241,0.14);  --cover-accent: #6366f1; }

/* ── PROSE ── */
.prose { max-width: var(--article-w); }
.prose p { font-size: 1.05rem; line-height: 1.82; color: var(--text-body); margin-bottom: 24px; }
.prose h2 {
  font-size: 1.45rem; margin: 48px 0 16px; padding-top: 48px;
  border-top: 1px solid var(--border); color: var(--text);
  scroll-margin-top: 80px;
}
.prose h3 { font-size: 1.15rem; margin: 32px 0 12px; color: var(--text); }
.prose ul, .prose ol {
  padding-left: 0; margin-bottom: 24px; list-style: none;
  display: flex; flex-direction: column; gap: 12px;
}
.prose ul li, .prose ol li {
  font-size: 1rem; color: var(--text-body); line-height: 1.75;
  padding-left: 20px; position: relative;
}
.prose ul li::before { content: '→'; position: absolute; left: 0; color: var(--accent); font-size: 0.85rem; }
.prose ol { counter-reset: list; }
.prose ol li { counter-increment: list; }
.prose ol li::before { content: counter(list, decimal-leading-zero); position: absolute; left: 0; color: var(--accent); font-family: var(--mono); font-size: 0.72rem; top: 4px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(200,147,90,0.3); transition: text-decoration-color 0.15s; }
.prose a:hover { text-decoration-color: var(--accent); }

/* Lead paragraph */
.article-lead {
  font-size: 1.2rem; line-height: 1.75; color: #b0adc4;
  border-left: 3px solid var(--accent); padding-left: 24px;
  margin-bottom: 40px; font-style: normal;
}

/* Pull quote */
.pull-quote {
  margin: 40px 0; padding: 28px 32px;
  border-left: 3px solid var(--accent);
  background: var(--bg-card); border-radius: 0 var(--r) var(--r) 0;
  position: relative;
}
.pull-quote p {
  font-family: var(--serif); font-size: 1.25rem; line-height: 1.5;
  color: var(--text); margin: 0; font-style: italic; letter-spacing: -0.01em;
}

/* Highlight box */
.highlight-box {
  background: var(--bg-card); border: 1px solid var(--border-mid);
  border-radius: var(--r); padding: 24px 28px; margin: 32px 0;
}
.highlight-box h4 {
  font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px; font-weight: 500;
}
.highlight-box p { font-size: 0.9rem; margin: 0; line-height: 1.7; }

/* Sources */
.sources-section { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--border); }
.sources-label {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 16px; display: block;
}
.source-item {
  display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.source-item:last-child { border-bottom: none; }
.source-num {
  font-family: var(--mono); font-size: 0.6rem; color: var(--accent);
  width: 18px; flex-shrink: 0; padding-top: 2px;
}
.source-item a { font-size: 0.85rem; color: var(--text-body); text-decoration: none; transition: color 0.15s; line-height: 1.5; }
.source-item a:hover { color: var(--accent); }
.source-pub { font-family: var(--mono); font-size: 0.6rem; color: var(--text-muted); letter-spacing: 0.06em; display: block; margin-top: 2px; }

/* Content notice */
.content-notice {
  margin-top: 32px; padding: 14px 18px;
  background: rgba(255,255,255,0.02); border: 1px solid var(--border);
  border-radius: 5px; font-size: 0.78rem; color: var(--text-muted); line-height: 1.6;
}

/* Article CTA block */
.article-cta-block {
  margin-top: 48px; padding: 36px;
  background: var(--bg-card); border: 1px solid rgba(200,147,90,0.2);
  border-radius: var(--r);
}
.article-cta-block h3 { font-size: 1.15rem; margin-bottom: 8px; }
.article-cta-block p { font-size: 0.875rem; margin-bottom: 20px; }
.cta-buttons { display: flex; gap: 10px; flex-wrap: wrap; }

/* Resources block */
.resources-block {
  margin-top: 20px; padding: 28px 32px;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--r);
}
.resources-block h4 { font-size: 0.85rem; margin-bottom: 6px; color: var(--text); letter-spacing: -0.01em; }
.resources-block p { font-size: 0.82rem; margin-bottom: 16px; }
.resources-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── TOC SIDEBAR ── */
.article-sidebar { position: sticky; top: 82px; }
.toc-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 24px; margin-bottom: 16px;
}
.toc-label {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 16px; display: block;
}
.toc-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.toc-item a {
  display: block; font-size: 0.82rem; color: var(--text-muted); text-decoration: none;
  padding: 7px 10px; border-radius: 4px; transition: all 0.15s; line-height: 1.4;
  border-left: 2px solid transparent;
}
.toc-item a:hover { color: var(--text); background: var(--bg-raised); }
.toc-item a.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-lo); }

.sidebar-cta {
  background: var(--bg-card); border: 1px solid rgba(200,147,90,0.18);
  border-radius: var(--r); padding: 22px; margin-bottom: 16px;
}
.sidebar-cta h4 { font-size: 0.9rem; margin-bottom: 8px; color: var(--text); }
.sidebar-cta p { font-size: 0.8rem; margin-bottom: 16px; line-height: 1.6; }
.sidebar-cta .btn { width: 100%; justify-content: center; }

.reading-progress-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 16px 18px;
}
.rp-label {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px;
}
.rp-bar-bg { background: var(--bg-raised); border-radius: 99px; height: 3px; overflow: hidden; }
.rp-bar { height: 100%; background: var(--accent); border-radius: 99px; width: 0%; transition: width 0.15s ease; }

/* ── RELATED ARTICLES ── */
.related-section { border-top: 1px solid var(--border); padding: 72px 0 80px; }
.related-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 32px; }
.related-header h2 { font-size: 1.4rem; }
.related-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.rel-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
}
.rel-card:hover { border-color: var(--border-mid); transform: translateY(-2px); }
.rel-cover {
  width: 100%; aspect-ratio: 19/9;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 0.58rem; color: var(--text-muted); letter-spacing: 0.08em;
}
.rel-body { padding: 20px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.rel-topic { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.rel-title { font-size: 0.9rem; line-height: 1.4; font-weight: 600; color: var(--text); }
.rel-foot { display: flex; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--border); font-family: var(--mono); font-size: 0.58rem; color: var(--text-muted); margin-top: auto; }

/* ── FOOTER ── */
.footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 64px 0 36px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 56px; margin-bottom: 48px; }
.footer-name { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; color: var(--text); letter-spacing: -0.03em; display: block; margin-bottom: 12px; }
.footer-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.65; max-width: 28ch; }
.footer-col h4 { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 18px; }
.footer-col a { display: block; font-size: 0.85rem; color: var(--text-muted); text-decoration: none; margin-bottom: 10px; transition: color 0.15s; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; border-top: 1px solid var(--border); font-family: var(--mono); font-size: 0.62rem; color: var(--text-muted); letter-spacing: 0.06em; }
.footer-legal { display: flex; gap: 20px; }
.footer-legal a { color: var(--text-muted); text-decoration: none; font-size: 0.62rem; }
.footer-legal a:hover { color: var(--text); }

/* ── MOBILE HAMBURGER ── */
.nav-hamburger {
  display: none; background: none; border: none; cursor: pointer;
  padding: 6px; color: var(--text-muted); margin-left: auto;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px; background: currentColor;
  margin: 4px 0; transition: all 0.2s;
}
.mobile-drawer {
  display: none; position: fixed; inset: 62px 0 0 0; z-index: 199;
  background: var(--bg); border-top: 1px solid var(--border);
  flex-direction: column; padding: 24px 20px; gap: 4px;
}
.mobile-drawer.open { display: flex; }
.mobile-drawer a {
  font-size: 0.95rem; font-weight: 500; color: var(--text-muted);
  text-decoration: none; padding: 12px 8px; border-bottom: 1px solid var(--border);
  transition: color 0.15s;
}
.mobile-drawer a:hover { color: var(--text); }
.mobile-drawer .btn { margin-top: 16px; justify-content: center; }

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
  .article-layout { grid-template-columns: 1fr; gap: 40px; padding-top: 36px; padding-bottom: 56px; }
  .article-sidebar { display: none; }
  .related-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 640px) {
  :root { --pad: 20px; }
  .nav-links, .nav > .nav-inner > .btn { display: none; }
  .nav-hamburger { display: block; }
  .article-header h1 { font-size: clamp(1.75rem, 7vw, 2.6rem); }
  .related-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .ad-container-in-article { overflow: hidden; }
}
@media (max-width: 640px) { body::after { display: none; } }
