/* =========================================================
   Wisemelon — blog (the listing and every post)
   Loaded after /index.css, which supplies the tokens and the
   --u design-pixel unit every desktop size below is written in.
   The pages are generated by tools/build-blog.py — edit this
   file and the script, never the generated page.html files.
   Shared by every blog page, like legal.css for the legal pages.
   Every class is prefixed bl-.

   Reading floors: the site scales everything with --u, which is
   0.74px at a 1280 laptop. Text people read for minutes (prose,
   lede, byline, contents, card copy) gets a px floor with max()
   so it never shrinks below a comfortable size. The article body
   itself is sized by --read and spaced in em, so its rhythm
   follows its own font size at every width.
   ========================================================= */

.bl {
  --pad: calc(67 * var(--u));
  --lime-tint: #effcb5;
  --lime-ink:  #3f5a00;
  --faint:     #9a9a9a;
  --soft:      #fafaf8;          /* B6 off-white: placeholders, table heads */
  --ease: cubic-bezier(.2, .8, .2, 1);
  display: block;
}
.bl:focus { outline: none; }     /* main takes focus from the skip link */
.bl [hidden] { display: none !important; }
.bl figure { margin: 0; }
.bl .i {
  flex: none;
  width: calc(16 * var(--u)); height: calc(16 * var(--u));
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform .2s var(--ease);
}
.bl .btn .i { width: calc(22 * var(--u)); height: calc(22 * var(--u)); }
.bl .btn:focus-visible { outline: 2px solid var(--lime-ico); outline-offset: 2px; }
.bl .dim { color: #8c8c8c; }

/* skip link — off-screen until focused, then an ink pill top-left */
.bl-skip {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--lime);
  font-size: 16px;
  font-weight: 500;
  transform: translateY(calc(-100% - 24px));
}
.bl-skip:focus { transform: none; outline: 2px solid var(--lime-ico); outline-offset: 2px; }

/* =========================================================
   TYPE
   ========================================================= */
.bl-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: calc(10 * var(--u));
  margin: 0 0 calc(24 * var(--u));
  font-size: calc(15 * var(--u));
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--lime-ink);
}
.bl-eyebrow::before {
  content: "";
  width: calc(9 * var(--u)); height: calc(9 * var(--u));
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 calc(3 * var(--u)) var(--lime-tint);
}
.bl-h1, .bl-h2 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 500;
  color: var(--ink);
  text-wrap: balance;
}
.bl-h1 { font-size: calc(64 * var(--u)); line-height: calc(77 * var(--u)); letter-spacing: -0.03em; }
.bl-h2 { font-size: calc(48 * var(--u)); line-height: calc(57 * var(--u)); letter-spacing: -0.03em; }
.bl-lede {
  max-width: calc(760 * var(--u));
  margin: calc(28 * var(--u)) 0 0;
  font-size: calc(22 * var(--u));
  line-height: calc(32 * var(--u));
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: pretty;
}

/* meta line: topic · author · date · read time */
.bl-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(6 * var(--u)) calc(12 * var(--u));
  margin: 0;
  font-size: max(13px, calc(15 * var(--u)));
  line-height: 1.4;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* topic label — a small eyebrow: lime dot, uppercase lime-ink */
.bl-tag {
  display: inline-flex;
  align-items: center;
  gap: calc(8 * var(--u));
  font-size: max(11.5px, calc(13 * var(--u)));
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--lime-ink);
}
.bl-tag::before {
  content: "";
  flex: none;
  width: calc(7 * var(--u)); height: calc(7 * var(--u));
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 calc(2 * var(--u)) var(--lime-tint);
}
/* "Latest" — ink pill with lime text, like .btn--dark */
.bl-badge {
  display: inline-flex;
  align-items: center;
  height: calc(26 * var(--u));
  padding: 0 calc(11 * var(--u));
  border-radius: 999px;
  background: var(--ink);
  color: var(--lime);
  font-size: max(11px, calc(12.5 * var(--u)));
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* author avatar — a hairline circle (radius-round); the team fallback crops
   logo.png to its mark; no photo shows initials on the off-white ground */
.bl-av {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: max(36px, calc(44 * var(--u))); height: max(36px, calc(44 * var(--u)));
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--soft);
  object-fit: cover;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: max(13px, calc(16 * var(--u)));
  letter-spacing: -0.02em;
  color: var(--ink);
}
.bl-av--sm { width: max(20px, calc(22 * var(--u))); height: max(20px, calc(22 * var(--u))); font-size: max(8px, calc(9 * var(--u))); }
.bl-av--lg { width: max(64px, calc(88 * var(--u))); height: max(64px, calc(88 * var(--u))); font-size: max(22px, calc(30 * var(--u))); }
.bl-av--logo { background: var(--paper); object-position: 4.6% 50%; }
.bl-by {
  display: inline-flex;
  align-items: center;
  gap: calc(8 * var(--u));
  font-weight: 500;
  color: var(--ink);
}

.bl-more {
  display: inline-flex;
  align-items: center;
  gap: calc(8 * var(--u));
  padding-bottom: calc(3 * var(--u));
  border-bottom: 1px solid currentColor;
  font-size: max(15px, calc(17 * var(--u)));
  font-weight: 500;
  color: var(--ink);
}

