/* The Barrier — shared blog styles (blog index + posts). */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #090909;
  --surface: #111111;
  --border: rgba(255,255,255,0.07);
  --border-bright: rgba(255,255,255,0.12);
  --red: #E8453C;
  --red-dim: rgba(232,69,60,0.12);
  --text: #F0EDE8;
  --text-body: rgba(240,237,232,0.82);
  --text-muted: rgba(240,237,232,0.5);
  --font-display: 'Syne', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --font-body: 'DM Sans', sans-serif;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  min-height: 100vh;
  padding: 0 20px 72px;
}
a { color: inherit; }

/* Top bar */
.blog-nav {
  max-width: 920px; margin: 0 auto; padding: 22px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.blog-nav .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.blog-nav .brand span { color: var(--red); }
.blog-nav .brand svg { width: 28px; height: 28px; }
.blog-nav .nav-links { display: flex; gap: 20px; font-family: var(--font-mono); font-size: 13px; }
.blog-nav .nav-links a { text-decoration: none; color: var(--text-muted); transition: color 0.2s ease; }
.blog-nav .nav-links a:hover { color: var(--text); }

/* Post header: title block + the mascot at work (hero) */
.post-header {
  max-width: 920px; margin: 32px auto 48px;
  display: grid; grid-template-columns: 1fr minmax(240px, 320px);
  align-items: center; gap: 44px;
}
.post-header .kicker { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); margin-bottom: 16px; }
.post-header h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(32px, 5vw, 48px); line-height: 1.08; letter-spacing: -0.03em; margin-bottom: 16px; }
.post-header .dek { color: var(--text-muted); font-size: 18px; line-height: 1.55; max-width: 520px; }
.post-header barrier-mascot { width: 100%; --barrier-mascot-font: var(--font-body); }
.post-header barrier-mascot > img { display: block; width: 100%; height: auto; border-radius: 14px; }

