/*
 * BrainSync Blog — blog.css
 * Shared styling for blog index + all article pages.
 * Brand tokens deliberately mirror web/style.css and web/player/player.css.
 * Self-contained: no external deps, no build step.
 */

/* ─── Design tokens ─────────────────────────────────────────────────────────── */
:root {
  --bg:      #070912;
  --bg2:     #0d1124;
  --card:    #121734;
  --line:    #222a52;
  --text:    #eef1ff;
  --muted:   #a3acd6;
  --accent:  #7c9cff;   /* sleep / blue  */
  --accent2: #5ad1c5;   /* calm / teal   */
  --focus:   #c79bff;   /* focus / violet */
  --measure: 68ch;      /* comfortable long-form reading width */
}

/* ─── Reset & base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: radial-gradient(1200px 800px at 50% -10%, #141a3a 0%, var(--bg) 55%) no-repeat, var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ─── Layout ────────────────────────────────────────────────────────────────── */
.wrap       { max-width: 1080px; margin: 0 auto; padding: 0 20px; width: 100%; }
.wrap-prose { max-width: var(--measure); margin: 0 auto; padding: 0 20px; width: 100%; }
main        { flex: 1; }

/* ─── Nav ───────────────────────────────────────────────────────────────────── */
.blog-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.back-link:hover { color: var(--text); text-decoration: none; }
.back-link svg { width: 16px; height: 16px; }

.logo {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 14px var(--accent);
}

.nav-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(124,156,255,.08);
  border: 1px solid rgba(124,156,255,.2);
  border-radius: 9px;
  padding: 6px 12px;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.nav-cta:hover {
  background: rgba(124,156,255,.16);
  border-color: var(--accent);
  color: var(--text);
  text-decoration: none;
}
@media (max-width: 480px) { .nav-cta { display: none; } }

/* ─── Breadcrumb ────────────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  padding: 18px 0 0;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); text-decoration: underline; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb-sep { color: var(--line); }

/* ─── Blog Index ─────────────────────────────────────────────────────────────── */
.index-hero {
  text-align: center;
  padding: 56px 0 40px;
}
.index-hero h1 {
  font-size: clamp(28px, 5.5vw, 46px);
  font-weight: 800;
  letter-spacing: -.4px;
  line-height: 1.1;
}
.index-hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.index-hero p {
  font-size: clamp(15px, 2.2vw, 18px);
  color: var(--muted);
  max-width: 560px;
  margin: 14px auto 0;
}

/* Article card grid */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
  padding: 16px 0 64px;
}
.article-card {
  background: linear-gradient(180deg, var(--card), #0e1330);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  transition: transform .18s, border-color .18s;
}
.article-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  text-decoration: none;
}
.article-card .card-topic {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
}
.article-card h2 {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.2px;
  text-align: left;
}
.article-card .card-summary {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}
.article-card .card-meta {
  font-size: 12.5px;
  color: #6b73a0;
}
.card-read-more {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

/* ─── Article page — prose ──────────────────────────────────────────────────── */
.article-header {
  padding: 40px 0 32px;
}
.article-topic {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.article-header h1 {
  font-size: clamp(26px, 5vw, 42px);
  font-weight: 800;
  letter-spacing: -.4px;
  line-height: 1.15;
  margin-bottom: 18px;
}
.article-header h1 .grad {
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.article-meta {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* Prose body */
.prose {
  padding-bottom: 64px;
}
.prose h2 {
  font-size: clamp(20px, 3.5vw, 26px);
  font-weight: 700;
  letter-spacing: -.25px;
  margin: 40px 0 14px;
  line-height: 1.25;
  color: var(--text);
  text-align: left;
}
.prose h3 {
  font-size: clamp(17px, 2.8vw, 20px);
  font-weight: 700;
  margin: 30px 0 10px;
  line-height: 1.3;
  color: var(--text);
}
.prose p {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 18px;
}
.prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol {
  margin: 0 0 18px 22px;
  color: var(--text);
}
.prose li {
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 8px;
}
.prose strong { color: var(--text); font-weight: 700; }
.prose em { color: var(--muted); font-style: italic; }
.prose a { color: var(--accent); }
.prose a:hover { text-decoration: underline; }

/* Key takeaways box */
.takeaways {
  background: linear-gradient(180deg, rgba(124,156,255,.09), rgba(90,209,197,.06));
  border: 1px solid rgba(124,156,255,.28);
  border-radius: 16px;
  padding: 22px 26px;
  margin: 8px 0 32px;
}
.takeaways h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--accent2);
  margin: 0 0 14px;
}
.takeaways ul {
  margin: 0 0 0 18px;
}
.takeaways li {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 7px;
}

/* Comparison table */
.noise-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 28px;
  font-size: 14.5px;
}
.noise-table th {
  background: rgba(124,156,255,.12);
  color: var(--text);
  font-weight: 700;
  padding: 12px 14px;
  border: 1px solid var(--line);
  text-align: left;
}
.noise-table td {
  padding: 11px 14px;
  border: 1px solid var(--line);
  color: var(--muted);
  vertical-align: top;
}
.noise-table tr:nth-child(even) td {
  background: rgba(18,23,52,.5);
}
@media (max-width: 640px) {
  .noise-table { font-size: 13px; }
  .noise-table th, .noise-table td { padding: 9px 10px; }
}

/* Divider */
.prose hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 36px 0;
}