/* =========================================================
   CARDS — flat: hairline + 12u radius, no shadow, no lift.
   Hover darkens the border and nudges the arrow only.
   ========================================================= */
.bl-card__link,
.bl-featured__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: calc(12 * var(--u));
  background: var(--paper);
  transition: border-color .18s ease;
}
.bl-card__link:hover, .bl-featured__link:hover { border-color: var(--divider); }
.bl-card__link:hover .bl-card__go,
.bl-featured__link:hover .bl-more .i { transform: translateX(calc(3 * var(--u))); }
.bl-card__link:focus-visible, .bl-featured__link:focus-visible,
.bl-chip:focus-visible, .bl-pages button:focus-visible {
  outline: 2px solid var(--lime-ico);
  outline-offset: 2px;
}

.bl-card__img, .bl-featured__img {
  position: relative;
  display: block;
  flex: none;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-bottom: 1px solid var(--rule);
  background: var(--soft);
}
.bl-card__img img, .bl-featured__img img { width: 100%; height: 100%; object-fit: cover; }

/* no hero image: the off-white panel with the hairline grid and the topic */
.bl-noimg {
  display: grid;
  place-items: center;
  height: 100%;
  padding: calc(24 * var(--u));
  background-color: var(--soft);
  background-image:
    linear-gradient(to right,  #efefec 1px, transparent 1px),
    linear-gradient(to bottom, #efefec 1px, transparent 1px);
  background-size: calc(100% / 6) calc(100% / 4);
  background-position: -1px -1px;
  text-align: center;
}
.bl-noimg span {
  display: inline-flex;
  align-items: center;
  gap: calc(12 * var(--u));
  padding: calc(10 * var(--u)) calc(18 * var(--u));
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  font-family: var(--font-head);
  font-size: max(16px, calc(20 * var(--u)));
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.bl-noimg span::before {
  content: "";
  flex: none;
  width: calc(9 * var(--u)); height: calc(9 * var(--u));
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 calc(3 * var(--u)) var(--lime-tint);
}

/* card body: topic → title → excerpt, then the meta row pinned to the bottom
   so every card in a row lines up whatever the title length */
.bl-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: calc(12 * var(--u));
  padding: calc(24 * var(--u)) calc(26 * var(--u)) calc(24 * var(--u));
}
.bl-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  font-family: var(--font-head);
  font-size: max(19px, calc(24 * var(--u)));
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-wrap: balance;
  overflow-wrap: break-word;
}
.bl-card__excerpt {
  display: -webkit-box;
  margin: 0;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: max(15px, calc(16 * var(--u)));
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}
.bl-card__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: calc(12 * var(--u));
  margin-top: auto;
  padding-top: calc(18 * var(--u));
  border-top: 1px solid var(--rule);
}
.bl-card__foot .bl-meta { min-width: 0; }
.bl-card__go { display: inline-flex; flex: none; color: var(--ink); margin-bottom: calc(2 * var(--u)); transition: transform .2s var(--ease); }
.bl-card__body > .bl-card__excerpt { margin-bottom: calc(6 * var(--u)); }

.bl-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(30 * var(--u));
  margin-top: calc(48 * var(--u));
}

/* =========================================================
   LISTING
   ========================================================= */
.bl-hero {
  position: relative;
  isolation: isolate;
  padding: calc(104 * var(--u)) var(--pad) calc(72 * var(--u));
}
.bl-hero__grid {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: calc(560 * var(--u));
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right,  var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: calc(100% / 11) calc(560 * var(--u) / 5);
  background-position: -1px -1px;
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
  mask-image: linear-gradient(#000 55%, transparent);
}
.bl-hero .bl-h1 { max-width: calc(980 * var(--u)); }

/* featured: image | body. The image fills the row height (absolute img),
   with a minimum so a short excerpt still gives a generous picture */
.bl-featured { padding: 0 var(--pad) calc(136 * var(--u)); }
.bl-featured__link { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.bl-featured__img {
  aspect-ratio: auto;
  min-height: calc(420 * var(--u));
  border-bottom: 0;
  border-right: 1px solid var(--rule);
}
.bl-featured__img img { position: absolute; inset: 0; }
.bl-featured__img .bl-noimg { position: absolute; inset: 0; }
.bl-featured__img .bl-noimg span { font-size: max(18px, calc(24 * var(--u))); }
.bl-featured__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: calc(20 * var(--u));
  min-width: 0;
  padding: calc(48 * var(--u)) calc(56 * var(--u));
}
.bl-featured__title {
  margin: 0;
  font-family: var(--font-head);
  font-size: max(26px, calc(40 * var(--u)));
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-wrap: balance;
  overflow-wrap: break-word;
}
.bl-featured__excerpt {
  display: -webkit-box;
  margin: 0;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: max(16px, calc(18 * var(--u)));
  line-height: 1.6;
  color: var(--muted);
  text-wrap: pretty;
}
.bl-featured__body .bl-more { margin-top: calc(8 * var(--u)); }

.bl-list {
  padding: calc(136 * var(--u)) var(--pad);
  border-top: 1px solid var(--rule);
}
.bl-list__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: calc(24 * var(--u)) calc(40 * var(--u));
}
.bl-chips { display: flex; flex-wrap: wrap; gap: calc(10 * var(--u)); }
.bl-chip {
  display: inline-flex;
  align-items: center;
  gap: calc(8 * var(--u));
  min-height: max(40px, calc(44 * var(--u)));
  padding: 0 calc(18 * var(--u));
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  font-size: max(14px, calc(16 * var(--u)));
  font-weight: 500;
  white-space: nowrap;
  color: var(--nav-link);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}
