/* Blog: the index and the posts. Loaded after main.css on blog.html and blog/*.html.
   Everything that floats over the contour background is the panel's liquid glass (the same
   recipe as the header bar): a thin tint over a strong blur, an inner top light and a gradient
   rim. Text sits in a single 700px column; media, charts and tables can run wider. */

:root {
  --post-col: 700px;
  --post-wide: 960px;
  --post-ink: rgba(232, 244, 239, 0.8);
  --link: #88ebc8;
  --amber: #f3c47a;

  /* Chart colors, in fixed order (validated for the dark surface: lightness band, chroma,
     CVD and normal-vision separation, contrast). One series uses --c1. */
  --c1: #1fa877;
  --c2: #3f8ee0;
  --c3: #c3851f;
  --c4: #a873e0;
  --grid: rgba(255, 255, 255, 0.09);

  --arrow-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 12'%3E%3Cpath d='M2 6h20M17 1.5 22 6l-5 4.5' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --arrow-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 22'%3E%3Cpath d='M6 2v16M1.5 13 6 18l4.5-5' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ===== Liquid glass ===== */
:where(.post-card, .post-media, .post-chart, .post-callout, .highlight-box, .warning-box,
  .cta-box, .pros-cons, .steps, .stat-row, .statistics-box, .stat-box, .table-wrap, .post-toc,
  .flow-step, .post-next-card, .post-tldr, .version-compare > figure) {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075) 0%, rgba(255, 255, 255, 0.018) 44%, rgba(255, 255, 255, 0.04) 100%),
    rgba(15, 21, 20, 0.5);
  -webkit-backdrop-filter: blur(22px) saturate(180%) brightness(1.05);
  backdrop-filter: blur(22px) saturate(180%) brightness(1.05);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.16),
    inset 0 -1px 1px rgba(255, 255, 255, 0.04),
    inset 0 0 22px rgba(255, 255, 255, 0.025),
    0 1px 2px rgba(0, 0, 0, 0.28),
    0 16px 40px rgba(0, 0, 0, 0.3);
}

/* The rim catches the light at the top left and bottom right */
:where(.post-card, .post-media, .post-chart, .post-callout, .highlight-box, .warning-box,
  .cta-box, .pros-cons, .steps, .stat-row, .statistics-box, .stat-box, .table-wrap, .post-toc,
  .flow-step, .post-next-card, .post-tldr, .version-compare > figure)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(125deg,
    rgba(255, 255, 255, 0.42) 0%,
    rgba(255, 255, 255, 0.1) 24%,
    rgba(255, 255, 255, 0.03) 58%,
    rgba(200, 255, 230, 0.22) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

/* ===== Blog index ===== */
.blog-index-hero {
  padding: 148px 20px 8px;
  text-align: center;
  position: relative;
  z-index: 10;
}

.blog-index-hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.026em;
  line-height: 1.08;
  margin-bottom: 14px;
  text-wrap: balance;
  color: var(--text);
}

.blog-index-hero p {
  max-width: 560px;
  margin: 0 auto;
  color: var(--text-2);
  font-size: 17px;
  text-wrap: pretty;
}

.blog-index {
  position: relative;
  z-index: 10;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 20px 40px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.post-card {
  display: flex;
  flex-direction: column;
  padding: 7px;
  border-radius: 22px;
  transition: background-color 0.2s ease;
}

.post-card:hover {
  background-color: rgba(255, 255, 255, 0.035);
}

.post-card-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 15px;
  background: #0d1211;
}

.post-card-media :is(img, video) {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* A hairline inside the image edge so light thumbnails don't bleed into the glass */
.post-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.post-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 16px 13px 12px;
}

.post-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  margin-bottom: 8px;
  color: var(--text-3);
  font-size: 13px;
}

.post-card-meta > * + *::before {
  content: "\00b7";
  margin-right: 8px;
}

.post-card h2 {
  font-size: 19px;
  font-weight: 650;
  line-height: 1.28;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
  text-wrap: balance;
}

