/* ============================================================
   KhanAnalytics Blog — Sinartis-inspired light theme
   Deep navy + white, yellow & purple accents
   Parkinsans (display) + Hanken Grotesk (body)
   Shared by the blog index AND all article pages.
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --navy: #080D49; --navy-deep: #05092E; --navy-2: #0f1a5e;
  --yellow: #F7BB16; --purple: #A11CC6; --purple-lt: #B17AF6;
  --ink: #080D49; --body: #33366b; --muted: #5a6270; --hero-muted: #9c9eb6;
  --bg: #ffffff; --bg-soft: #f7f6f3; --line: #e7e7f1;
  --display: 'Parkinsans', sans-serif; --sans: 'Hanken Grotesk', sans-serif;
  --ease: cubic-bezier(.16,1,.3,1);
  --r-lg: 22px; --r: 16px; --r-sm: 12px;
  --shadow: 0 18px 50px -22px rgba(8,13,73,.25);
  --shadow-sm: 0 10px 30px -18px rgba(8,13,73,.28);
}
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--body); font-family: var(--sans); line-height: 1.7; font-weight: 400; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); color: var(--ink); line-height: 1.12; font-weight: 500; }
a { color: inherit; text-decoration: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 2.5rem; }

/* ---------- NAV ---------- */
nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: 1.2rem 2.5rem; background: var(--navy-deep); border-bottom: 1px solid rgba(255,255,255,.08); }
.nav-logo { font-family: var(--display); font-size: 1.4rem; font-weight: 600; letter-spacing: .02em; color: #fff; }
.nav-logo span { color: var(--yellow); }
.nav-links { display: flex; gap: 2rem; list-style: none; align-items: center; }
.nav-links a { font-size: .8rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: #fff; opacity: .78; transition: opacity .2s, color .2s; position: relative; padding: 4px 0; }
.nav-links a:hover { opacity: 1; color: var(--yellow); }
.nav-links a.active { opacity: 1; color: var(--yellow); }
.lang-switch { border: 1px solid rgba(255,255,255,.28); padding: .3rem .7rem !important; border-radius: 8px; }

/* ---------- PAGE HEADER (index) ---------- */
.page-header { padding: 9rem 2.5rem 4rem; border-bottom: 1px solid var(--line); }
.section-label { font-size: .72rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--purple); margin-bottom: 1.2rem; display: flex; align-items: center; gap: .75rem; }
.section-label::before { content: ''; display: inline-block; width: 26px; height: 1px; background: var(--yellow); }
.page-title { font-size: clamp(2.8rem, 7vw, 6rem); line-height: 1; color: var(--ink); letter-spacing: .01em; }
.page-desc { font-size: 1rem; color: var(--muted); max-width: 520px; margin-top: 1.5rem; line-height: 1.75; }

/* ---------- FILTER ---------- */
.filter-bar { padding: 1.5rem 2.5rem; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.filter-tabs { display: flex; gap: .5rem; flex-wrap: wrap; }
.filter-tab { font-size: .74rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; padding: .5rem 1.1rem; border: 1px solid var(--line); color: var(--muted); background: #fff; border-radius: 999px; cursor: pointer; transition: all .25s; }
.filter-tab.active, .filter-tab:hover { border-color: var(--purple); color: var(--purple); background: #faf6ff; }

/* ---------- POST GRID ---------- */
.posts-section { padding: 3.5rem 2.5rem 6rem; }
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.post-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 2rem; display: flex; flex-direction: column; gap: 1rem; transition: transform .3s var(--ease), box-shadow .3s, border-color .25s; position: relative; overflow: hidden; }
.post-card::before { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: var(--yellow); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease); }
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: #dcdbf0; }
.post-card:hover::before { transform: scaleX(1); }
.post-type { font-size: .64rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; padding: .28rem .7rem; border: 1px solid; border-radius: 999px; align-self: flex-start; }
.post-type--article { color: var(--purple); border-color: #e4d6f7; background: #faf6ff; }
.post-type--case-study { color: #1d4ed8; border-color: #dbe3fb; background: #f3f6ff; }
.post-title { font-size: 1.5rem; line-height: 1.15; letter-spacing: .01em; }
.post-excerpt { font-size: .9rem; color: var(--muted); line-height: 1.7; flex: 1; }
.post-meta { display: flex; align-items: center; justify-content: space-between; font-size: .74rem; color: var(--hero-muted); letter-spacing: .05em; margin-top: auto; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.post-tags { display: flex; gap: .4rem; flex-wrap: wrap; }
.post-tag { font-size: .62rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line); border-radius: 999px; padding: .2rem .55rem; color: var(--muted); }
.post-arrow { color: var(--purple); font-size: 1.1rem; }
.coming-soon { padding: 3rem; text-align: center; color: var(--muted); font-size: .9rem; }

/* ---------- ARTICLE HEADER ---------- */
.post-hero { padding: 9rem 2.5rem 4rem; max-width: 760px; margin: 0 auto; border-bottom: 1px solid var(--line); }
.back-link { display: inline-flex; align-items: center; gap: .4rem; font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 2rem; transition: color .2s; }
.back-link:hover { color: var(--purple); }
.post-type-badge { font-size: .64rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; padding: .28rem .7rem; border: 1px solid #e4d6f7; border-radius: 999px; color: var(--purple); background: #faf6ff; display: inline-block; margin-bottom: 1.5rem; }
.post-hero h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); line-height: 1.08; margin-bottom: 1.3rem; }
.post-intro { font-size: 1.05rem; color: var(--muted); line-height: 1.75; }
.post-meta-bar { display: flex; gap: 2rem; margin-top: 1.4rem; flex-wrap: wrap; font-size: .8rem; color: var(--hero-muted); }

/* ---------- ARTICLE BODY ---------- */
.post-body { padding: 3rem 0 5rem; }
.post-body .container { max-width: 760px; }
.post-body h2 { font-size: 1.9rem; font-weight: 600; margin: 3rem 0 1rem; }
.post-body h3 { font-size: .84rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--purple); margin: 2rem 0 .6rem; }
.post-body p { font-size: .97rem; color: var(--body); margin-bottom: 1.1rem; line-height: 1.8; }
.post-body strong { color: var(--ink); font-weight: 600; }
.post-body a { color: var(--purple); text-decoration: underline; text-underline-offset: 3px; }
.post-body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; background: var(--bg-soft); padding: .1em .35em; border-radius: 6px; color: var(--navy); }
.post-body ul, .post-body ol { padding-left: 1.4rem; margin: 0 0 1.1rem; color: var(--body); }
.post-body li { margin-bottom: .45rem; }
.post-body blockquote { border-left: 3px solid var(--yellow); background: var(--bg-soft); padding: 1rem 1.4rem; margin: 1.5rem 0; color: var(--body); border-radius: 0 12px 12px 0; }
.post-body table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .92rem; }
.post-body table th, .post-body table td { border: 1px solid var(--line); padding: .6rem .9rem; text-align: left; }
.post-body table th { background: var(--bg-soft); color: var(--ink); }

