/*
 * Author: Hariram S <ramhari4090@gmail.com>
 *
 * Dark theme for the blog. The articles keep their layout from
 * static/css/design-system.css; this file, loaded after it, recolours every
 * part of that layout for the site's dark style: near-black ground, white
 * headings, grey running text (4.5:1 or more), thin low-alpha borders, pill
 * tags, and the violet accent on links and markers. A few article elements
 * carry inline colours from the original markup; those are overridden here
 * with !important, which is the only way a stylesheet can win over a style
 * attribute.
 *
 * Used by:
 *     landing/blog/index.html, landing/blog/*.html
 *
 * Depends on:
 *     landing/static/css/design-system.css (article layout this recolours)
 *     landing/assets/chrome.css            (--font, --mono, top bar, footer)
 */

:root {
  --primary: #b4a3ff;
  --dark: #0a0a0b;
  --light-1: #111113;
  --light-2: rgba(255, 255, 255, .1);
  --light-3: rgba(255, 255, 255, .16);
  --text-primary: #ededed;
  --text-muted: #a1a1aa;
}
html { background: #0a0a0b; }
body { background: #0a0a0b; color: #ededed; }
h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 { color: #fff; letter-spacing: -0.04em; }
::selection { background: rgba(124, 92, 255, .45); color: #fff; }
:focus-visible { outline: 2px solid #7c5cff; outline-offset: 3px; }
[style*="background:#fff"] { background: #0a0a0b !important; }
[style*="color:#374151"] { color: #d4d4d8 !important; }

/* Hero blocks */
.page-hero, .post-hero {
  background: radial-gradient(60% 120% at 50% 0%, rgba(124, 92, 255, .22), transparent 70%), #0a0a0b;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.page-hero .sub, .post-meta, .post-crumb { color: #a1a1aa; }
.post-crumb:hover { color: #fff; }
.post-hero h1 { font-weight: 600; }
.post-hero-img {
  height: 200px; border-radius: 16px 16px 0 0; border: 1px solid rgba(255, 255, 255, .1); border-bottom: 0;
  background: radial-gradient(rgba(255, 255, 255, .1) 1px, transparent 1px) 0 0 / 22px 22px, radial-gradient(60% 100% at 50% 100%, rgba(124, 92, 255, .35), transparent 70%), #111113;
}
.pill { background: rgba(124, 92, 255, .14); color: #d6ccff; border: 1px solid rgba(124, 92, 255, .4); font-family: var(--mono); font-weight: 500; }
.post-avatar, .post-side .avatar { background: #1f1f23; color: #fff; border: 1px solid rgba(255, 255, 255, .16); }

/* Article */
.post-article h2 { color: #fff; font-weight: 600; letter-spacing: -0.03em; }
.post-article h3 { color: #fff; }
.post-article p, .post-article li { color: #d4d4d8; }
.post-article a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .35); text-underline-offset: 4px; }
.post-article a:hover { text-decoration-color: #fff; }
.post-article strong, .post-article b { color: #fff; }
.post-article li::marker { color: #b4a3ff; }
.post-article blockquote { background: #111113; border-left-color: #7c5cff; color: #ededed; }
.post-article .mono, .post-article code { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); color: #e4dcff; font-family: var(--mono); }
.post-article pre { background: #111113; border: 1px solid rgba(255, 255, 255, .1); }
.post-article table { border-collapse: collapse; width: 100%; color: #d4d4d8; }
.post-article th, .post-article td { border: 1px solid rgba(255, 255, 255, .12) !important; background: transparent !important; color: #d4d4d8 !important; }
.post-article th { color: #fff !important; }
.post-cta { background: radial-gradient(80% 120% at 50% 0%, rgba(124, 92, 255, .2), transparent 70%), #111113; border: 1px solid rgba(255, 255, 255, .12); }
.post-side .card { background: #111113; border-color: rgba(255, 255, 255, .1); color: #ededed; }
.post-side .share-label { color: #a1a1aa; font-family: var(--mono); }
.post-share a, .post-share button { color: #d4d4d8; }
.post-share a:hover, .post-share button:hover { color: #fff; }

/* Index cards */
.blog-card { background: #111113; border-color: rgba(255, 255, 255, .1); }
.blog-card:hover { border-color: rgba(124, 92, 255, .5); box-shadow: none; }
.blog-card h4 a { color: #fff !important; }
.blog-card .date { color: #a1a1aa; font-family: var(--mono); }
.blog-card .exc { color: #a1a1aa; }
.blog-card .more { color: #d6ccff; }

/* Buttons from the old stylesheet become the site's pills */
.btn { border-radius: 999px; font-family: var(--font); }
.btn-gradient, .btn-gradient-wide, .btn-primary { background: #fff; color: #0a0a0b; box-shadow: 0 8px 30px -8px rgba(124, 92, 255, .55); }
.btn-gradient:hover, .btn-gradient-wide:hover, .btn-primary:hover { box-shadow: 0 0 0 4px rgba(124, 92, 255, .22), 0 12px 40px -8px rgba(124, 92, 255, .7); }
.btn-outline, .btn-ghost { color: #fff; border: 1px solid rgba(255, 255, 255, .2); }
.btn-outline:hover, .btn-ghost:hover { background: rgba(255, 255, 255, .06); color: #fff; }

/* Closing band */
.cta-band { background: radial-gradient(70% 100% at 50% 100%, rgba(124, 92, 255, .28), transparent 70%), #000; border-top: 1px solid rgba(255, 255, 255, .1); }
.cta-bars { display: none; }
.cta-inner h2 { font-weight: 600; }
.cta-inner .sub { color: #a1a1aa; }
.cta-inner .fine { color: #a1a1aa; }

@media (prefers-reduced-motion: reduce) {
  .btn, .blog-card { transition: none; }
  .btn:hover, .blog-card:hover { transform: none; }
}

/* Quick-answer block: a direct 40-60 word answer at the top of an article, so
   readers and AI answer engines get the point first (AEO extractability). */
.quick-answer {
  background: var(--light-1);
  border: 1px solid rgba(255, 255, 255, .1);
  border-left: 3px solid var(--primary);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 0 0 30px;
}
.quick-answer .qa-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
}
.quick-answer p { margin: 0; color: #ededed; }

/* Simple comparison table for "X vs Y" posts. */
.cmp-grid { width: 100%; border-collapse: collapse; margin: 8px 0 28px; font-size: 15px; }
.cmp-grid th, .cmp-grid td { text-align: left; padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, .1); vertical-align: top; }
.cmp-grid thead th { color: #fff; font-weight: 600; border-bottom-color: rgba(255, 255, 255, .18); }
.cmp-grid tbody th { color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.cmp-grid td { color: #ededed; }