.post-card h2 a {
  color: var(--text);
  text-decoration: none;
}

/* The whole card is the link */
.post-card h2 a::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 22px;
}

.post-card h2 a:focus-visible {
  outline: none;
}

.post-card h2 a:focus-visible::before {
  outline: 2px solid var(--green-line);
  outline-offset: 3px;
}

.post-card p {
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

/* The newest post, wide: the 3.0 promo loops beside the copy */
.post-card--featured {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 26px;
}

.post-card--featured .post-card-media {
  aspect-ratio: 16 / 9;
  border-radius: 19px;
}

.post-card--featured .post-card-body {
  padding: 22px 26px 22px 24px;
}

.post-card--featured h2 {
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.16;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.post-card--featured h2 a::before {
  border-radius: 26px;
}

.post-card--featured p {
  font-size: 16px;
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

.post-card-cta {
  margin-top: 18px;
  color: var(--mint);
  font-size: 14.5px;
  font-weight: 600;
}

@media (max-width: 1000px) {
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .post-card--featured {
    grid-template-columns: 1fr;
  }

  .post-card--featured .post-card-body {
    padding: 16px 14px 14px;
  }
}

@media (max-width: 640px) {
  .blog-index-hero {
    padding-top: 120px;
  }

  .post-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ===== Post ===== */
.post {
  position: relative;
  z-index: 10;
  max-width: 1240px;
  margin: 0 auto;
  padding: 136px 20px 48px;
  color: var(--post-ink);
}

.post-header {
  max-width: var(--post-col);
  margin: 0 auto 40px;
}

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
  color: var(--text-3);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-back::before {
  content: "\2190";
}

.post-back:hover {
  color: var(--text);
}

.post-header h1 {
  font-size: clamp(32px, 4.4vw, 46px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.024em;
  margin-bottom: 18px;
  text-wrap: balance;
  color: var(--text);
}

/* One older post repeats its title as a second h1 under the meta line; it reads as a subtitle */
.post-header h1 ~ h1 {
  font-size: clamp(20px, 2.4vw, 24px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
  padding-bottom: 0;
  margin-bottom: 18px;
  color: var(--text-2);
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  margin-bottom: 28px;
  color: var(--text-3);
  font-size: 14px;
}

.article-meta > * + *::before {
  content: "\00b7";
  margin-right: 8px;
}

.post-header p {
  font-size: 17.5px;
  line-height: 1.75;
  margin-bottom: 1.1em;
  text-wrap: pretty;
}

/* The first paragraph leads */
.post-header h1 ~ p:first-of-type {
  font-size: 20px;
  line-height: 1.6;
  color: rgba(240, 250, 246, 0.9);
  letter-spacing: -0.01em;
}

.post-header > :last-child {
  margin-bottom: 0;
}

/* The body column, with the contents rail to its left on wide screens */
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--post-col)) minmax(0, 1fr);
  column-gap: 40px;
}

.post-body {
  grid-column: 2;
  min-width: 0;
}

.post-toc {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  align-self: start;
  position: sticky;
  top: 112px;
  width: 210px;
  max-height: calc(100vh / 0.9 - 150px);
  overflow-y: auto;
  padding: 10px;
  border-radius: 18px;
  scrollbar-width: none;
}

.post-toc[hidden] {
  display: none;
}

.post-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-toc a {
  display: block;
  padding: 6px 10px;
  border-radius: 10px;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.post-toc a:hover {
  color: var(--text);
}

/* The section being read (blog.js) */
.post-toc a[aria-current="true"] {
  color: #fff;
  font-weight: 560;
  background: rgba(255, 255, 255, 0.07);
}

@media (max-width: 1220px) {
  .post-layout {
    display: block;
    max-width: var(--post-col);
    margin: 0 auto;
  }

  .post-toc {
    display: none;
  }
}

/* Body type */
.post-body > p,
.post-body li {
  font-size: 17.5px;
  line-height: 1.78;
  text-wrap: pretty;
}

.post-body > p {
  margin-bottom: 1.15em;
}

.post-body h2 {
  margin: 64px 0 16px;
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 680;
  line-height: 1.2;
  letter-spacing: -0.022em;
  color: #fff;
  text-wrap: balance;
  scroll-margin-top: 110px;
}

.post-body > :first-child {
  margin-top: 0;
}

.post-body h3 {
  margin: 36px 0 10px;
  font-size: 20px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.012em;
  color: rgba(255, 255, 255, 0.96);
}

.post-body h4 {
  margin: 0 0 6px;
  font-size: 16.5px;
  font-weight: 650;
  line-height: 1.4;
  color: #fff;
}

.post-body strong {
  color: #fff;
  font-weight: 620;
}

.post-body em {
  color: rgba(255, 255, 255, 0.92);
}

.post-body a,
.post-header a:not(.post-back) {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: rgba(136, 235, 200, 0.35);
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.2s ease;
}

.post-body a:hover {
  text-decoration-color: currentColor;
}

.post-body :is(ul, ol) {
  margin: 0 0 1.4em;
  padding-left: 1.4em;
}

.post-body li {
  margin-bottom: 0.45em;
  padding-left: 0.3em;
}

.post-body ul > li::marker {
  color: var(--green-line);
}

.post-body ol > li::marker {
  color: var(--text-3);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.post-body kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 0.4em;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  background: rgba(255, 255, 255, 0.06);
  font: inherit;
  font-size: 0.85em;
  line-height: 1.5;
  text-align: center;
  color: var(--text);
}

.post-body code {
  padding: 0.1em 0.4em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.86em;
  color: var(--text);
}

.post-body hr {
  border: 0;
  height: 1px;
  margin: 48px 0;
  background: var(--line);
}

/* Blocks inside the body share a rhythm */
.post-body > :is(figure, .highlight-box, .warning-box, .cta-box, .pros-cons, .steps,
  .stat-row, .statistics-box, .stat-box, .table-wrap, .flow, .post-callout, .post-tldr,
  .version-compare, .media-pair) {
  margin-top: 32px;
  margin-bottom: 32px;
}

/* The hero video runs wider than the text column */
.post-hero {
  width: min(var(--post-wide), calc(100vw / 0.9 - 40px));
  margin-left: 50%;
  transform: translateX(-50%);
}

/* ===== Media: video loops and stills in a glass frame ===== */
.post-media {
  padding: 6px;
  border-radius: 22px;
}

.post-media > :is(img, video, picture),
.post-media > .post-media-frame {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  background: #0d1211;
}

.post-media video {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.post-media figcaption,
.post-chart figcaption {
  padding: 11px 10px 5px;
  color: var(--text-3);
  font-size: 13.5px;
  line-height: 1.5;
  text-wrap: pretty;
}

.post-media figcaption h3 {
  margin: 0 0 2px;
  font-size: 14.5px;
  font-weight: 620;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--text);
}

.post-media figcaption p {
  margin: 0;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

.post-media figcaption strong,
.post-chart figcaption strong {
  color: var(--text-2);
  font-weight: 600;
}

.post-hero {
  margin-bottom: 56px;
}

/* Two stills side by side */
.media-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.media-pair > figure {
  margin: 0;
}

@media (max-width: 640px) {
  .media-pair {
    grid-template-columns: 1fr;
  }
}

/* ===== Callouts ===== */
.highlight-box,
.warning-box,
.post-callout {
  padding: 20px 22px;
  border-radius: 18px;
}

.highlight-box {
  background-image:
    radial-gradient(120% 140% at 0% 0%, rgba(63, 224, 166, 0.13) 0%, rgba(63, 224, 166, 0) 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075) 0%, rgba(255, 255, 255, 0.018) 44%, rgba(255, 255, 255, 0.04) 100%);
}

.warning-box {
  background-image:
    radial-gradient(120% 140% at 0% 0%, rgba(243, 196, 122, 0.13) 0%, rgba(243, 196, 122, 0) 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075) 0%, rgba(255, 255, 255, 0.018) 44%, rgba(255, 255, 255, 0.04) 100%);
}

.warning-box h4 {
  color: var(--amber);
}

.warning-box h4::before {
  content: "";
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 8px;
  vertical-align: -2px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}

:is(.highlight-box, .warning-box, .post-callout, .cta-box, .pros-cons) :is(p, li) {
  font-size: 16.5px;
  line-height: 1.7;
}

:is(.highlight-box, .warning-box, .post-callout, .cta-box) > p {
  margin-bottom: 0.7em;
}

:is(.highlight-box, .warning-box, .post-callout, .cta-box, .pros-cons, .steps, .method-card) > :last-child {
  margin-bottom: 0;
}

.cta-box {
  padding: 28px 26px;
  border-radius: 22px;
  text-align: center;
  background-image:
    radial-gradient(80% 120% at 50% 0%, rgba(11, 181, 126, 0.2) 0%, rgba(11, 181, 126, 0) 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075) 0%, rgba(255, 255, 255, 0.018) 44%, rgba(255, 255, 255, 0.04) 100%);
}

.post-body .cta-box h3 {
  margin-top: 0;
}

.cta-box .btn {
  margin-top: 8px;
  text-decoration: none;
  color: #e8fff5;
}

/* Pros and cons, side by side */
.pros-cons {
  padding: 22px 24px;
  border-radius: 20px;
}

.pros-cons h4 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pros-cons h4:not(:first-child) {
  margin-top: 18px;
}

.pros-cons ul {
  margin-bottom: 0;
}

/* ===== Steps: a run of .method-card (or any list of steps) on one rail ===== */
.steps {
  padding: 24px 24px 6px;
  border-radius: 20px;
}

.method-card {
  position: relative;
  padding: 0 0 22px 36px;
}

.method-card::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 4px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--green-line);
  box-shadow: 0 0 0 4px rgba(63, 224, 166, 0.12);
}

