/* ════════════════════════════════════════════════════
 * itsaryan — Blog Redesign Layer
 * Creative, readable field notes. Loaded after polish.css.
 * ════════════════════════════════════════════════════ */

/* ── BLOG INDEX PAGE ───────────────────────────────── */
.blog-page .blue-wash,
.blog-article-page .blue-wash {
  background:
    radial-gradient(ellipse 70% 42% at 50% -12%, rgba(74, 159, 255, 0.18), transparent 64%),
    radial-gradient(ellipse 48% 34% at 12% 28%, rgba(232, 68, 61, 0.08), transparent 62%),
    radial-gradient(ellipse 55% 42% at 88% 52%, rgba(52, 211, 153, 0.08), transparent 66%),
    linear-gradient(180deg, #08111f 0%, #09111e 42%, #070b15 100%);
  animation: none;
}

.blog-page .blue-wash::after,
.blog-article-page .blue-wash::after {
  background:
    linear-gradient(180deg, rgba(10, 14, 26, 0.08), rgba(10, 14, 26, 0.34)),
    radial-gradient(circle at 50% 0%, transparent 0 28%, rgba(7, 11, 21, 0.42) 72%);
}

.blog-page .paper-grid,
.blog-article-page .paper-grid {
  background:
    radial-gradient(circle at 1px 1px, rgba(244, 236, 216, 0.035) 1px, transparent 1.5px),
    linear-gradient(90deg, rgba(74, 159, 255, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(74, 159, 255, 0.025) 1px, transparent 1px);
  background-size: 30px 30px, 120px 120px, 120px 120px;
  opacity: 0.72;
}

.blog-page .site-main,
.blog-article-page .site-main {
  position: relative;
  isolation: isolate;
}

.blog-page .site-main::before,
.blog-article-page .site-main::before {
  content: "";
  position: fixed;
  inset: 4rem 1rem auto;
  height: 34vh;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(74, 159, 255, 0.08), rgba(232, 68, 61, 0.05), transparent);
  filter: blur(34px);
  opacity: 0.75;
  pointer-events: none;
  z-index: -1;
}

.blog-index {
  position: relative;
  padding: 9rem 0 5rem;
}

.blog-index__head {
  max-width: 760px;
  margin: 0 auto 2.5rem;
  text-align: center;
}

.blog-index__head .eyebrow {
  justify-content: center;
}

.blog-index__head .eyebrow::before { display: none; }

.blog-index__head .display-h2 {
  margin-bottom: 0.6rem;
}

.blog-index__head .section-sub {
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ── FLOATING TOOLBAR ──────────────────────────────── */
.blog-toolbar {
  position: sticky;
  top: 5.2rem;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem 1rem;
  max-width: var(--maxw);
  margin: 0 auto 2.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 14, 26, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow);
}

.blog-toolbar .blog-search {
  flex: 1 1 220px;
  min-width: 180px;
}

.blog-toolbar .blog-search input {
  width: 100%;
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font: 500 0.92rem var(--font-main);
  outline: none;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.blog-toolbar .blog-search input::placeholder { color: var(--muted-2); }

.blog-toolbar .blog-search input:focus {
  border-color: var(--blue);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(74, 159, 255, 0.12);
}

.blog-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 1 1 auto;
  justify-content: flex-end;
}

.blog-topic {
  min-height: 34px;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 800 0.7rem var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, color 0.25s, transform 0.25s var(--ease);
}

.blog-topic:hover,
.blog-topic:focus-visible,
.blog-topic.is-active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  outline: none;
}

.blog-topic:hover { transform: translateY(-1px); }

.blog-count {
  font: 700 0.66rem var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* ── FEATURED CARD ─────────────────────────────────── */
.blog-featured {
  max-width: var(--maxw);
  margin: 0 auto 2.2rem;
}

.blog-card--featured {
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(17, 23, 42, 0.65);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), border-color 0.45s;
  will-change: transform;
}

.blog-card--featured:hover {
  border-color: rgba(74, 159, 255, 0.45);
  box-shadow:
    0 50px 120px rgba(0, 0, 0, 0.7),
    0 0 60px rgba(74, 159, 255, 0.2);
}

.blog-card--featured .blog-card__link {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 0;
  min-height: 420px;
  padding: 0;
}

.blog-card--featured .blog-card__content {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: clamp(1.6rem, 4vw, 2.6rem);
  z-index: 2;
}

.blog-card--featured .blog-card__visual {
  height: 100%;
  min-height: 300px;
  border-radius: 0 28px 28px 0;
  border: none;
}

.blog-card--featured .pretext-motion {
  position: absolute;
  inset: 0;
  height: 100%;
  border-radius: 28px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

@media (max-width: 900px) {
  .blog-card--featured .blog-card__link { grid-template-columns: 1fr; }
  .blog-card--featured .blog-card__motion.pretext-motion {
    order: -1;
    min-height: 230px;
    border-left: none;
    border-bottom: 1px solid rgba(244,236,216,0.08);
    border-radius: 28px 28px 0 0;
  }
  .blog-card--featured .blog-card__visual {
    order: -1;
    height: 240px;
    min-height: 0;
    border-radius: 28px 28px 0 0;
  }
  .blog-card--featured { min-height: 0; }
}

/* ── CREATIVE CARD GRID ────────────────────────────── */
.blog-grid--creative {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  max-width: var(--maxw);
  margin: 0 auto;
}

.blog-card {
  position: relative;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(17, 23, 42, 0.55);
  border: 1px solid var(--line);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), border-color 0.45s;
  will-change: transform;
}