/* callout */
.callout { background: #faf6ff; border-left: 3px solid var(--purple); border-radius: 0 14px 14px 0; padding: 1.25rem 1.5rem; margin: 2rem 0; }
.callout p { margin: 0; font-size: .92rem; color: var(--body); }

/* video embed */
.video-embed { margin: 2rem 0; }
.video-embed-caption { font-size: .82rem; color: var(--muted); margin-top: .75rem; }
.video-embed-frame { position: relative; width: 100%; padding-top: 56.25%; background: var(--navy-deep); border: 1px solid var(--line); border-radius: var(--r); }
.video-embed-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--r); }

/* checklist */
.checklist { display: flex; flex-direction: column; gap: 12px; margin: 1.5rem 0 2rem; }
.check-item { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.25rem; display: flex; gap: 1rem; align-items: flex-start; transition: transform .25s var(--ease), box-shadow .25s, border-color .2s; }
.check-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: #dcdbf0; }
.check-num { font-family: var(--display); font-weight: 600; font-size: .9rem; color: var(--yellow); letter-spacing: .1em; min-width: 28px; margin-top: .05rem; }
.check-content { flex: 1; }
.check-title { font-size: .9rem; font-weight: 700; color: var(--ink); margin-bottom: .2rem; }
.check-desc { font-size: .82rem; color: var(--muted); line-height: 1.55; }
.check-badge { font-size: .6rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: .18rem .5rem; border: 1px solid; border-radius: 999px; margin-left: auto; flex-shrink: 0; margin-top: .15rem; }
.check-badge--critical { color: #dc2626; border-color: #f3c8c8; background: #fdf3f3; }
.check-badge--high { color: #b45309; border-color: #f3ddb0; background: #fdf7ec; }
.check-badge--medium { color: #1d4ed8; border-color: #dbe3fb; background: #f3f6ff; }

/* FAQ */
.faq-section { border-top: 1px solid var(--line); margin-top: 3rem; padding-top: 2.5rem; }
.faq-item { border-bottom: 1px solid var(--line); padding: 1.25rem 0; }
.faq-q { font-size: .95rem; font-weight: 700; color: var(--ink); margin-bottom: .6rem; }
.faq-a { font-size: .88rem; color: var(--muted); line-height: 1.7; }

/* author bio */
.author-bio { display: flex; gap: 1.25rem; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.5rem 1.75rem; margin: 2.5rem 0 0; }
.author-bio-name { font-weight: 700; color: var(--ink); margin-bottom: .35rem; }
.author-bio-text { font-size: .85rem; color: var(--muted); line-height: 1.7; }
.author-bio-text a { color: var(--purple); }

/* ---------- CTA (dark, matches homepage) ---------- */
.post-cta { background: var(--navy-deep); border-top: 1px solid rgba(255,255,255,.08); border-bottom: 1px solid rgba(255,255,255,.08); padding: 5rem 2.5rem; text-align: center; position: relative; overflow: hidden; }
.post-cta::before { content: ''; position: absolute; width: 420px; height: 420px; background: rgba(161,28,198,.35); border-radius: 50%; filter: blur(110px); top: -180px; left: 50%; transform: translateX(-50%); }
.post-cta .container { position: relative; max-width: 760px; }
.post-cta h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); color: #fff; margin-bottom: 1rem; }
.post-cta p { color: #c9cbe2; max-width: 480px; margin: 0 auto 2rem; font-size: .95rem; font-weight: 300; }
.cta-btn { display: inline-flex; align-items: center; gap: .6rem; background: var(--yellow); color: var(--navy-deep); padding: .95rem 2rem; font-weight: 600; font-size: .9rem; letter-spacing: .02em; border-radius: 14px; transition: transform .25s var(--ease), background .25s; }
.cta-btn:hover { transform: translateY(-2px); background: #ffd04e; }

/* ---------- FOOTER (dark, matches homepage) ---------- */
footer { background: var(--navy-deep); color: var(--hero-muted); padding: 2.2rem 2.5rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; border-top: 1px solid rgba(255,255,255,.10); }
.footer-brand { font-family: var(--display); font-size: 1rem; letter-spacing: .04em; color: #fff; opacity: .85; }
.footer-links { display: flex; gap: 2rem; list-style: none; }
.footer-links a { font-size: .74rem; color: var(--hero-muted); letter-spacing: .08em; text-transform: uppercase; transition: color .2s; }
.footer-links a:hover { color: var(--yellow); }

/* ---------- RELATED POSTS ---------- */
.related-posts { max-width: 760px; margin: 3rem auto; padding: 2rem 2.5rem; border-top: 1px solid var(--line); }
.related-posts h3 { font-size: 1.35rem; color: var(--ink); margin-bottom: 1rem; }
.related-posts ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .75rem; }
.related-posts a { font-size: .85rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: .4rem .9rem; display: inline-block; transition: .25s; }
.related-posts a:hover { border-color: var(--purple); color: var(--purple); background: #faf6ff; }

@media (max-width: 640px) {
  nav { padding: 1.15rem 1.5rem; gap: .75rem; }
  .nav-links { gap: 1.1rem; }
  .nav-links a { letter-spacing: .06em; }
  .container, .page-header, .post-hero, .filter-bar, .posts-section, .post-cta { padding-left: 1.5rem; padding-right: 1.5rem; }
  .posts-grid { grid-template-columns: 1fr; }
}