.bl-chip span { font-size: max(12px, calc(13 * var(--u))); color: var(--faint); font-variant-numeric: tabular-nums; }
.bl-chip:hover { border-color: var(--divider); color: var(--ink); }
.bl-chip[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: var(--lime); }
.bl-chip[aria-current="page"] span { color: #b8c0a4; }
.bl-count { margin: calc(28 * var(--u)) 0 0; font-size: max(14px, calc(15 * var(--u))); color: var(--muted); font-variant-numeric: tabular-nums; }
.bl-count:empty { display: none; }
.bl-count + .bl-grid { margin-top: calc(24 * var(--u)); }

/* pagination — built from the .vbtn icon-button chrome */
.bl-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: calc(8 * var(--u));
  margin-top: calc(72 * var(--u));
  padding-top: calc(40 * var(--u));
  border-top: 1px solid var(--rule);
}
.bl-pages button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(8 * var(--u));
  min-width: max(44px, calc(48 * var(--u)));
  height: max(44px, calc(48 * var(--u)));
  padding: 0 calc(14 * var(--u));
  border: 1px solid var(--rule);
  border-radius: calc(12 * var(--u));
  background: var(--paper);
  font-size: max(15px, calc(16 * var(--u)));
  font-weight: 500;
  color: var(--nav-link);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}
.bl-pages button:hover:not(:disabled) { border-color: var(--lime-ico); background: #f8fdeb; color: var(--ink); }
.bl-pages button[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: var(--lime); }
.bl-pages button:disabled { opacity: .45; cursor: default; }
.bl-pages .edge { padding: 0 calc(18 * var(--u)); }
.bl-pages .gap { padding: 0 calc(4 * var(--u)); color: var(--faint); }

/* =========================================================
   A POST — header like the legal pages, then side | document.
   --read   body size of the article
   --measure the text column (36em ≈ 66–72 characters of Manrope)
   --wide   figures and tables, 8em wider than the text
   ========================================================= */
.bl-post {
  --read: clamp(19px, calc(20 * var(--u)), 21px);
  --measure: calc(36 * var(--read));
  --wide: calc(44 * var(--read));
  --nav-clear: calc(150 * var(--u));      /* = the html scroll-padding under the floating nav */
}

/* reading progress — a 3px lime-ico line on the top edge, above the floating
   nav card (which sits 16u lower). blog.js scales it; without JS it stays at 0 */
.bl-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 31;
  height: 3px;
  pointer-events: none;
}
.bl-progress__bar {
  display: block;
  height: 100%;
  background: var(--lime-ico);
  transform: scaleX(0);
  transform-origin: 0 50%;
}
body:has(.navshell.is-nav-open) .bl-progress { display: none; }

.bl-post__head {
  padding: calc(88 * var(--u)) var(--pad) calc(52 * var(--u));
  border-bottom: 1px solid var(--rule);
}
.bl-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(10 * var(--u));
  margin: 0 0 calc(28 * var(--u));
  font-size: max(13px, calc(15 * var(--u)));
  font-weight: 500;
  color: var(--faint);
}
.bl-crumbs a { color: var(--nav-link); transition: color .14s ease; }
.bl-crumbs a:hover { color: var(--ink); }
.bl-crumbs a:focus-visible { outline: 2px solid var(--lime-ico); outline-offset: 2px; border-radius: 4px; }
.bl-post__title {
  max-width: calc(1080 * var(--u));
  margin: 0;
  font-family: var(--font-head);
  font-size: calc(56 * var(--u));
  line-height: calc(64 * var(--u));
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-wrap: balance;
  overflow-wrap: break-word;
}
.bl-post__lede {
  max-width: calc(860 * var(--u));
  margin: calc(22 * var(--u)) 0 0;
  font-size: max(17px, calc(22 * var(--u)));
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--muted);
  text-wrap: pretty;
}

/* byline: avatar | name · role over topic · date · read time */
.bl-byline {
  display: flex;
  align-items: center;
  gap: calc(14 * var(--u));
  margin-top: calc(30 * var(--u));
}
.bl-byline__txt { display: grid; gap: calc(4 * var(--u)); min-width: 0; }
.bl-byline__who {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 calc(10 * var(--u));
  margin: 0;
  font-size: max(14px, calc(16 * var(--u)));
  line-height: 1.4;
}
.bl-byline__name { font-weight: 600; color: var(--ink); }
.bl-byline__role { color: var(--muted); }
.bl-byline__role::before { content: "\00b7"; margin-right: calc(10 * var(--u)); color: var(--faint); }