.blog-card:hover {
  border-color: rgba(74, 159, 255, 0.4);
  box-shadow:
    0 36px 80px rgba(0, 0, 0, 0.6),
    0 0 50px rgba(74, 159, 255, 0.16);
}

.blog-card .blog-card__link {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.2rem;
  min-height: 320px;
  color: var(--ink);
  text-decoration: none;
  z-index: 1;
}

.blog-card__spotlight {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 50%), rgba(74, 159, 255, 0.18), transparent 40%);
  transition: opacity 0.45s;
  pointer-events: none;
  z-index: 0;
}

.blog-card:hover .blog-card__spotlight { opacity: 1; }

.blog-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font: 800 0.64rem var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  z-index: 2;
}

.blog-card__category {
  color: var(--blue);
}

.blog-card__visual {
  position: relative;
  height: 160px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #071320;
  z-index: 2;
  isolation: isolate;
}

/* Animated cover scene (canvas) — sits above the static SVG image
   but below the existing shimmer overlay. */
.blog-card__visual .cover-scene,
.blog-article__cover .cover-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.92;
}

/* Make the static cover image act as a backdrop that the canvas paints over. */
.blog-card__visual img,
.blog-article__cover img {
  position: relative;
  z-index: 1;
}

.blog-card__visual .cover-grain,
.blog-article__cover .cover-grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.18;
  mix-blend-mode: overlay;
  background-image:
    radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    radial-gradient(rgba(0,0,0,0.04) 1px, transparent 1px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 1px 2px;
  animation: cover-grain-drift 9s steps(8) infinite;
}

@keyframes cover-grain-drift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-3px, 2px); }
  50%  { transform: translate(2px, -3px); }
  75%  { transform: translate(-2px, -2px); }
  100% { transform: translate(0, 0); }
}

/* Cover live pill — only on article hero to evoke a header video. */
.blog-article__cover {
  position: relative;
  isolation: isolate;
}

.blog-article__cover .cover-live {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem 0.4rem 0.6rem;
  border-radius: 999px;
  background: rgba(7, 19, 32, 0.7);
  border: 1px solid rgba(244, 236, 216, 0.16);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  font: 800 0.62rem var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(244, 236, 216, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.cover-live__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e8443d;
  box-shadow: 0 0 0 0 rgba(232, 68, 61, 0.7);
  animation: cover-rec-pulse 1.6s ease-out infinite;
}

@keyframes cover-rec-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(232, 68, 61, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(232, 68, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 68, 61, 0); }
}

.cover-live__topic {
  opacity: 0.6;
  border-left: 1px solid rgba(244, 236, 216, 0.2);
  padding-left: 0.55rem;
  margin-left: 0.15rem;
}

@media (max-width: 680px) {
  .blog-article__cover .cover-live {
    top: 0.6rem;
    left: 0.6rem;
    padding: 0.3rem 0.6rem 0.3rem 0.5rem;
    font-size: 0.55rem;
  }
}

/* Slightly stronger shimmer on hover (existing) needs to sit ABOVE the canvas. */
.blog-card__visual::after,
.blog-article__cover::after {
  z-index: 4 !important;
}

.blog-card__visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 38%,
    rgba(74, 159, 255, 0.08) 44%,
    rgba(255, 255, 255, 0.06) 50%,
    rgba(74, 159, 255, 0.08) 56%,
    transparent 62%
  );
  background-size: 250% 100%;
  animation: cover-shimmer 6s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes cover-shimmer {
  0%, 100% { background-position: 200% center; }
  50%      { background-position: -50% center; }
}

.blog-card__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease), filter 0.7s var(--ease);
  will-change: transform;
}

.blog-card:hover .blog-card__visual img {
  transform: scale(1.08);
  filter: brightness(1.1) saturate(1.15);
}

.blog-card:hover .blog-card__visual::after {
  animation-duration: 2.5s;
}

.blog-card .pretext-motion {
  position: relative;
  height: 110px;
  border-radius: 14px;
  margin: 0;
  border: 1px solid var(--line);
  pointer-events: none;
  z-index: 0;
}

.blog-card .blog-card__motion.pretext-motion {
  position: relative;
  display: block;
  height: 168px;
  margin: 0;
  border: 1px solid rgba(74, 159, 255, 0.2);
  border-radius: 18px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition:
    opacity 0.75s var(--ease),
    transform 0.75s var(--ease),
    border-color 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
  background:
    radial-gradient(circle at 24% 18%, rgba(74,159,255,0.24), transparent 34%),
    radial-gradient(circle at 80% 82%, rgba(232,68,61,0.16), transparent 36%),
    linear-gradient(135deg, rgba(7, 19, 32, 0.9), rgba(12, 18, 34, 0.92));
  box-shadow: inset 0 1px 0 rgba(244,236,216,0.08);
  z-index: 1;
}

.blog-card.is-visible .blog-card__motion.pretext-motion,
.blog-card[data-reveal].is-visible .blog-card__motion.pretext-motion {
  opacity: 1;
  transform: none;
}