.method-card::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 26px;
  bottom: 4px;
  width: 1px;
  background: linear-gradient(180deg, rgba(63, 224, 166, 0.5), rgba(63, 224, 166, 0.08));
}

.method-card:last-child::after {
  display: none;
}

.method-card h4 {
  margin-top: 0;
}

.method-card p,
.method-card li {
  font-size: 16.5px;
  line-height: 1.7;
}

.method-card p {
  margin-bottom: 0.5em;
}

/* ===== Numbers ===== */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  border-radius: 20px;
  overflow: hidden;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 20px 18px;
  box-shadow: -1px 0 0 var(--line);
}

.stat-value,
.statistics-box .stat-number,
.stat-box .stat-number {
  font-size: clamp(30px, 4vw, 38px);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -0.022em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat-value small {
  font-size: 0.5em;
  font-weight: 600;
  letter-spacing: 0;
  margin-left: 2px;
}

.stat-label {
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.45;
}

.statistics-box,
.stat-box {
  padding: 26px 24px;
  border-radius: 20px;
  text-align: center;
}

.statistics-box .stat-number,
.stat-box .stat-number {
  font-size: clamp(44px, 7vw, 64px);
  margin-bottom: 8px;
}

.post-body .statistics-box h3 {
  margin-top: 0;
}

.statistics-box p,
.stat-box p {
  font-size: 16px;
  margin-bottom: 0;
}

/* ===== Tables ===== */
.table-wrap {
  border-radius: 20px;
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

.table-wrap table,
.post-body .comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.table-wrap :is(th, td) {
  padding: 13px 18px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table-wrap th {
  color: var(--text-3);
  font-size: 13px;
  font-weight: 600;
}

.table-wrap td {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.table-wrap td:first-child {
  color: var(--text);
}

.table-wrap tr:last-child td {
  border-bottom: 0;
}

.table-wrap .num {
  text-align: right;
}

.win-cell {
  color: var(--mint) !important;
  font-weight: 600;
}

/* ===== Clue numbers ===== */
.clue-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4em;
  height: 1.4em;
  margin-right: 0.45em;
  border-radius: 50%;
  vertical-align: 0.06em;
  font-size: 0.78em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--mint-pale);
  background:
    radial-gradient(70% 50% at 38% 18%, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0) 70%),
    rgba(63, 224, 166, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 0 0 1px rgba(63, 224, 166, 0.35);
}

/* ===== Charts ===== */
.post-chart {
  padding: 22px 22px 12px;
  border-radius: 22px;
}

.post-chart > h4 {
  margin-bottom: 4px;
}

.chart-sub {
  margin: 0 0 16px;
  color: var(--text-3);
  font-size: 13.5px;
}

.post-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.post-chart svg text {
  font-family: inherit;
  fill: var(--text-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.post-chart svg .t-strong {
  fill: var(--text);
  font-weight: 600;
}

.post-chart svg .t-mid {
  fill: var(--text-2);
}

.post-chart svg .grid {
  stroke: var(--grid);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.post-chart svg .axis {
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.post-chart svg .line {
  fill: none;
  stroke: var(--c1);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.post-chart svg .area {
  fill: var(--c1);
  opacity: 0.1;
}

.post-chart svg .dot {
  fill: var(--c1);
  stroke: #141a19;
  stroke-width: 2;
}

.post-chart svg .band {
  fill: var(--c1);
  opacity: 0.16;
}

.post-chart svg .hit {
  fill: transparent;
  cursor: default;
}

.post-chart svg .hit:hover + .dot,
.post-chart svg .dot:hover {
  stroke: #fff;
}

/* Horizontal bars, in HTML so labels never shrink on phones */
.bars {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  gap: 10px 14px;
  margin: 4px 0 10px;
}

.bar-label {
  color: var(--text-2);
  font-size: 14px;
}

.bar-track {
  height: 14px;
}

.bar-fill {
  display: block;
  height: 100%;
  width: calc(var(--v) * 1%);
  min-width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--bar, var(--c1));
}

.bar-fill--range {
  margin-left: calc(var(--from) * 1%);
  width: calc((var(--v) - var(--from)) * 1%);
  border-radius: 4px;
}

.bar-value {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

@media (max-width: 520px) {
  .bars {
    grid-template-columns: minmax(0, 1fr) max-content;
  }

  .bar-label {
    grid-column: 1 / -1;
    margin-bottom: -6px;
  }
}

/* A whole split into parts (a 60-second round, a 4-week plan): one row, 2px gaps */
.split {
  display: flex;
  gap: 2px;
  height: 34px;
  margin: 6px 0 12px;
}

.split > span {
  flex: var(--v) 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--seg, var(--c1));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.split > span:first-child {
  border-radius: 4px 0 0 4px;
}

.split > span:last-child {
  border-radius: 0 4px 4px 0;
}

ul.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-2);
  font-size: 13.5px;
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 0;
  font-size: inherit;
  line-height: 1.5;
}

.legend li::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--seg, var(--c1));
}

.legend li::marker {
  content: none;
}

/* ===== Flow diagrams: steps joined by arrows; they stack on phones ===== */
ol.flow {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: flow;
}

.flow > li {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.flow > li + li::before {
  content: "";
  flex: 0 0 26px;
  align-self: center;
  height: 12px;
  background: rgba(63, 224, 166, 0.7);
  -webkit-mask: var(--arrow-right) center / 26px 12px no-repeat;
  mask: var(--arrow-right) center / 26px 12px no-repeat;
}

.flow-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 14px 13px;
  border-radius: 16px;
  counter-increment: flow;
}

.flow-step b {
  color: #fff;
  font-size: 14.5px;
  font-weight: 620;
  line-height: 1.3;
}

.flow-step b::before {
  content: counter(flow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 7px;
  border-radius: 50%;
  vertical-align: 1px;
  background: rgba(63, 224, 166, 0.16);
  box-shadow: inset 0 0 0 1px rgba(63, 224, 166, 0.4);
  color: var(--mint-pale);
  font-size: 11px;
  font-weight: 700;
}

.flow-step span {
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.45;
}

.flow + figcaption,
.flow-caption {
  margin-top: 10px;
  color: var(--text-3);
  font-size: 13.5px;
}

/* Five or more steps don't fit across the column, so they run down it, one row each;
   on phones every flow does */
ol.flow:has(> li:nth-child(5)),
ol.flow:has(> li:nth-child(5)) > li {
  flex-direction: column;
}

ol.flow:has(> li:nth-child(5)) > li + li::before {
  flex-basis: 20px;
  width: 12px;
  height: auto;
  -webkit-mask: var(--arrow-down) center / 12px 20px no-repeat;
  mask: var(--arrow-down) center / 12px 20px no-repeat;
}

ol.flow:has(> li:nth-child(5)) .flow-step {
  flex-direction: row;
  align-items: baseline;
  gap: 14px;
  padding: 11px 16px;
}

ol.flow:has(> li:nth-child(5)) .flow-step b {
  flex: 0 0 38%;
}

@media (max-width: 760px) {
  ol.flow,
  ol.flow > li {
    flex-direction: column;
  }

  ol.flow > li + li::before {
    flex-basis: 20px;
    width: 12px;
    height: auto;
    -webkit-mask: var(--arrow-down) center / 12px 20px no-repeat;
    mask: var(--arrow-down) center / 12px 20px no-repeat;
  }

  ol.flow .flow-step {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
}

/* ===== Short summary at the top of long posts ===== */
.post-tldr {
  padding: 18px 22px;
  border-radius: 18px;
}

.post-tldr ul {
  margin: 0;
}

.post-tldr li {
  font-size: 16px;
  margin-bottom: 0.3em;
}

/* ===== Before / after ===== */
.version-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.version-compare > figure {
  margin: 0;
  padding: 6px;
  border-radius: 20px;
}

.version-compare img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}

.version-compare figcaption {
  padding: 10px 8px 4px;
  color: var(--text-3);
  font-size: 13.5px;
}

.version-compare figcaption strong {
  color: var(--text);
  font-weight: 620;
}

@media (max-width: 640px) {
  .version-compare {
    grid-template-columns: 1fr;
  }
}

/* ===== Keep reading ===== */
.post-next {
  max-width: var(--post-wide);
  margin: 72px auto 0;
}

.post-next h2 {
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: 650;
  color: #fff;
}

.post-next-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.post-next-card {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 6px 14px 6px 6px;
  border-radius: 18px;
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.post-next-card:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.post-next-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 13px;
}

.post-next-card span {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  text-wrap: balance;
}

.post-next-card small {
  display: block;
  margin-top: 4px;
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 500;
}

@media (max-width: 680px) {
  .post-next-grid {
    grid-template-columns: 1fr;
  }

  .post-next-card {
    grid-template-columns: 112px minmax(0, 1fr);
  }
}

/* ===== The closing call to action: the homepage's glass panel ===== */
.blog-post-page .cta-section,
.blog-cta {
  padding: 40px 20px 96px;
}

.cta-section .cta-panel p {
  margin-bottom: 28px;
}

/* ===== Phones ===== */
@media (max-width: 640px) {
  .post {
    padding-top: 112px;
  }

  .post-header h1 ~ p:first-of-type {
    font-size: 18.5px;
  }

  .post-body > p,
  .post-body li {
    font-size: 17px;
  }

  .post-body h2 {
    margin-top: 52px;
  }

  .post-hero {
    width: auto;
    margin-left: 0;
    transform: none;
  }

  .post-chart {
    padding: 18px 16px 10px;
  }

  .stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat {
    box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line);
  }

  .table-wrap :is(th, td) {
    padding: 12px 14px;
  }
}

/* Video loops wait for the viewer when motion is reduced (blog.js adds controls) */
@media (prefers-reduced-motion: reduce) {
  .post-card,
  .post-next-card {
    transition: none;
  }
}
