/* Blog styles — shared by /blog/ and /blog/article/.
 *
 * THE ONE STYLESHEET ON THIS SITE, and it is a deliberate exception. Every other page
 * carries its own <style> inside <helmet>, and infra/stamp.py keeps the shared parts of
 * those blocks identical across 21 files. That works because those blocks ARE shared by
 * every page: a new stamped region has to exist on all of them or --check reports it
 * missing. These rules belong to exactly two pages, and the card styles are used by both,
 * so the choice was a stamped region skipped on nineteen pages, the same 200 lines pasted
 * twice, or one file. One file — and only the two pages that need it pay the request.
 *
 * Everything here is written against the same tokens the inline blocks use:
 * var(--accent,#62A8FF) with the literal fallback (site-motion.js writes --accent at
 * mount, so a bare var() renders unstyled before JS boots), #9a9aa2 body text, #6a6a72
 * mono labels, rgba(255,255,255,.1) hairlines, and calc(<px> * var(--s)) on anything with
 * a px cap so the ≥1600px scale gate reaches it.
 */

/* ── shared: heading block, status line, chips ─────────────────────────────────── */

/* blog.js hides and shows the filter row, the load-more button, the status line and the
 * related-posts rail by toggling the `hidden` property. The UA stylesheet backs that with
 * `[hidden] { display: none }` at specificity 0,1,0 — which any class rule below that sets
 * a display beats, so `.bp-filters` and `.bp-more` rendered even while hidden (an empty
 * chip row, and a "Load more posts" button on a single-page listing). Restoring the
 * attribute's authority here is the fix that keeps the display values where they belong. */
[hidden] { display: none !important }