/* Inline tool callout */
.tool-callout {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: linear-gradient(135deg, rgba(90,209,197,.08), rgba(124,156,255,.06));
  border: 1px solid rgba(90,209,197,.25);
  border-radius: 14px;
  padding: 20px 22px;
  margin: 28px 0;
}
.tool-callout .tc-icon { font-size: 26px; flex: none; margin-top: 2px; }
.tool-callout .tc-body { flex: 1; }
.tool-callout .tc-body strong { color: var(--text); display: block; margin-bottom: 4px; font-size: 15px; }
.tool-callout .tc-body p { font-size: 14px; color: var(--muted); margin: 0 0 10px; }
.tool-callout .tc-link {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent2);
  text-decoration: underline;
}

/* Mid-article CTA band */
.mid-cta {
  background: linear-gradient(135deg, #16204e, #101533);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 28px;
  text-align: center;
  margin: 36px 0;
}
.mid-cta h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}
.mid-cta p {
  font-size: 14.5px;
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto 20px;
}
.cta-badges {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.store-badge {
  display: flex;
  align-items: center;
  gap: 11px;
  background: #000;
  border: 1px solid #2a2f55;
  border-radius: 13px;
  padding: 11px 18px;
  min-width: 170px;
  text-decoration: none;
  color: var(--text);
  transition: transform .15s, border-color .15s;
}
.store-badge:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  text-decoration: none;
}
.store-badge svg { width: 24px; height: 24px; flex: none; }
.store-badge .b-sm { font-size: 10.5px; color: #c9cdf0; line-height: 1; display: block; }
.store-badge .b-lg { font-size: 16px; font-weight: 600; line-height: 1.2; display: block; }

/* End CTA (article bottom) */
.end-cta {
  background: linear-gradient(135deg, #16204e, #0f1430);
  border: 1px solid rgba(124,156,255,.25);
  border-radius: 20px;
  padding: 40px 32px;
  text-align: center;
  margin: 44px 0 0;
}
.end-cta h2 {
  font-size: clamp(20px, 4vw, 27px);
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -.3px;
}
.end-cta h2 .grad {
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.end-cta p {
  font-size: 15px;
  color: var(--muted);
  max-width: 440px;
  margin: 0 auto 24px;
  line-height: 1.65;
}

/* Related articles strip */
.related-section {
  padding: 44px 0 0;
}
.related-section h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--text);
  text-align: left;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.related-card {
  background: linear-gradient(180deg, var(--card), #0e1330);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: transform .18s, border-color .18s;
  display: block;
}
.related-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  text-decoration: none;
}
.related-card .r-topic {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.related-card h3 {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}

/* ─── Footer ────────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  margin-top: 48px;
  text-align: center;
}
.footer-badges {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.footer-fine {
  font-size: 12.5px;
  color: #6b73a0;
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.75;
}
.footer-fine a { color: var(--muted); text-decoration: underline; }
.footer-disclaimer {
  font-size: 11.5px;
  color: #565e8a;
  max-width: 600px;
  margin: 12px auto 0;
  line-height: 1.7;
  font-style: italic;
}

/* Sticky mobile CTA */
.sticky-cta {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: rgba(8,10,22,.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  gap: 10px;
  z-index: 50;
}
.sticky-cta a {
  flex: 1;
  text-align: center;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  color: #06122b;
  font-weight: 700;
  border-radius: 11px;
  padding: 12px;
  font-size: 14px;
  text-decoration: none;
  transition: filter .15s;
}
.sticky-cta a:hover { filter: brightness(1.08); text-decoration: none; }
@media (max-width: 640px) {
  .sticky-cta { display: flex; }
  body { padding-bottom: 66px; }
}