.bl-post__body { display: grid; grid-template-columns: calc(340 * var(--u)) minmax(0, 1fr); }
/* the side rail scrolls on its own if a long contents list is taller than the screen */
.bl-post__side {
  align-self: start;
  position: sticky;
  top: var(--nav-clear);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-height: calc(100vh - var(--nav-clear));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: calc(48 * var(--u)) calc(40 * var(--u)) calc(48 * var(--u)) var(--pad);
}
.bl-side__title {
  margin: 0 0 calc(14 * var(--u));
  font-size: max(12px, calc(14 * var(--u)));
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.bl-toc + .bl-side__title {
  align-self: stretch;
  margin-top: calc(30 * var(--u));
  padding-top: calc(24 * var(--u));
  border-top: 1px solid var(--rule);
}
.bl-toc {
  display: grid;
  gap: calc(2 * var(--u));
  align-self: stretch;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: max(14px, calc(16 * var(--u)));
  line-height: 1.4;
  font-weight: 500;
}
.bl-toc a {
  display: block;
  padding: calc(8 * var(--u)) calc(14 * var(--u));
  margin-left: calc(-14 * var(--u));
  border-radius: calc(8 * var(--u));
  color: var(--nav-link);
  text-wrap: pretty;
  transition: background-color .14s ease, color .14s ease;
}
.bl-toc a:hover { background: var(--lime-soft); color: var(--ink); }
.bl-toc a:focus-visible { outline: 2px solid var(--lime-ico); outline-offset: 0; }
.bl-toc .is-current { background: var(--lime-soft); color: var(--ink); font-weight: 600; }
.bl-side__topic {
  display: inline-flex;
  align-items: center;
  gap: calc(8 * var(--u));
  font-size: max(14px, calc(17 * var(--u)));
  font-weight: 500;
  color: var(--ink);
}
.bl-side__topic:hover .i { transform: translateX(calc(3 * var(--u))); }
.bl-post__side .bl-back { margin-top: calc(30 * var(--u)); }
.bl-post__side .bl-back + .bl-back { margin-top: calc(14 * var(--u)); }

.bl-back {
  display: inline-flex;
  align-items: center;
  gap: calc(10 * var(--u));
  font-size: max(14px, calc(17 * var(--u)));
  font-weight: 500;
  color: var(--nav-link);
  transition: color .14s ease;
}
.bl-back:hover { color: var(--ink); }
.bl-back:hover .i { transform: translateX(calc(-3 * var(--u))); }
.bl-back--top:hover .i { transform: translateY(calc(-3 * var(--u))); }
.bl-side__topic:focus-visible, .bl-back:focus-visible { outline: 2px solid var(--lime-ico); outline-offset: 3px; border-radius: 4px; }

/* the document column: its content box is --wide (or the space there is);
   text, the author card and the foot sit centred in it at --measure */
.bl-post__doc {
  min-width: 0;
  border-left: 1px solid var(--rule);
  padding: calc(48 * var(--u)) max(var(--pad), calc(100% - var(--wide) - 58 * var(--u))) calc(120 * var(--u)) calc(58 * var(--u));
}
.bl-post__hero { margin: 0 0 calc(56 * var(--u)); }
.bl-post__hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(56vh, calc(560 * var(--u)));
  object-fit: cover;
  border: 1px solid var(--rule);
  border-radius: calc(12 * var(--u));
  background: var(--soft);
}
.bl-toc-m, .bl-author, .bl-post__foot { max-width: var(--measure); margin-inline: auto; }

/* "In this article" on phones and tablets — a collapsible block above the
   article, drawn like the .os-qa rows (hairline box, plus → × icon) */
.bl-toc-m {
  display: none;
  margin-bottom: 32px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--paper);
}
.bl-toc-m summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 6px 12px 6px 16px;
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}
.bl-toc-m summary::-webkit-details-marker { display: none; }
.bl-toc-m summary:focus-visible { outline: 2px solid var(--lime-ico); outline-offset: 2px; border-radius: 12px; }
.bl-toc-m__n { margin-right: auto; font-weight: 500; letter-spacing: 0; text-transform: none; font-size: 14px; color: var(--muted); }
.bl-toc-m__icon {
  position: relative;
  flex: none;
  width: 32px; height: 32px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  transition: background-color .2s ease, border-color .2s ease, transform .3s var(--ease);
}
.bl-toc-m__icon::before, .bl-toc-m__icon::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 11px; height: 1.5px;
  background: var(--ink);
  transform: translate(-50%, -50%);
}
.bl-toc-m__icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.bl-toc-m[open] .bl-toc-m__icon { transform: rotate(45deg); background: var(--lime); border-color: var(--lime); }
.bl-toc-m .bl-toc { padding: 4px 8px 10px; border-top: 1px solid var(--rule); font-size: 16px; }
.bl-toc-m .bl-toc a { display: flex; align-items: center; min-height: 44px; margin-left: 0; padding: 8px 10px; border-radius: 8px; }

