/* ProtoQuiz Blog Shared Styles v4 */
/* LIGHT, matching the rest of the site. The blog used to carry a warm "lifted dark"
   identity of its own; it now uses the site palette, because a reader arriving from the
   footer should not cross a seam. Tokens alias onto chrome.css so the palette has ONE
   home -- change a colour there and the blog follows.

   --cyan/--violet are kept as aliases so legacy refs in the 15 posts recolor without
   each post being edited. --amber keeps its name for the same reason but is now the
   brand accent: amber on paper fails contrast, and the site has exactly one accent. */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Sora:wght@400;500;600;700;800&display=swap');

:root {
  /* SELF-SUFFICIENT ON PURPOSE. The 15 posts load ONLY this file -- not chrome.css --
     so these must be real values, not var() aliases onto a stylesheet that is not
     there. They are the same colours chrome.css defines; if that palette moves, this
     block moves with it. (The blog INDEX does load chrome.css, and these values are
     identical, so the two agree.) */
  --bg: oklch(99.4% 0.002 265);
  --bg-deep: oklch(97.6% 0.004 265);
  --panel: oklch(97.6% 0.004 265);
  --card: oklch(99.4% 0.002 265);
  --ink: oklch(21% 0.017 265);
  --ink-2: oklch(44% 0.014 265);
  --muted: oklch(44% 0.014 265);
  --line: oklch(91.5% 0.007 265);
  --paper: oklch(99.4% 0.002 265);
  --accent: oklch(50% 0.196 265);
  --accent-hover: oklch(43% 0.19 265);
  /* Brand accent. --green stays a real green: it marks success, not brand. */
  --amber: var(--accent);
  --amber-deep: var(--accent-hover);
  --green: oklch(58% 0.15 155);
  --cyan: var(--amber);
  --violet: var(--amber-deep);
  --success: var(--green);
  --warning: var(--accent);
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 16px;
  --max: 1080px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  color: var(--ink);
  font-family: 'Sora', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Ambient glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 900px 500px at 25% 10%, oklch(50% 0.196 265 / .10), transparent),
    radial-gradient(ellipse 700px 400px at 75% 30%, oklch(50% 0.196 265 / .05), transparent),
    radial-gradient(ellipse 600px 600px at 50% 85%, rgba(0,210,122,.05), transparent);
  pointer-events: none;
}

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

a { color: inherit; text-decoration: none; transition: opacity .2s; }
a:hover { opacity: 0.85; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

.wrap-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* ── Navigation ── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: oklch(99.4% 0.002 265 / .88);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line);
  transition: all .3s;
}

header.scrolled {
  background: oklch(99.4% 0.002 265 / .96);
  box-shadow: 0 4px 20px oklch(21% 0.017 265 / .08);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -.01em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-link img {
  width: 40px; height: 40px;
  border-radius: 10px;
  box-shadow: 0 4px 12px oklch(50% 0.196 265 / .2);
}

.nav-links {
  display: flex;
  gap: 12px;
  align-items: center;
}

.nav-btn {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  transition: all .2s;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
}

.nav-btn:hover {
  border-color: var(--line);
  background: oklch(21% 0.017 265 / .03);
}

.nav-btn.active-page {
  color: var(--cyan);
}

.nav-btn.primary {
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: var(--paper);
  border: none;
  box-shadow: 0 4px 16px oklch(50% 0.196 265 / .25);
}

.nav-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px oklch(50% 0.196 265 / .35);
  opacity: 1;
}

/* ── Post Page Layout ── */
main {
  padding-top: 100px;
  padding-bottom: 60px;
  min-height: 100vh;
}

/* ── Blog Hero ── */
.blog-hero {
  padding: 120px 0 48px;
  position: relative;
  overflow: hidden;
}

.blog-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .03;
  background-image:
    linear-gradient(oklch(21% 0.017 265 / .10) 1px, transparent 1px),
    linear-gradient(90deg, oklch(21% 0.017 265 / .10) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 40%, black, transparent);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 40%, black, transparent);
}

.blog-hero::after {
  content: ""; position: absolute; bottom: -1px; left: 0; right: 0; height: 120px;
  background: linear-gradient(180deg, transparent, var(--bg));
  pointer-events: none;
}

.blog-hero-inner {
  text-align: center;
  position: relative;
  z-index: 1;
}