.blog-card:hover .blog-card__motion.pretext-motion,
.blog-card:focus-within .blog-card__motion.pretext-motion {
  border-color: rgba(74, 159, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(244,236,216,0.1),
    0 22px 55px rgba(0,0,0,0.28),
    0 0 42px rgba(74,159,255,0.12);
}

.blog-card .blog-card__motion.pretext-motion::before {
  opacity: 0.34;
}

.blog-card .blog-card__motion.pretext-motion::after {
  opacity: 0.28;
}

.blog-card--featured .blog-card__motion.pretext-motion {
  position: relative;
  inset: auto;
  height: auto;
  min-height: 100%;
  border: none;
  border-left: 1px solid rgba(244,236,216,0.08);
  border-radius: 0 28px 28px 0;
  opacity: 0;
  z-index: 1;
}

.blog-card--featured.is-visible .blog-card__motion.pretext-motion,
.blog-card--featured[data-reveal].is-visible .blog-card__motion.pretext-motion {
  opacity: 1;
}

.blog-card--featured .blog-card__motion.pretext-motion::before {
  opacity: 0.42;
}

.blog-card--featured .blog-card__motion.pretext-motion::after {
  opacity: 0.32;
}

.blog-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
  z-index: 2;
}

.blog-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  z-index: 2;
}

.blog-card__bottom {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font: 700 0.7rem var(--font-mono);
  color: var(--muted-2);
  z-index: 2;
}

.blog-card__arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--blue);
  font-weight: 800;
  transition: gap 0.3s var(--ease), transform 0.3s var(--ease);
}

.blog-card:hover .blog-card__arrow {
  gap: 0.7rem;
  transform: translateX(2px);
}

.blog-empty {
  grid-column: 1 / -1;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  text-align: center;
}

/* ── FEATURED COVER ENHANCEMENTS ──────────────────── */
.blog-card--featured .blog-card__visual::after {
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(74, 159, 255, 0.1) 42%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(74, 159, 255, 0.1) 58%,
    transparent 65%
  );
  background-size: 250% 100%;
  animation: cover-shimmer 7s ease-in-out infinite;
}

.blog-card--featured:hover .blog-card__visual::after {
  animation-duration: 3s;
}

.blog-card--featured .blog-card__visual img {
  transition: transform 0.9s var(--ease), filter 0.9s var(--ease);
}

.blog-card--featured:hover .blog-card__visual img {
  transform: scale(1.06);
  filter: brightness(1.08) saturate(1.12);
}

/* ── REVEAL ON SCROLL ──────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px) scale(0.98);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ── ARTICLE PAGE READABILITY & CREATIVE HERO ──────── */
.blog-article {
  width: min(var(--maxw), calc(100% - 3rem));
  margin: 0 auto;
  padding: 9rem 0 5rem;
}

.blog-article__hero {
  max-width: 980px;
  margin: 0 auto 2rem;
  text-align: center;
}

.blog-article__hero .section-label {
  justify-content: center;
  margin-bottom: 1.4rem;
}

.blog-article__hero .section-label::before { display: none; }

.blog-article__hero h1 {
  margin: 0 auto 1rem;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7.5vw, 6rem);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.blog-article__hero h1 em {
  color: var(--blue);
  font-style: italic;
}

.blog-article__dek {
  max-width: 720px;
  margin: 0 auto 1.2rem;
  color: var(--ink-soft);
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.55;
}

.blog-article__stats {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.blog-article__hero .blog-reader__stats {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.4rem;
}

.blog-article__stats span,
.blog-reader__stats span {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font: 700 0.72rem var(--font-mono);
}

.blog-article__stats strong,
.blog-reader__stats strong {
  margin-right: 0.3rem;
  color: var(--ink);
  font-family: var(--font-mono);
}

.blog-article__pretext {
  display: none;
  max-width: 1040px;
  margin: 0 auto 1.5rem;
  height: clamp(180px, 28vw, 320px);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  opacity: 0.55;
  pointer-events: none;
  box-shadow: var(--shadow);
}

.blog-article__cover {
  max-width: 1040px;
  margin: 0 auto;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #071320;
}

.blog-article__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-article__layout {
  display: grid;
  grid-template-columns: minmax(0, 720px) minmax(240px, 0.38fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
  margin-top: 3rem;
}

@media (max-width: 1000px) {
  .blog-article__layout {
    grid-template-columns: 1fr;
  }
}

/* ── ARTICLE ASIDE ─────────────────────────────────── */
.blog-article__aside {
  position: sticky;
  top: 6.5rem;
  display: grid;
  gap: 1.2rem;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: var(--shadow);
  align-self: start;
}

@media (max-width: 1000px) {
  .blog-article__aside {
    position: relative;
    top: 0;
    order: -1;
  }
}

.blog-article__aside-label {
  font: 800 0.65rem var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.blog-article__aside strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--ink);
}

.blog-article__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.blog-article__tags span,
.blog-reader__tags span {
  padding: 0.25rem 0.6rem;
  border: 1px solid rgba(74, 159, 255, 0.25);
  border-radius: 999px;
  background: rgba(74, 159, 255, 0.1);
  color: var(--blue);
  font: 700 0.68rem var(--font-mono);
}

.blog-article__toc {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.blog-article__toc h4 {
  font: 800 0.65rem var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 0.8rem;
}

.blog-article__toc ul {
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.blog-article__toc a {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
  border-left: 2px solid var(--line);
  padding-left: 0.75rem;
  transition: color 0.25s, border-color 0.25s, padding-left 0.25s;
}

.blog-article__toc a:hover,
.blog-article__toc a.is-active {
  color: var(--blue);
  border-color: var(--blue);
  padding-left: 1rem;
}

.blog-article__back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--blue);
  font-weight: 700;
  font-size: 0.9rem;
  border-bottom: 1.5px solid var(--blue-soft);
  transition: border-color 0.25s, gap 0.25s;
}

.blog-article__back:hover {
  border-color: var(--blue);
  gap: 0.6rem;
}

/* ── ARTICLE BODY (READABILITY & DESIGN) ───────────── */
.blog-article__layout .blog-flow {
  max-width: none;
  border-left: none;
  padding: 0;
}

.blog-flow {
  font-size: 1.08rem;
  line-height: 1.82;
  color: var(--ink-soft);
  counter-reset: blog-section;
}

.blog-flow > * {
  max-width: 680px;
}

/* ─ Drop Cap on first paragraph ─ */
.blog-flow > p:first-child::first-letter {
  float: left;
  font-family: var(--font-display);
  font-size: 3.8em;
  line-height: 0.8;
  padding-right: 0.12em;
  padding-top: 0.06em;
  color: var(--ink);
  font-weight: 400;
}

/* ─ First paragraph emphasis ─ */
.blog-flow > p:first-child {
  font-size: 1.18rem;
  line-height: 1.7;
  color: var(--ink);
}

/* ─ Section headings with accent bar + counter ─ */
.blog-flow h2 {
  position: relative;
  margin: 3.5rem 0 1rem;
  padding-top: 2rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.6vw, 2.4rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
  scroll-margin-top: 7rem;
  counter-increment: blog-section;
}

.blog-flow h2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--red));
  opacity: 0.7;
}