/* "Written by" — a flat hairline card after the article */
.bl-author {
  display: flex;
  align-items: flex-start;
  gap: calc(28 * var(--u));
  margin-top: calc(72 * var(--u));
  padding: calc(32 * var(--u));
  border: 1px solid var(--rule);
  border-radius: calc(12 * var(--u));
  background: var(--paper);
}
.bl-author__txt { min-width: 0; }
.bl-author .bl-side__title { margin-bottom: calc(8 * var(--u)); }
.bl-author__name {
  margin: 0;
  font-family: var(--font-head);
  font-size: max(20px, calc(24 * var(--u)));
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.bl-author__role { margin: calc(4 * var(--u)) 0 0; font-size: max(14px, calc(16 * var(--u))); color: var(--muted); }
.bl-author__bio {
  margin: calc(14 * var(--u)) 0 0;
  font-size: max(16px, calc(17 * var(--u)));
  line-height: 1.6;
  color: var(--prose);
  text-wrap: pretty;
}
.bl-author__links { display: flex; flex-wrap: wrap; gap: calc(8 * var(--u)); margin: calc(18 * var(--u)) 0 0; padding: 0; list-style: none; }
.bl-author__links a {
  display: grid;
  place-items: center;
  width: max(40px, calc(44 * var(--u))); height: max(40px, calc(44 * var(--u)));
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--nav-link);
  transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}
.bl-author__links a:hover { border-color: var(--lime-ico); background: #f8fdeb; color: var(--ink); }
.bl-author__links a:focus-visible { outline: 2px solid var(--lime-ico); outline-offset: 2px; }
.bl-author__links .i { width: max(18px, calc(18 * var(--u))); height: max(18px, calc(18 * var(--u))); }
.bl-author + .bl-post__foot { margin-top: calc(40 * var(--u)); }

.bl-post__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: calc(16 * var(--u)) calc(32 * var(--u));
  margin-top: calc(72 * var(--u));
  padding-top: calc(32 * var(--u));
  border-top: 1px solid var(--rule);
}

/* back to top — phones and tablets only (desktop has it in the side rail):
   a .vbtn-style square that appears once the reader is well into the post */
.bl-totop {
  display: none;
  position: fixed;
  right: 16px; bottom: 16px;
  z-index: 20;
  width: 48px; height: 48px;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .07);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s var(--ease), visibility 0s linear .2s, border-color .15s ease;
}
.bl-totop.is-shown { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.bl-totop:hover { border-color: var(--lime-ico); }
.bl-totop:focus-visible { outline: 2px solid var(--lime-ico); outline-offset: 2px; }
.bl-totop .i { width: 18px; height: 18px; }

/* ---------- the article body (whatever the editor wrote) ----------
   Sized by --read; every space inside is in em so it follows the text. */
.bl-prose {
  font-size: var(--read);
  line-height: 1.65;
  letter-spacing: -0.01em;
  color: var(--prose);
  overflow-wrap: break-word;
  hyphens: manual;
  font-variant-numeric: proportional-nums;
}
.bl-prose > * { max-width: var(--measure); margin-block: 0; margin-inline: auto; }
.bl-prose > * + * { margin-top: 1.15em; }
.bl-prose p { text-wrap: pretty; }

.bl-prose h2, .bl-prose h3, .bl-prose h4 {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--ink);
  text-wrap: balance;
  scroll-margin-top: calc(16 * var(--u));     /* on top of the html scroll-padding */
}
.bl-prose h2 { font-size: 1.6em;  line-height: 1.25; letter-spacing: -0.03em; }
.bl-prose h3 { font-size: 1.25em; line-height: 1.3;  letter-spacing: -0.02em; }
.bl-prose h4 { font-size: 1.05em; line-height: 1.4;  letter-spacing: -0.02em; }
.bl-prose > * + h2 { margin-top: 2em; }      /* em of the heading itself: ≈ 61–67px */
.bl-prose > * + h3 { margin-top: 1.75em; }   /* ≈ 42–46px */
.bl-prose > * + h4 { margin-top: 1.6em; }    /* ≈ 32–35px */
.bl-prose > h2 + * { margin-top: .8em; }
.bl-prose > h3 + *, .bl-prose > h4 + * { margin-top: .6em; }
.bl-prose :is(h2, h3, h4) strong { font-weight: inherit; }

.bl-prose strong, .bl-prose b { font-weight: 600; color: var(--ink); }
.bl-prose em, .bl-prose i:not(.i) { font-style: italic; }

/* links: ink text with a lime-ico underline that thickens to ink on hover;
   visited links keep the ink text but take a grey underline */
.bl-prose a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--lime-ico);
  text-decoration-thickness: 2px;
  text-underline-offset: .2em;
  text-decoration-skip-ink: auto;
  transition: background-color .14s ease, text-decoration-color .14s ease;
}
.bl-prose a:visited { text-decoration-color: var(--divider); }
.bl-prose a:hover { background: var(--lime-soft); text-decoration-color: var(--ink); }
.bl-prose a:focus-visible { outline: 2px solid var(--lime-ico); outline-offset: 2px; border-radius: 3px; text-decoration-color: var(--ink); }

/* lists — /index.css strips list styles globally; restore them here.
   Bullets are lime-ico dots (a ring when nested); numbers are lime-ink. */