.blog-hero h1 {
  font-family: var(--mono);
  font-size: clamp(1.9rem, 4.8vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 12px;
  color: var(--ink);
}

.blog-hero h1 span {
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.blog-hero p {
  font-size: 16px;
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto 28px;
}

/* Search */
.search-wrap {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

.search-wrap input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  background: oklch(21% 0.017 265 / .04);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  transition: all .2s;
}

.search-wrap input::placeholder { color: var(--muted); opacity: .7; }
.search-wrap input:focus { outline: none; border-color: var(--cyan); background: oklch(21% 0.017 265 / .07); }

.search-wrap .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 16px;
  pointer-events: none;
}

/* ── Sticky Filters ── */
.filters-bar {
  position: sticky;
  top: 65px;
  z-index: 50;
  background: oklch(99.4% 0.002 265 / .88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.filters-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.filters-inner::-webkit-scrollbar { display: none; }

.filter-btn {
  padding: 7px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: oklch(21% 0.017 265 / .04);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-btn:hover {
  border-color: oklch(50% 0.196 265 / .3);
  color: var(--ink);
  background: oklch(21% 0.017 265 / .06);
}

.filter-btn.active {
  background: var(--cyan);
  color: var(--bg);
  border-color: var(--cyan);
}

/* ── Featured Post ── */
.featured-post {
  margin-bottom: 40px;
}

.featured-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .3s;
}

.featured-card:hover {
  border-color: oklch(50% 0.196 265 / .3);
  box-shadow: 0 16px 48px oklch(21% 0.017 265 / .10);
  transform: translateY(-2px);
}

.featured-img {
  position: relative;
  min-height: 280px;
  background: linear-gradient(135deg, oklch(50% 0.196 265 / .08), oklch(43% 0.19 265 / .08));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.featured-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s;
}

.featured-card:hover .featured-img img {
  transform: scale(1.03);
}

.featured-img .featured-badge {
  position: absolute;
  top: 16px; left: 16px;
  padding: 5px 14px;
  background: var(--cyan);
  color: var(--bg);
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.featured-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-body .post-category-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 12px;
}

.featured-body h2 {
  font-family: var(--mono);
  font-size: clamp(19px, 2.4vw, 25px);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -.01em;
  margin-bottom: 12px;
  color: var(--ink);
}

.featured-body .excerpt {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.featured-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(50% 0.196 265 / .2), oklch(43% 0.19 265 / .2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--cyan);
  flex-shrink: 0;
}

.author-details .author-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.author-details .read-time {
  font-size: 12px;
  color: var(--muted);
}

.read-btn {
  padding: 9px 22px;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: var(--bg);
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}

.read-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px oklch(50% 0.196 265 / .3);
  opacity: 1;
}

/* ── Post Grid ── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.post-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .3s;
  cursor: pointer;
  position: relative;
}

.post-card:hover {
  border-color: oklch(50% 0.196 265 / .3);
  transform: translateY(-3px);
  box-shadow: 0 12px 36px oklch(21% 0.017 265 / .08);
}

.post-card-img {
  position: relative;
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, oklch(50% 0.196 265 / .06), oklch(43% 0.19 265 / .06));
  overflow: hidden;
}

.post-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s;
}

.post-card:hover .post-card-img img {
  transform: scale(1.05);
}

.post-card-img .category-badge {
  position: absolute;
  top: 12px; left: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.category-badge.updates { background: oklch(50% 0.196 265 / .9); color: var(--bg-deep); }
.category-badge.blog { background: rgba(255,122,0,.9); color: var(--bg-deep); }
.category-badge.study { background: rgba(0,210,122,.9); color: var(--bg-deep); }
.category-badge.advocacy { background: #c8102e; color: #fff; }
.category-badge.stories { background: oklch(50% 0.196 265 / .18); color: var(--amber); border: 1px solid oklch(50% 0.196 265 / .4); }

.post-card-body {
  padding: 18px;
}

.post-card-body h3 {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -.01em;
  margin-bottom: 8px;
  color: var(--ink);
  transition: color .2s;
}

.post-card:hover .post-card-body h3 {
  color: var(--cyan);
}

.post-card-body .excerpt {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.post-card-footer .author-sm {
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-card-footer .author-sm .avatar-sm {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(50% 0.196 265 / .2), oklch(43% 0.19 265 / .2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
}

.post-card-footer .author-sm span {
  font-size: 12px;
  color: var(--muted);
}

.post-card-footer .meta-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.post-card-footer .meta-right .dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--muted);
  opacity: .5;
}

/* ── App Promo Section ── */
.app-promo {
  padding: 64px 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.app-promo::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 400px 250px at 30% 50%, oklch(50% 0.196 265 / .06), transparent),
    radial-gradient(ellipse 300px 200px at 70% 50%, oklch(43% 0.19 265 / .05), transparent);
  pointer-events: none;
}

.promo-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.promo-content .promo-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: oklch(50% 0.196 265 / .1);
  border: 1px solid oklch(50% 0.196 265 / .2);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 16px;
}

.promo-content h2 {
  font-family: var(--mono);
  font-size: clamp(21px, 2.8vw, 27px);
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
  margin-bottom: 10px;
}

.promo-content p {
  font-size: 14px;
  color: var(--muted);
  max-width: 480px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.promo-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.promo-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  list-style: none;
}

.promo-features .check {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: oklch(50% 0.196 265 / .15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  color: var(--cyan);
}

/* ── Newsletter ── */
.newsletter {
  padding: 56px 0;
  text-align: center;
}

.newsletter h2 {
  font-family: var(--mono);
  font-size: clamp(19px, 2.8vw, 23px);
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
  margin-bottom: 10px;
}

.newsletter p {
  color: var(--muted);
  margin-bottom: 24px;
  font-size: 14px;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-state h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--ink);
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--line);
  padding: 36px 0;
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.footer-links a:hover { color: var(--cyan); opacity: 1; }

.footer-copy {
  color: var(--muted);
  font-size: 12px;
}

/* ── Animations ── */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: all .5s ease-out;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger > *:nth-child(1) { transition-delay: 0ms; }
.stagger > *:nth-child(2) { transition-delay: 80ms; }
.stagger > *:nth-child(3) { transition-delay: 160ms; }
.stagger > *:nth-child(4) { transition-delay: 240ms; }
.stagger > *:nth-child(5) { transition-delay: 320ms; }
.stagger > *:nth-child(6) { transition-delay: 400ms; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .featured-card { grid-template-columns: 1fr; }
  .featured-img { min-height: 200px; }
  .featured-body { padding: 20px; }
  .posts-grid { grid-template-columns: 1fr; }
  .promo-grid { grid-template-columns: 1fr; }
  .brand-link img { width: 32px; height: 32px; }
  .brand-link { font-size: 15px; gap: 8px; }
  .nav-btn { font-size: 12px; padding: 6px 12px; }
  .blog-hero { padding: 110px 0 36px; }
}

@media (max-width: 560px) {
  .brand-link span { display: none; }
  .nav-links { gap: 6px; }
  .nav-btn { padding: 6px 10px; }
}