.bp-label {
  display: flex; align-items: center; gap: 14px;
  font-family: 'IBM Plex Mono', monospace; font-size: calc(12px * var(--s));
  letter-spacing: .26em; text-transform: uppercase; color: #9a9aa2; margin-bottom: 22px;
}
.bp-label span.r { width: 34px; height: 1px; background: var(--accent, #62A8FF); flex: none }

.bp-intro {
  color: #9a9aa2; font-weight: 300; line-height: 1.8;
  max-width: calc(760px * var(--s)); font-size: calc(17px * var(--s));
}

/* Status carries every non-happy path: loading, empty, offline, unknown slug. It is the
 * only thing on screen when it speaks, so it is centred and given real air rather than
 * being a caption under an empty grid. */
.bp-status {
  padding: clamp(40px, 8vh, calc(90px * var(--s))) 0; text-align: center;
  color: #9a9aa2; font-weight: 300; font-size: calc(16px * var(--s)); line-height: 1.7;
}
.bp-status a { color: var(--accent, #62A8FF) }
.bp-linkbtn {
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit;
  color: var(--accent, #62A8FF); text-decoration: underline;
}
.bp-spin {
  display: inline-block; width: 13px; height: 13px; margin-right: 8px; vertical-align: -1px;
  border: 1.5px solid rgba(255, 255, 255, .25); border-top-color: var(--accent, #62A8FF);
  border-radius: 50%; animation: bp-spin .7s linear infinite;
}
@keyframes bp-spin { to { transform: rotate(360deg) } }

.bp-filters { display: flex; flex-wrap: wrap; gap: 9px; margin: 34px 0 0 }
.bp-chip {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: #9a9aa2; background: transparent; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; padding: 8px 16px;
  transition: color .3s ease, border-color .3s ease, background-color .3s ease;
}
.bp-chip:hover { color: #ECECEC; border-color: rgba(255, 255, 255, .3) }
.bp-chip.is-on { color: #070708; background: var(--accent, #62A8FF); border-color: transparent }

/* ── the post grid ─────────────────────────────────────────────────────────────── */

.bp-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: clamp(16px, 1.8vw, calc(26px * var(--s))); margin-top: 44px;
}
.bp-card {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 18px; background: transparent;
  transition: border-color .35s ease, background-color .35s ease, transform .35s cubic-bezier(.16, 1, .3, 1);
  /* Cards are inserted by blog.js after mount, so they are invisible to the
     IntersectionObserver site-motion.js wires at init — they fade themselves in. */
  animation: bp-in .5s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes bp-in { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }
.bp-card:hover { border-color: rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .03); transform: translateY(-3px); color: inherit }
.bp-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #0d0d12 }
.bp-cover { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.16, 1, .3, 1) }
.bp-card:hover .bp-cover { transform: scale(1.04) }
/* A post with no cover keeps the card's proportions rather than collapsing the row. */
.bp-cover-empty {
  display: block; width: 100%; height: 100%;
  background: radial-gradient(60% 90% at 50% 40%, rgba(98, 168, 255, .18), rgba(98, 168, 255, 0) 70%),
              radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1.2px) 0 0/18px 18px;
}
.bp-body { display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 24px }
.bp-meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: #6a6a72;
}
.bp-cat { color: var(--accent, #62A8FF) }
.bp-title { font-size: calc(19px * var(--s)); font-weight: 700; letter-spacing: -.01em; line-height: 1.35; color: #ECECEC }
.bp-excerpt {
  color: #9a9aa2; font-weight: 300; line-height: 1.65; font-size: calc(15px * var(--s));
  /* Three lines, so a long excerpt cannot make one card twice the height of its row. */
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.bp-read {
  margin-top: 4px; font-family: 'IBM Plex Mono', monospace; font-size: 10.5px;
  letter-spacing: .14em; text-transform: uppercase; color: #6a6a72;
}
.bp-card:hover .bp-read { color: var(--accent, #62A8FF) }

.bp-more { display: flex; justify-content: center; margin-top: 46px }
.bp-more button {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: .16em;
  text-transform: uppercase; color: #ECECEC; background: transparent; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; padding: 15px 34px;
  transition: border-color .3s ease, background-color .3s ease;
}
.bp-more button:hover { border-color: var(--accent, #62A8FF); background: rgba(98, 168, 255, .08) }

/* ── one post ──────────────────────────────────────────────────────────────────── */

.bp-article { max-width: calc(820px * var(--s)); margin: 0 auto }
.bp-crumb {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; color: #6a6a72; margin-bottom: 26px;
}
.bp-crumb a { color: #9a9aa2 }
/* Anton uppercase is the site's h1, and it is right for a page title and wrong for a
   headline that has to be read as a sentence. Same override the legal pages make. */
.bp-h1 {
  font-family: 'DM Sans', sans-serif !important; text-transform: none !important;
  font-weight: 700 !important; letter-spacing: -.02em; line-height: 1.14;
  font-size: clamp(30px, 4.2vw, calc(54px * var(--s)));
}
.bp-lede {
  margin-top: 20px; color: #c9c9cf; font-weight: 300; line-height: 1.6;
  font-size: clamp(17px, 1.5vw, calc(21px * var(--s)));
}
.bp-byline { display: flex; align-items: center; gap: 14px; margin-top: 30px }
.bp-avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255, 255, 255, .16) }
.bp-author { font-size: calc(15px * var(--s)); font-weight: 600; color: #ECECEC }
.bp-subline { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #6a6a72; margin-top: 5px }

.bp-hero { margin: 40px 0 0 }
.bp-hero img { display: block; width: 100%; height: auto; border-radius: 18px; border: 1px solid rgba(255, 255, 255, .08) }
.bp-hero figcaption { margin-top: 12px; font-size: 13px; color: #6a6a72; font-weight: 300 }

/* Prose. Written as descendants of .bp-body-copy so nothing here can reach the rest of
   the page — the content comes from the CMS and its tag list is not ours to predict. */
.bp-body-copy { margin-top: 40px; color: #c2c2ca; font-weight: 300; font-size: calc(17px * var(--s)); line-height: 1.85 }
.bp-body-copy > * + * { margin-top: 22px }
.bp-body-copy h2, .bp-body-copy h3, .bp-body-copy h4 {
  font-family: 'DM Sans', sans-serif !important; text-transform: none !important;
  font-weight: 600 !important; color: #ECECEC; letter-spacing: -.01em; line-height: 1.3;
  margin-top: 44px;
}
.bp-body-copy h2 { font-size: calc(26px * var(--s)) }
.bp-body-copy h3 { font-size: calc(21px * var(--s)) }
.bp-body-copy h4 { font-size: calc(18px * var(--s)) }
.bp-body-copy a { color: var(--accent, #62A8FF); text-decoration: underline; text-underline-offset: 3px }
.bp-body-copy strong { color: #ECECEC; font-weight: 600 }
.bp-body-copy ul, .bp-body-copy ol { padding-left: 22px }
.bp-body-copy li + li { margin-top: 8px }
.bp-body-copy blockquote {
  border-left: 2px solid var(--accent, #62A8FF); padding: 4px 0 4px 22px;
  font-family: 'Source Serif 4', serif; font-style: italic; color: #ECECEC;
  font-size: calc(20px * var(--s)); line-height: 1.55;
}
.bp-body-copy img { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .08) }
.bp-body-copy code {
  font-family: 'IBM Plex Mono', monospace; font-size: .88em; color: #ECECEC;
  background: rgba(255, 255, 255, .07); border-radius: 6px; padding: 2px 6px;
}
.bp-body-copy pre {
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 14px; padding: 20px 22px; overflow-x: auto;
}
.bp-body-copy pre code { background: none; padding: 0; font-size: 13.5px; line-height: 1.7 }
.bp-body-copy hr { border: 0; border-top: 1px solid rgba(255, 255, 255, .1); margin: 40px 0 }
.bp-body-copy table { width: 100%; border-collapse: collapse; font-size: 15px }
.bp-body-copy th, .bp-body-copy td { border: 1px solid rgba(255, 255, 255, .1); padding: 10px 14px; text-align: left }

.bp-tags { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 46px }
.bp-tags span {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: #6a6a72; border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px; padding: 5px 12px;
}
.bp-bio {
  margin-top: 46px; padding: 26px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 16px;
}
.bp-bio-h { font-size: calc(15px * var(--s)); font-weight: 600; color: #ECECEC; margin-bottom: 10px }
.bp-bio p { color: #9a9aa2; font-weight: 300; line-height: 1.7; font-size: calc(15px * var(--s)) }

@media (max-width: 700px) {
  .bp-body { padding: 18px 18px 20px }
  .bp-hero img, .bp-body-copy img { border-radius: 12px }
  .bp-body-copy { margin-top: 30px }
  .bp-body-copy h2 { margin-top: 34px }
}

@media (prefers-reduced-motion: reduce) {
  .bp-card, .bp-cover { transition: none; animation: none }
  .bp-card:hover { transform: none }
  .bp-spin { animation: none }
}