.bl-prose ul, .bl-prose ol { padding: 0; list-style: none; }
.bl-prose li { position: relative; padding-left: 1.6em; }
.bl-prose li + li { margin-top: .5em; }
.bl-prose li > p { margin: 0; }
.bl-prose li > p + p { margin-top: .5em; }
.bl-prose li > :is(ul, ol) { margin-top: .5em; }
.bl-prose ul > li::before {
  content: "";
  position: absolute;
  left: .4em;
  top: .66em;
  width: .34em; height: .34em;
  border-radius: 50%;
  background: var(--lime-ico);
}
.bl-prose li ul > li::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--lime-ico); }
.bl-prose ol { counter-reset: bl-ol; }
.bl-prose ol > li { counter-increment: bl-ol; }
.bl-prose ol > li::before {
  content: counter(bl-ol) ".";
  position: absolute;
  left: 0;
  width: 1.2em;
  text-align: right;
  font-weight: 600;
  color: var(--lime-ink);
  font-variant-numeric: tabular-nums;
}

/* blockquote — calm: ink 500 text beside a lime rule; no quote marks, no fill */
.bl-prose blockquote {
  padding: .15em 0 .15em 1.1em;
  border-left: 3px solid var(--lime);
  font-weight: 500;
  color: var(--ink);
}
.bl-prose > * + :where(blockquote), .bl-prose > :where(blockquote) + * { margin-top: 1.6em; }
.bl-prose blockquote > * { margin: 0; }
.bl-prose blockquote > * + * { margin-top: .6em; }
.bl-prose blockquote :is(cite, footer) { display: block; font-size: .84em; font-weight: 400; font-style: normal; color: var(--muted); }

/* figures and tables break out to --wide; captions are quiet and keep to
   the text measure */