/* Article body */
.post-body { max-width: 680px; margin: 0 auto; font-size: 18px; line-height: 1.75; color: var(--text-body); }
.post-body > * + * { margin-top: 1.1em; }
.post-body h2 { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1.25; letter-spacing: -0.02em; color: var(--text); margin-top: 2.2em; }
.post-body h3 { font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--text); margin-top: 1.6em; }
.post-body strong { color: var(--text); font-weight: 500; }
.post-body a { color: var(--red); text-underline-offset: 3px; }
.post-body ul, .post-body ol { padding-left: 1.3em; }
.post-body li + li { margin-top: 0.55em; }
.post-body li::marker { color: var(--red); }
.post-body .stat {
  border-left: 3px solid var(--red); background: var(--red-dim);
  padding: 18px 22px; border-radius: 0 10px 10px 0; color: var(--text);
}
.post-body .stat strong { font-family: var(--font-display); font-weight: 700; }
.post-body .callout {
  border: 1px solid var(--border-bright); border-radius: 12px; padding: 22px 24px; background: var(--surface);
}
.post-body .callout p + p { margin-top: 0.6em; }
.post-body .cta {
  display: inline-block; margin-top: 14px; padding: 12px 22px; border-radius: 8px;
  background: var(--red); color: #fff; text-decoration: none; font-family: var(--font-mono); font-size: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.post-body .cta:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(232,69,60,0.35); }
.post-body details { border-top: 1px solid var(--border); padding: 14px 0; }
.post-body details:last-of-type { border-bottom: 1px solid var(--border); }
.post-body summary { cursor: pointer; color: var(--text); font-weight: 500; list-style: none; position: relative; padding-left: 26px; }
.post-body summary::-webkit-details-marker { display: none; }
.post-body summary::before { content: '+'; position: absolute; left: 0; top: -1px; width: 18px; text-align: center; color: var(--red); font-family: var(--font-mono); font-size: 20px; line-height: 1.4; }
.post-body details[open] summary::before { content: '−'; }
.post-body summary:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; border-radius: 4px; }
.post-body details p { padding-left: 26px; }
.post-body details p { margin-top: 0.7em; }
.post-footer { max-width: 680px; margin: 56px auto 0; padding-top: 24px; border-top: 1px solid var(--border); font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.post-footer a { color: var(--text-muted); }
.post-footer a:hover { color: var(--text); }

/* Blog index: post list */
.post-list { max-width: 920px; margin: 0 auto; display: grid; gap: 16px; }
.post-card { display: block; text-decoration: none; border: 1px solid var(--border-bright); border-radius: 14px; padding: 24px 26px; background: var(--surface); transition: border-color 0.2s ease, transform 0.2s ease; }
.post-card:hover { border-color: var(--red); transform: translateY(-2px); }
.post-card .meta { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; color: var(--red); text-transform: uppercase; }
.post-card h2 { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; margin: 10px 0 8px; color: var(--text); }
.post-card p { color: var(--text-muted); line-height: 1.6; }

@media (max-width: 720px) {
  .post-header { grid-template-columns: 1fr; gap: 24px; text-align: center; margin-top: 12px; }
  .post-header barrier-mascot { order: -1; width: min(260px, 72vw); justify-self: center; }
  .post-header .dek { margin: 0 auto; font-size: 17px; }
  .post-body { font-size: 17px; }
  .post-body h2 { font-size: 23px; }
  .blog-nav .nav-links { gap: 14px; }
}

/* Series / category label (kicker on posts, chips on the index). A post's
   category is its kicker link to /blog?category=<slug>; the index builds its
   filter chips from the data-category on each card. */
.post-header .kicker a.series { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(232,69,60,0.4); }
.post-header .kicker a.series:hover { border-bottom-color: var(--red); }
.post-body .related { font-size: 16px; color: var(--text-muted); border-top: 1px dashed var(--border-bright); padding-top: 14px; }
.post-body .related a { color: var(--text); }
.category-chips { max-width: 920px; margin: -16px auto 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.category-chips button { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); background: transparent; border: 1px solid var(--border-bright); border-radius: 999px; padding: 7px 14px; cursor: pointer; transition: color .2s, border-color .2s; }
.category-chips button:hover { color: var(--text); border-color: rgba(255,255,255,0.3); }
.category-chips button[aria-pressed="true"] { color: #fff; border-color: var(--red); background: var(--red-dim); }
.category-chips button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.post-card[hidden] { display: none; }
.post-body .sources { font-size: 16px; }

/* Scene hero: the mascot chasing a ghost that holds a "ghost job" page.
   Two layers built by tools/mascot/build.cjs chase: the scene with the ghost
   filled in (plate) and the ghost on its own, placed by the manifest's box
   (x 524, y 121, w 476 of 1000×702). Only the ghost moves: a constant gentle
   float. With reduced motion it stays put, which is the original image. */
.post-header.has-scene { grid-template-columns: 1fr minmax(280px, 400px); }
.post-header.long-title h1 { font-size: clamp(27px, 3.6vw, 36px); line-height: 1.14; letter-spacing: -0.025em; }
.chase-hero { position: relative; width: 100%; aspect-ratio: 1000 / 702; background: #000; border-radius: 14px; overflow: hidden; }
.chase-hero img { position: absolute; display: block; height: auto; }
.chase-hero .chase-base { left: 0; top: 0; width: 100%; }
.chase-hero .chase-ghost { left: 52.4%; top: 17.236%; width: 47.6%; animation: ghost-flee 3.6s ease-in-out infinite; will-change: transform; }
@keyframes ghost-flee {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(1.3%, -3.2%) rotate(1deg); }
  50% { transform: translate(2.1%, -0.5%) rotate(0.3deg); }
  75% { transform: translate(0.7%, 2.3%) rotate(-0.8deg); }
}
@media (prefers-reduced-motion: reduce) { .chase-hero .chase-ghost { animation: none; } }
@media (max-width: 720px) {
  .post-header.has-scene { grid-template-columns: 1fr; }
  .post-header .chase-hero { order: -1; width: min(360px, 90vw); justify-self: center; }
}