.blog-flow h2::after {
  content: "§" counter(blog-section);
  position: absolute;
  top: 0.25rem;
  left: 58px;
  font: 700 0.6rem var(--font-mono);
  letter-spacing: 0.08em;
  color: var(--muted-2);
  opacity: 0.5;
}

/* ─ Paragraphs ─ */
.blog-flow p {
  margin: 0 0 1.4rem;
  transition: color 0.3s var(--ease);
}

/* Short one-liner paragraphs get emphasis treatment */
.blog-flow p:only-of-type,
.blog-flow > p + p:last-of-type {
  /* keep normal styling for general paragraphs */
}

/* ─ Lists with accent bullets ─ */
.blog-flow ul,
.blog-flow ol {
  margin: 0 0 1.6rem;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 0.65rem;
}

.blog-flow ul li,
.blog-flow ol li {
  position: relative;
  padding-left: 1.6rem;
}

.blog-flow ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--blue), rgba(74, 159, 255, 0.3));
  transform: rotate(45deg);
  transition: transform 0.3s var(--ease), background 0.3s;
}

.blog-flow ol {
  counter-reset: blog-ol;
}

.blog-flow ol li::before {
  content: counter(blog-ol);
  counter-increment: blog-ol;
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(74, 159, 255, 0.12);
  border: 1px solid rgba(74, 159, 255, 0.2);
  color: var(--blue);
  font: 700 0.65rem var(--font-mono);
}

/* ─ Blockquotes — editorial pull-quote style ─ */
.blog-flow blockquote {
  position: relative;
  max-width: 680px;
  margin: 2rem 0;
  padding: 1.6rem 1.6rem 1.6rem 2rem;
  border-left: none;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(232, 68, 61, 0.06), rgba(232, 162, 61, 0.04));
  border: 1px solid rgba(232, 68, 61, 0.15);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.38;
  font-style: italic;
}