.bl-prose > :is(figure, .bl-table, img), .bl-prose > p:has(> img:only-child) { max-width: none; }
/* :where keeps these at the weight of "> * + *", so a heading's own spacing still wins */
.bl-prose > * + :where(figure, .bl-table, img, p:has(> img:only-child)),
.bl-prose > :where(figure, .bl-table, img, p:has(> img:only-child)) + * { margin-top: 2em; }
.bl-prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  border: 1px solid var(--rule);
  border-radius: max(8px, calc(12 * var(--u)));
}
.bl-prose figure img { width: 100%; max-height: 80vh; object-fit: contain; }
.bl-prose figcaption {
  max-width: var(--measure);
  margin: .75em auto 0;
  font-size: .8em;
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

.bl-prose hr { height: 1px; border: 0; background: var(--rule); }
.bl-prose > * + :where(hr), .bl-prose > :where(hr) + * { margin-top: 2.6em; }
.bl-prose code {
  padding: .1em .35em;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .86em;
  letter-spacing: 0;
  color: var(--ink);
}
.bl-prose pre {
  overflow-x: auto;
  padding: 1em 1.2em;
  border: 1px solid var(--rule);
  border-radius: max(8px, calc(12 * var(--u)));
  background: var(--soft);
  font-size: .8em;
  line-height: 1.6;
}
.bl-prose pre code { padding: 0; border: 0; background: none; font-size: inherit; }

/* tables — wrapped by the build in .bl-table, which scrolls sideways when the
   columns can't fit. Header row on the off-white ground, rules between rows,
   numeric columns (marked .bl-num by the build) right-aligned in tabular figures */
.bl-prose .bl-table {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: max(8px, calc(12 * var(--u)));
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.bl-prose .bl-table:focus-visible { outline: 2px solid var(--lime-ico); outline-offset: 2px; }
.bl-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84em;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.bl-prose th, .bl-prose td {
  min-width: 7em;
  padding: .75em 1em;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
.bl-prose :is(th, td) > p { margin: 0; }
.bl-prose th { background: var(--soft); font-weight: 600; color: var(--ink); }
.bl-prose tr:has(td) > th { background: none; }          /* row headers */
.bl-prose td:first-child { color: var(--ink); font-weight: 500; }
.bl-prose :is(th, td).bl-num { text-align: right; white-space: nowrap; }
.bl-prose tr:last-child > td, .bl-prose tr:last-child > th { border-bottom: 0; }
.bl-prose thead tr:last-child > th { border-bottom: 1px solid var(--rule); }
.bl-prose caption {
  caption-side: bottom;
  padding: .75em 1em;
  border-top: 1px solid var(--rule);
  font-size: .9em;
  text-align: left;
  color: var(--muted);
}

/* ---------- keep reading (the .os-related rhythm) ---------- */
.bl-related {
  padding: calc(104 * var(--u)) var(--pad) calc(112 * var(--u));
  border-top: 1px solid var(--rule);
}
.bl-related .bl-h2 { font-size: calc(36 * var(--u)); line-height: calc(44 * var(--u)); }
.bl-related .bl-grid { margin-top: calc(40 * var(--u)); }

/* =========================================================
   CLOSING CTA — the .cos-final pattern
   ========================================================= */
.bl-cta {
  position: relative;
  isolation: isolate;
  padding: calc(152 * var(--u)) var(--pad) calc(160 * var(--u));
  border-top: 1px solid var(--rule);
  text-align: center;
}
.bl-cta__grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right,  var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: calc(100% / 11) calc(100% / 5);
  background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(58% 70% at 50% 50%, #000, transparent);
  mask-image: radial-gradient(58% 70% at 50% 50%, #000, transparent);
}
.bl-cta .bl-h2 { max-width: calc(980 * var(--u)); margin: 0 auto; font-size: calc(68 * var(--u)); line-height: calc(74 * var(--u)); letter-spacing: -0.035em; }
.bl-cta__body {
  max-width: calc(720 * var(--u));
  margin: calc(20 * var(--u)) auto 0;
  font-size: max(16px, calc(21 * var(--u)));
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}
.bl-cta__acts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(20 * var(--u));
  margin-top: calc(44 * var(--u));
}
.bl-cta .btn:hover .i { transform: translateX(calc(3 * var(--u))); }

@media (prefers-reduced-motion: no-preference) {
  html:has(.bl-post) { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  .bl *, .bl *::before, .bl *::after { transition-duration: .001ms !important; }
}

/* =========================================================
   BELOW 1180px — --u is 1px; one column, real px.
   Phones and tablets read at 17–18px (--read), never below 17.
   ========================================================= */
@media (max-width: 1179px) {
  .bl { --pad: 22px; }
  .bl-post {
    --read: clamp(17px, calc(15px + .6vw), 18px);
    --nav-clear: 90px;
  }
  .bl .i { width: 16px; height: 16px; }
  .bl .btn .i { width: 18px; height: 18px; }
  .bl .btn--lg { height: 52px; padding: 0 20px; gap: 10px; font-size: 17px; }
  .bl-h1 br, .bl-h2 br { display: none; }

  .bl-eyebrow { font-size: 12px; margin-bottom: 16px; gap: 8px; }
  .bl-eyebrow::before { width: 7px; height: 7px; box-shadow: 0 0 0 3px var(--lime-tint); }
  .bl-h1 { font-size: 34px; line-height: 42px; }
  .bl-h2 { font-size: 28px; line-height: 34px; }
  .bl-lede { margin-top: 18px; font-size: 17px; line-height: 26px; }
  .bl-meta { font-size: 13.5px; gap: 4px 10px; }
  .bl-tag { font-size: 11.5px; gap: 7px; }
  .bl-tag::before { width: 6px; height: 6px; }
  .bl-badge { height: 22px; padding: 0 9px; font-size: 11px; }
  .bl-more { font-size: 15px; }

  .bl-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 28px; }
  .bl-card__link, .bl-featured__link { border-radius: 12px; }
  .bl-card__body { padding: 18px 20px 20px; gap: 10px; }
  .bl-card__title { font-size: 20px; line-height: 26px; }
  .bl-card__excerpt { font-size: 15px; line-height: 23px; }
  .bl-card__foot { padding-top: 14px; gap: 10px; }
  .bl-noimg span, .bl-featured__img .bl-noimg span { font-size: 17px; padding: 8px 14px; gap: 10px; }

  .bl-hero { padding: 44px 22px 36px; }
  .bl-hero__grid { display: none; }
  .bl-featured { padding: 0 22px 56px; }
  .bl-featured__link { grid-template-columns: minmax(0, 1fr); }
  .bl-featured__img { aspect-ratio: 16 / 10; min-height: 0; border-right: 0; border-bottom: 1px solid var(--rule); }
  .bl-featured__body { gap: 14px; padding: 22px 20px 24px; }
  .bl-featured__title { font-size: 24px; line-height: 30px; }
  .bl-featured__excerpt { font-size: 15.5px; line-height: 24px; }

  .bl-list { padding: 56px 22px 64px; }
  .bl-list__head { flex-direction: column; align-items: flex-start; gap: 18px; }
  .bl-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: calc(100% + 44px);
    margin: 0 -22px;
    padding: 0 22px 4px;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }
  .bl-chips::-webkit-scrollbar { display: none; }
  .bl-chip { flex: none; min-height: 44px; padding: 0 16px; font-size: 14.5px; }
  .bl-chip span { font-size: 12px; }
  .bl-count { margin-top: 20px; font-size: 14px; }
  .bl-pages { margin-top: 40px; padding-top: 28px; gap: 6px; }
  .bl-pages button { min-width: 44px; height: 44px; padding: 0 10px; border-radius: 12px; font-size: 15px; }
  .bl-pages .edge span { display: none; }
  .bl-pages .num:not([aria-current="page"]):not(.near) { display: none; }
  .bl-pages .gap { display: none; }

  /* a post: header and document share one centred reading column */
  .bl-post__head { padding: 40px max(22px, calc((100% - var(--wide)) / 2)) 28px; }
  .bl-crumbs { margin: -10px 0 8px; font-size: 13.5px; gap: 0 8px; }
  .bl-crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
  .bl-post__title { font-size: 32px; line-height: 40px; }
  .bl-post__lede { margin-top: 14px; font-size: 17px; line-height: 26px; }
  .bl-byline { margin-top: 20px; gap: 12px; }
  .bl-byline__who { font-size: 14.5px; line-height: 20px; gap: 0 8px; }
  .bl-byline__role::before { margin-right: 8px; }
  .bl-byline__txt { gap: 3px; }
  .bl-av { width: 40px; height: 40px; font-size: 15px; }
  .bl-av--sm { width: 20px; height: 20px; font-size: 8px; }
  .bl-av--lg { width: 64px; height: 64px; font-size: 22px; }
  .bl-by { gap: 7px; }
  .bl-post__body { display: block; }
  .bl-post__side { display: none; }
  .bl-post__doc { border-left: 0; padding: 28px max(22px, calc((100% - var(--wide)) / 2)) 64px; }
  .bl-post__hero { margin-bottom: 28px; }
  .bl-post__hero img { max-height: 56vh; border-radius: 12px; }
  .bl-toc-m { display: block; }
  .bl-totop { display: grid; }

  .bl-author { gap: 16px; margin-top: 48px; padding: 20px; border-radius: 12px; }
  .bl-author__name { font-size: 20px; line-height: 26px; }
  .bl-author__role { font-size: 14.5px; }
  .bl-author__bio { margin-top: 10px; font-size: 16px; line-height: 25px; }
  .bl-author__links { margin-top: 14px; }
  .bl-author__links a { width: 44px; height: 44px; }
  .bl-author__links .i { width: 18px; height: 18px; }
  .bl-author + .bl-post__foot { margin-top: 28px; }
  .bl-post__foot { margin-top: 48px; padding-top: 20px; gap: 8px 24px; }
  .bl-back { min-height: 44px; font-size: 15px; gap: 8px; }

  .bl-prose h2 { font-size: 1.45em; }
  .bl-prose h3 { font-size: 1.2em; }
  .bl-prose h4 { font-size: 1.05em; }
  .bl-prose h2, .bl-prose h3, .bl-prose h4 { scroll-margin-top: 12px; }
  .bl-prose img { border-radius: 10px; }
  .bl-prose .bl-table, .bl-prose pre { border-radius: 10px; }
  .bl-prose th, .bl-prose td { padding: .65em .85em; }

  .bl-related { padding: 56px 22px 64px; }
  .bl-related .bl-h2 { font-size: 24px; line-height: 31px; }
  .bl-related .bl-grid { margin-top: 24px; }

  .bl-cta { padding: 80px 22px 88px; }
  .bl-cta__grid { display: none; }
  .bl-cta .bl-h2 { font-size: 36px; line-height: 42px; }
  .bl-cta__body { margin-top: 14px; font-size: 16px; line-height: 26px; }
  .bl-cta__acts { flex-direction: column; align-items: stretch; gap: 12px; margin-top: 28px; }
}

/* tablets (768–1179px) — scoped inside the one mobile layout: the card grid
   goes two-up, the featured post sits side by side again, Keep reading shows two */
@media (min-width: 768px) and (max-width: 1179px) {
  .bl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .bl-related .bl-card:nth-child(n + 3) { display: none; }
  .bl-featured__link { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .bl-featured__img { aspect-ratio: auto; min-height: 300px; border-bottom: 0; border-right: 1px solid var(--rule); }
  .bl-featured__body { padding: 28px; }
  .bl-featured__title { font-size: 26px; line-height: 32px; }
  .bl-cta__acts { flex-direction: row; justify-content: center; }
  .bl-post__title { font-size: 40px; line-height: 48px; }
  .bl-post__lede { font-size: 19px; line-height: 28px; }
}

/* =========================================================
   PRINT — a post on paper: the article only, black text,
   link targets written out after the link
   ========================================================= */
@media print {
  .navshell, .site-foot, .bl-skip, .bl-progress, .bl-totop, .bl-post__side, .bl-toc-m,
  .bl-post__foot, .bl-related, .bl-cta, .bl-hero__grid { display: none !important; }
  .frame { width: auto; border: 0; }
  .bl-post { --read: 11.5pt; --measure: none; --wide: none; }
  .bl-post__head, .bl-post__doc { padding: 0 0 12pt; border: 0; }
  .bl-post__body { display: block; }
  .bl-post__title { font-size: 24pt; line-height: 1.2; }
  .bl-post__lede { font-size: 13pt; }
  .bl-post__head, .bl-post__title, .bl-post__lede, .bl-byline__role, .bl-meta, .bl-tag,
  .bl-prose, .bl-prose :is(h2, h3, h4, strong, a, blockquote, figcaption, td, th) { color: #000 !important; }
  .bl-prose a { text-decoration: underline; background: none; }
  .bl-prose a[href^="http"]::after { content: " (" attr(href) ")"; font-weight: 400; font-size: .85em; overflow-wrap: anywhere; }
  .bl-prose a[href^="/"]::after { content: " (https://wisemelon.ai" attr(href) ")"; font-weight: 400; font-size: .85em; overflow-wrap: anywhere; }
  .bl-prose :is(h2, h3, h4) { break-after: avoid; }
  .bl-prose :is(figure, blockquote, tr, img) { break-inside: avoid; }
  .bl-prose .bl-table { overflow: visible; }
  .bl-post__hero img { max-height: 9cm; }
  .bl-author { break-inside: avoid; }
}