.blog-flow blockquote::before {
  content: """;
  position: absolute;
  top: -0.1rem;
  left: 0.6rem;
  font-family: var(--font-display);
  font-size: 4rem;
  line-height: 1;
  color: var(--red);
  opacity: 0.35;
  pointer-events: none;
}

/* ─ Links ─ */
.blog-flow a {
  color: var(--blue);
  border-bottom: 1.5px solid rgba(74, 159, 255, 0.3);
  transition: border-color 0.25s, color 0.25s;
}

.blog-flow a:hover {
  border-color: var(--blue);
  color: #6ab2ff;
}

/* ─ Inline code ─ */
.blog-flow code {
  padding: 0.18rem 0.4rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.84em;
  transition: background 0.25s;
}

.blog-flow code:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ─ Section dividers (generated between h2 groups) ─ */
.blog-flow__divider {
  max-width: 680px;
  height: 1px;
  margin: 0.5rem 0 0;
  border: none;
  background: linear-gradient(90deg, transparent, var(--line), rgba(74, 159, 255, 0.2), var(--line), transparent);
}

/* ─ Reading progress footer ─ */
.blog-flow__end {
  max-width: 680px;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font: 700 0.72rem var(--font-mono);
  color: var(--muted-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.blog-flow__end-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green, #34d399);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.4);
  animation: end-pulse 2.5s ease-in-out infinite;
}

@keyframes end-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.3); }
}

/* ── FOCUS-LINE READING MARKER ─────────────────────
   Retired. The extra gutter rail was pulling attention
   away from the copy, so we keep the JS harmlessly in
   place but suppress the visual marker entirely. */
.blog-flow {
  position: relative;
}

.blog-flow__focus {
  display: none !important;
}

.blog-flow .is-focused {
  /* The block the reader is on gets a hair more weight. We never hide
     anything else — that was the played-out pattern we replaced. */
  color: var(--ink);
  transition: color 0.5s var(--ease);
}

.blog-flow p.is-focused,
.blog-flow ul.is-focused,
.blog-flow ol.is-focused {
  color: var(--ink);
}

.blog-flow h2.is-focused::before {
  width: 64px;
  opacity: 1;
}

@media (max-width: 1000px) {
  .blog-flow__focus { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .blog-flow__focus { display: none !important; }
}

/* ── READING PROGRESS LABEL ───────────────────────── */
.back-to-top__progress {
  display: block;
  font: 700 0.55rem var(--font-mono);
  letter-spacing: 0.05em;
  margin-top: 1px;
  opacity: 0.7;
}

/* ── DROP CAP + DIVIDER MOBILE TWEAKS ─────────────── */
@media (max-width: 680px) {
  .blog-flow > p:first-child::first-letter {
    font-size: 3em;
    padding-right: 0.08em;
  }
  .blog-flow > p:first-child {
    font-size: 1.05rem;
  }
  .blog-flow h2 {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    font-size: 1.45rem;
  }
  .blog-flow h2::before {
    width: 36px;
    height: 2px;
  }
  .blog-flow h2::after {
    left: 44px;
    font-size: 0.55rem;
  }
  .blog-flow blockquote {
    padding: 1.2rem;
    font-size: 1.15rem;
    border-radius: 12px;
  }
  .blog-flow blockquote::before {
    font-size: 3rem;
    top: -0.2rem;
    left: 0.4rem;
  }
  .blog-flow__end {
    font-size: 0.62rem;
    gap: 0.6rem;
  }
}

@media (max-width: 400px) {
  .blog-flow > p:first-child::first-letter {
    font-size: 2.5em;
  }
  .blog-flow h2 { font-size: 1.3rem; padding-top: 1.2rem; }
  .blog-flow h2::before { width: 28px; }
  .blog-flow blockquote { font-size: 1.05rem; padding: 1rem; }
}

/* ── RESPONSIVE ────────────────────────────────────── */
@media (max-width: 900px) {
  .blog-toolbar {
    top: 4.8rem;
    border-radius: 24px;
  }

  .blog-grid--creative {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
}

@media (max-width: 680px) {
  .blog-index { padding: 7rem 0 3rem; }
  .blog-index__head { margin-bottom: 1.8rem; }
  .blog-index__head .display-h2 { font-size: clamp(1.8rem, 8vw, 2.6rem); }
  .blog-index__head .section-sub { font-size: 0.95rem; padding: 0 0.5rem; }

  .blog-toolbar {
    top: 4rem;
    border-radius: 16px;
    padding: 0.6rem 0.7rem;
    gap: 0.5rem 0.6rem;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
  }

  .blog-toolbar .blog-search { flex: 1 1 100%; min-width: 0; }
  .blog-toolbar .blog-search input {
    padding: 0.6rem 0.9rem;
    font-size: 0.88rem;
  }

  .blog-topics { gap: 0.35rem; justify-content: flex-start; }
  .blog-topic {
    min-height: 30px;
    padding: 0.3rem 0.6rem;
    font-size: 0.62rem;
  }

  .blog-featured { margin-bottom: 1.4rem; }
  .blog-grid--creative {
    grid-template-columns: 1fr;
    gap: 0.9rem;
    padding: 0 0.25rem;
  }

  .blog-card { border-radius: 18px; }
  .blog-card .blog-card__link {
    min-height: 0;
    padding: 0.9rem;
    gap: 0.6rem;
  }
  .blog-card__visual { height: 150px; border-radius: 12px; }
  .blog-card .blog-card__motion.pretext-motion {
    height: 154px;
    border-radius: 14px;
  }
  .blog-card h3 { font-size: 1.3rem; }
  .blog-card p { font-size: 0.9rem; }

  .blog-card--featured { border-radius: 20px; }
  .blog-card--featured .blog-card__link { grid-template-columns: 1fr; min-height: 0; }
  .blog-card--featured .blog-card__visual {
    order: -1;
    height: 200px;
    min-height: 0;
    border-radius: 20px 20px 0 0;
  }
  .blog-card--featured .blog-card__motion.pretext-motion {
    min-height: 190px;
    border-radius: 20px 20px 0 0;
  }
  .blog-card--featured .blog-card__content { padding: 1.2rem; gap: 0.6rem; }
  .blog-card--featured h3 { font-size: 1.5rem; }
  .blog-card--featured::before {
    top: 0.8rem;
    left: 0.8rem;
    font-size: 0.58rem;
    padding: 0.3rem 0.55rem;
  }

  .blog-article { padding: 7rem 0 3rem; width: min(var(--maxw), calc(100% - 1.5rem)); }
  .blog-article__hero h1 { font-size: clamp(2rem, 9vw, 3rem); }
  .blog-article__dek { font-size: 1.05rem; }
  .blog-article__pretext { height: 140px; border-radius: 16px; }
  .blog-article__cover { border-radius: 16px; }

  .blog-flow { font-size: 1rem; line-height: 1.75; }
  .blog-flow h2 { font-size: 1.45rem; margin-top: 2rem; }
  .blog-flow blockquote { font-size: 1.2rem; padding: 0.8rem 0 0.8rem 0.9rem; }

  .blog-article__aside { padding: 1rem; gap: 1rem; }
  .blog-article__aside-label { font-size: 0.6rem; }
  .blog-article__aside strong { font-size: 1.3rem; }

  .blog-related__grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .blog-related__card { padding: 1rem; }
  .blog-related__card h4 { font-size: 1.1rem; }
}

/* ── EXTRA SMALL SCREENS (≤400px) ─────────────────── */
@media (max-width: 400px) {
  .blog-index { padding: 6rem 0 2.5rem; }
  .blog-index__head .display-h2 { font-size: 1.65rem; }
  .blog-index__head .section-sub { font-size: 0.88rem; line-height: 1.6; }

  .blog-toolbar {
    top: 3.6rem;
    padding: 0.5rem;
    border-radius: 14px;
    margin-left: 0.35rem;
    margin-right: 0.35rem;
  }
  .blog-topic { font-size: 0.58rem; padding: 0.25rem 0.5rem; min-height: 26px; }

  .blog-card .blog-card__link { padding: 0.75rem; }
  .blog-card__visual { height: 130px; }
  .blog-card .blog-card__motion.pretext-motion { height: 132px; }
  .blog-card--featured .blog-card__motion.pretext-motion { min-height: 165px; }
  .blog-card h3 { font-size: 1.15rem; }
  .blog-card p { font-size: 0.85rem; }
  .blog-card__bottom { font-size: 0.6rem; }

  .blog-article { width: calc(100% - 1rem); }
  .blog-article__hero h1 { font-size: 1.8rem; }
  .blog-article__stats span,
  .blog-reader__stats span { font-size: 0.62rem; padding: 0.3rem 0.6rem; }

  .blog-flow { font-size: 0.95rem; line-height: 1.72; }
  .blog-flow h2 { font-size: 1.3rem; }
  .blog-flow blockquote { font-size: 1.1rem; }
}

/* ── SAFE AREA SUPPORT (iPhone notch etc.) ────────── */
@supports (padding: env(safe-area-inset-bottom)) {
  .blog-page .site-footer .footer-bottom {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }
  .back-to-top {
    bottom: calc(1.5rem + env(safe-area-inset-bottom));
  }
  @media (max-width: 680px) {
    .back-to-top {
      bottom: calc(1rem + env(safe-area-inset-bottom));
    }
  }
}

/* ── TOUCH DEVICE OPTIMIZATIONS ───────────────────── */
@media (pointer: coarse) {
  .blog-card__link { min-height: 0; }
  .blog-card .blog-card__link { -webkit-tap-highlight-color: transparent; }
  .blog-card:active { transform: scale(0.985); }
  .blog-card--featured:active { transform: scale(0.99); }
  .blog-topic:active { transform: scale(0.95); }
  .blog-related__card:active { transform: scale(0.98); }
  .blog-article__copy:active { transform: scale(0.95); }
}

/* Ensure the article pretext canvas fills its wrapper */
.blog-article__pretext .pretext-motion {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
  margin: 0;
}

/* ── FEATURED CARD BADGE & NO-COVER FALLBACK ─────── */
.blog-card--featured::before {
  content: "Latest";
  position: absolute;
  top: 1.2rem;
  left: 1.2rem;
  z-index: 3;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font: 800 0.65rem var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 8px 18px rgba(74, 159, 255, 0.35);
  pointer-events: none;
}

.blog-card--featured--no-cover .blog-card__link {
  grid-template-columns: 1fr;
}

.blog-card--featured--no-cover .blog-card__content {
  grid-column: 1 / -1;
}

.blog-card--featured--no-cover .blog-card__visual {
  display: none;
}

/* ── ARTICLE COPY LINK & BACK-TO-TOP ─────────────── */
.blog-article__copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font: 700 0.75rem var(--font-mono);
  cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.blog-article__copy:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(74, 159, 255, 0.1);
}

.blog-article__copy.is-copied {
  background: var(--green);
  border-color: var(--green);
  color: #0a0e1a;
}

.back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 100;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(17, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  cursor: pointer;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  border-color: var(--blue);
  background: rgba(74, 159, 255, 0.15);
  color: var(--blue);
}

@media (pointer: coarse) {
  .back-to-top {
    right: 1rem;
    bottom: 1rem;
    width: 44px;
    height: 44px;
  }
}

/* ── RELATED POSTS ─────────────────────────────────── */
.blog-related {
  max-width: 720px;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.blog-related h3 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 1.2rem;
}

.blog-related__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.blog-related__card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), background 0.3s, box-shadow 0.3s;
}

.blog-related__card:hover {
  border-color: rgba(74, 159, 255, 0.4);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(74, 159, 255, 0.08);
}

.blog-related__cover {
  display: block;
  height: 110px;
  overflow: hidden;
  background: #071320;
}

.blog-related__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.blog-related__card:hover .blog-related__cover img {
  transform: scale(1.06);
}

.blog-related__meta {
  font: 800 0.62rem var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  padding: 0.8rem 1rem 0;
}

.blog-related__card h4 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
  padding: 0 1rem;
}

.blog-related__card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  padding: 0 1rem 1rem;
}

/* ── EXTRA RESPONSIVE REFINEMENTS ──────────────────── */
@media (max-width: 680px) {
  .blog-toolbar {
    border-radius: 16px;
    padding: 0.6rem 0.7rem;
    top: 4rem;
  }

  .blog-topics {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    padding-bottom: 0.15rem;
  }
  .blog-topics::-webkit-scrollbar { display: none; }

  .blog-card--featured .blog-card__content {
    padding: 1.2rem;
  }

  .blog-article__aside {
    padding: 1rem;
  }

  .blog-related__grid {
    grid-template-columns: 1fr;
  }
}

/* ── HERO GRADIENT ACCENT ──────────────────────────── */
.blog-index__head .display-h2 em {
  background: linear-gradient(180deg, #6ab2ff 0%, #2a6fdf 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: normal;
}

/* ── LANDSCAPE PHONE TWEAKS ───────────────────────── */
@media (max-height: 500px) and (orientation: landscape) {
  .blog-index { padding-top: 5.5rem; }
  .blog-card--featured .blog-card__link { min-height: 280px; }
  .blog-card--featured .blog-card__visual { height: 200px; }
  .blog-article { padding-top: 5.5rem; }
}

/* ════════════════════════════════════════════════════
 * Pretext-driven creative typography (rewrite)
 * ════════════════════════════════════════════════════ */

/* ── Kinetic split-text headline ─────────────────── */
.kinetic-headline {
  /* Pretext gives us per-line breaks at the user's actual viewport;
     we use that purely to stagger which words enter first, but we
     let the browser wrap naturally so resizing never breaks the
     layout. */
  display: block;
  perspective: 900px;
  will-change: transform;
}

.kinetic-headline .kinetic-word {
  /* Each word is its own little stage. overflow:hidden on the word
     hides the rising inner span until it reaches the baseline — the
     "metal type being set" effect. */
  display: inline-block;
  position: relative;
  margin-right: 0.04em;
  vertical-align: baseline;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
  transform-style: preserve-3d;
  transform:
    translate3d(var(--mx, 0), var(--my, 0), var(--mz, 0));
  transition:
    transform 0.55s cubic-bezier(0.18, 0.65, 0.21, 1),
    color 0.4s var(--ease);
  will-change: transform;
}

.kinetic-headline .kinetic-word__inner {
  display: inline-block;
  transform: translateY(110%) rotateX(-32deg);
  opacity: 0;
  transition:
    transform 0.85s cubic-bezier(0.18, 0.65, 0.21, 1),
    opacity 0.85s cubic-bezier(0.18, 0.65, 0.21, 1);
  transition-delay: var(--kd, 0s);
  transform-origin: 0 100%;
  will-change: transform, opacity;
}

.kinetic-headline.is-set .kinetic-word__inner {
  transform: translateY(0) rotateX(0);
  opacity: 1;
}

.kinetic-headline .kinetic-word--em .kinetic-word__inner {
  color: var(--blue);
  font-style: italic;
}

/* Caret-like underline that draws beneath the last word once
   the whole headline is set. Pure CSS, very subtle. */
.kinetic-headline::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin-top: 0.6rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--red));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1.1s var(--ease) 0.9s, opacity 0.5s;
  opacity: 0.6;
}

.kinetic-headline.is-set::after {
  transform: scaleX(1);
}

@media (max-width: 680px) {
  .kinetic-headline::after {
    margin: 0.5rem auto 0;
    width: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kinetic-headline .kinetic-word__inner {
    transform: none;
    opacity: 1;
    transition: none;
  }
  .kinetic-headline .kinetic-word {
    transition: none;
  }
  .kinetic-headline::after { transform: scaleX(1); transition: none; }
}

/* ── Lede treatment for first paragraph ──────────── */
.blog-flow__lede {
  font: 800 0.85em var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background-image: linear-gradient(transparent 62%, rgba(74,159,255,0.18) 62%);
  padding: 0 0.18em;
  border-radius: 2px;
}

/* When a lede is present, neutralise the drop-cap so they don't fight.
   The lede itself becomes the editorial opening. */
.blog-flow > p:first-child:has(> .blog-flow__lede)::first-letter {
  float: none;
  font-size: inherit;
  font-family: inherit;
  line-height: inherit;
  padding: 0;
  color: inherit;
  font-weight: inherit;
}

/* ── Pretext-balanced pull-quotes ────────────────── */
.blog-flow__quote {
  position: relative;
}

/* When Pretext successfully balanced the quote, mark it. The
   side rule below uses the measured height to size itself. */
.blog-flow__quote[data-balanced="1"] {
  /* max-width is set inline by JS */
  margin-left: auto;
  margin-right: auto;
}

/* Side rule that runs alongside the quote text. Replaces the
   played-out underline-on-reveal. The height is set inline
   by JS from the Pretext measurement. */
.blog-flow__quote::after {
  content: "";
  position: absolute;
  left: -0.65rem;
  top: 50%;
  width: 3px;
  height: var(--quote-rule-h, 70%);
  max-height: calc(100% - 1rem);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--red), var(--blue));
  transform: translateY(-50%);
  opacity: 0.7;
}

@media (max-width: 680px) {
  .blog-flow__quote::after {
    left: -0.3rem;
    width: 2px;
  }
}

/* ── Scroll-fill dividers ────────────────────────── */
.blog-flow__divider--scroll {
  position: relative;
  overflow: visible;
}

.blog-flow__divider-fill {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg,
    transparent,
    rgba(74, 159, 255, 0.4),
    rgba(232, 68, 61, 0.35),
    transparent
  );
  transform: scaleX(calc(var(--scroll-fill, 0)));
  transform-origin: left center;
  transition: transform 0.3s linear;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .blog-flow__divider-fill { transform: scaleX(1); }
}

/* ════════════════════════════════════════════════════
 * Reading Spine — RETIRED
 * The constellation map in the aside replaces this.
 * Kept as a hard display:none to prevent any cached
 * JS from injecting it back into view.
 * ════════════════════════════════════════════════════ */
.blog-spine { display: none !important; }

/* ════════════════════════════════════════════════════
 * Section Kinetics — Pretext-powered h2 entrance
 * Each word of a section heading gets its own span so
 * it can slide in line-by-line as the reader arrives.
 * ════════════════════════════════════════════════════ */
.section-kinetic-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.section-kinetic-word__inner {
  display: inline-block;
  opacity: 0;
  transform: translateY(80%) skewX(-4deg);
  transition: opacity 0.42s var(--ease, cubic-bezier(0.4,0,0.2,1)),
              transform 0.42s var(--ease, cubic-bezier(0.4,0,0.2,1));
  transition-delay: var(--skd, 0s);
  will-change: opacity, transform;
}

.section-kinetic-word.is-set .section-kinetic-word__inner {
  opacity: 1;
  transform: translateY(0) skewX(0deg);
}

@media (prefers-reduced-motion: reduce) {
  .section-kinetic-word__inner {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ════════════════════════════════════════════════════
 * Progress Density Bar — Pretext-driven colouring
 * When JS paints the density gradient onto the bar,
 * we suppress the single-colour glow and let the
 * multi-hue gradient speak for itself.
 * ════════════════════════════════════════════════════ */
.scroll-progress.has-density {
  box-shadow: none;
  height: 4px; /* one pixel taller so the density colours are legible */
}

/* ════════════════════════════════════════════════════
 * Mobile-first refinements (final layer)
 * ════════════════════════════════════════════════════ */

/* Tap optimization across all interactive surfaces */
.blog-page a,
.blog-page button,
.blog-article-page a,
.blog-article-page button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Smoother momentum scrolling on iOS */
.blog-page,
.blog-article-page {
  -webkit-overflow-scrolling: touch;
}

/* iOS Safari fix: keep the toolbar above content but below nav */
@supports (-webkit-touch-callout: none) {
  .blog-toolbar { backdrop-filter: blur(20px) saturate(160%); }
}

/* Article hero – better safe-area top padding on notched devices */
@supports (padding: max(0px)) {
  .blog-page .blog-index { padding-top: max(9rem, env(safe-area-inset-top) + 7rem); }
  .blog-article-page .blog-article { padding-top: max(9rem, env(safe-area-inset-top) + 7rem); }
}

/* Mid-tablet width fix - cards switch to single column gracefully */
@media (min-width: 681px) and (max-width: 820px) {
  .blog-grid--creative {
    grid-template-columns: 1fr;
    max-width: 540px;
  }
  .blog-card { min-height: 260px; }
}

/* Make sure feature pull-quote does not break narrow screens */
@media (max-width: 1099px) {
  .blog-flow__quote--feature {
    margin: 2rem 0;
    font-size: 1.4rem;
  }
}

/* Mobile feature-quote: cancel any large gutter offset */
@media (max-width: 680px) {
  .blog-flow__quote--feature {
    margin: 1.5rem 0 !important;
    font-size: 1.15rem !important;
    padding: 1rem 1.2rem !important;
  }

  .blog-flow__divider {
    margin: 1.5rem 0;
  }

  /* Larger tap target for TOC links on mobile */
  .blog-article__toc a {
    padding: 0.55rem 0 0.55rem 0.85rem;
    font-size: 0.92rem;
  }

  /* Make article hero stats tighter and centered */
  .blog-article__hero .blog-reader__stats {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    margin-bottom: 1.2rem;
  }

  /* Make the hero pretext motion shorter so the cover (the “header video”
     for this article) breathes on small screens */
  .blog-article__pretext {
    height: 110px;
    margin-bottom: 1rem;
  }

  /* Tighter back-to-top and 44px min target */
  .back-to-top {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 400px) {
  .blog-article__pretext { height: 90px; }
  .blog-article__hero h1 {
    line-height: 0.96;
    letter-spacing: -0.025em;
  }
  .blog-card--featured::before {
    top: 0.6rem;
    left: 0.6rem;
    font-size: 0.54rem;
    padding: 0.22rem 0.45rem;
  }
}

/* Two-finger swipe for horizontal topic filter on mobile */
.blog-topics::after {
  content: "";
  position: sticky;
  right: 0;
  width: 24px;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(10, 14, 26, 0.85));
}

@media (min-width: 681px) {
  .blog-topics::after { display: none; }
}

/* Subtle press-down feedback on every tappable card */
@media (hover: none) and (pointer: coarse) {
  .blog-card:active .blog-card__visual img,
  .blog-card--featured:active .blog-card__visual img {
    transform: scale(1.04);
  }
  .blog-card__arrow {
    gap: 0.55rem;
  }
}

/* Avoid heavy canvas painting on extremely small screens for perf */
@media (max-width: 400px) {
  .blog-card__visual .cover-scene { opacity: 0.78; }
}
