/* ==========================================================================
   Hiperfijaciones: the blog as a record crate. Every cover is a sleeve with
   a vinyl behind it that slides out and spins; the index opens on a wine and
   lava hero like the portfolio's. Type follows the portfolio: the display
   serif for titles, mono for labels and data, Montserrat to read.
   Each article brings its colours (--tint, --ink, --deep) on <body>.
   ========================================================================== */
.blog-page {
  --blog-display: "DM Serif Display", Georgia, serif;
  --blog-italic: "Cormorant Garamond", Georgia, serif;
  --blog-mono: "JetBrains Mono", ui-monospace, monospace;
  --blog-font: Montserrat, Arial, sans-serif;
  --blog-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --lava: linear-gradient(115deg, #3b0227 0%, #5b0638 24%, #8b164f 48%, #b12b63 70%, #4e0433 100%);
  background: #fffdf9;
}

.blog-page .site-bg {
  background: #fffdf9;
}

.blog-page main {
  font-family: var(--blog-font);
}

/* --- The record: sleeve in front, vinyl behind ------------------------------ */
.record__deck {
  position: relative;
  display: block;
  width: 80%;
  aspect-ratio: 4 / 5;
}

.record__sleeve {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  border-radius: 4px;
  background: color-mix(in srgb, var(--tint) 70%, #fff);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.25),
    0 30px 44px -26px rgba(30, 6, 18, 0.7);
  rotate: var(--tilt, 0deg);
  transition: rotate 700ms var(--blog-ease), translate 700ms var(--blog-ease);
}

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

.record__vinyl {
  position: absolute;
  top: 50%;
  left: 6%;
  z-index: 1;
  width: 90%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 31%, #0d0a0b 31.5% 33%, transparent 33.5%),
    radial-gradient(circle, rgba(255, 255, 255, 0.07) 0 60%, transparent 61%),
    repeating-radial-gradient(circle, #151012 0 1.4px, #241b20 1.4px 2.8px);
  box-shadow: 0 20px 34px -18px rgba(0, 0, 0, 0.65);
  translate: 12% -50%;
  transition: translate 800ms var(--blog-ease);
  animation: record-spin 3.2s linear infinite paused;
}

/* A sheen that stays put while the record turns underneath. */
.record__vinyl::after {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 30deg, transparent 0 18%, rgba(255, 255, 255, 0.12) 24%, transparent 30% 68%, rgba(255, 255, 255, 0.08) 74%, transparent 80%);
  content: "";
}

.record__label {
  position: absolute;
  inset: 33%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--tint);
  font: 600 clamp(9px, 0.8vw, 12px) var(--blog-mono);
  letter-spacing: 0.08em;
}

.record__label::after {
  position: absolute;
  width: 9%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fffdf9;
  content: "";
}

@keyframes record-spin {
  to { rotate: 360deg; }
}

/* --- Records in the crate ---------------------------------------------------- */
.record {
  display: grid;
  align-content: start;
  gap: 10px;
  color: #171215;
  text-decoration: none;
}

.record .record__deck {
  margin-bottom: 14px;
}

.record:hover .record__sleeve,
.record:focus-visible .record__sleeve {
  rotate: 0deg;
  translate: 0 -6px;
}

.record:hover .record__vinyl,
.record:focus-visible .record__vinyl {
  translate: 42% -50%;
  animation-play-state: running;
}

.record:focus-visible {
  outline: none;
}

.record:focus-visible .record__sleeve {
  box-shadow: 0 0 0 3px #fffdf9, 0 0 0 5px var(--ink), 0 30px 44px -26px rgba(30, 6, 18, 0.7);
}

.record__kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--ink);
  font: 600 10.5px var(--blog-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.record__kicker span + span::before {
  margin-right: 12px;
  content: "✦";
}

.record__title {
  margin: 0;
  font: 400 clamp(23px, 2vw, 30px) / 1.08 var(--blog-display);
  letter-spacing: -0.01em;
  text-wrap: balance;
  transition: color 300ms ease;
}

.record:hover .record__title {
  color: var(--ink);
}

.record__song {
  display: flex;
  gap: 8px;
  color: rgba(23, 18, 21, 0.62);
  font: 500 13px / 1.4 var(--blog-font);
}

.record__song i {
  color: var(--ink);
  font-style: normal;
}

.record.is-filtered-out {
  display: none;
}

/* --- Index hero: wine and lava, the latest record playing ------------------- */
.crate-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(30px, 5vw, 90px);
  min-height: min(100svh, 880px);
  padding: clamp(150px, 13vw, 200px) clamp(20px, 5vw, 80px) clamp(120px, 11vw, 170px);
  overflow: hidden;
  background: #2a0418;
  color: #fffdf8;
  /* The bottom edge is cut on the same slant as the tape (2°), so the tape
     covers it completely and no straight edge peeks out underneath. */
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 3.5vw), 0 100%);
}

.crate-hero::before {
  position: absolute;
  inset: -18%;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 22%, rgba(177, 43, 99, 0.85) 0 10%, transparent 30%),
    radial-gradient(circle at 78% 24%, rgba(216, 95, 63, 0.55) 0 8%, transparent 28%),
    radial-gradient(circle at 42% 78%, rgba(139, 22, 79, 0.9) 0 14%, transparent 34%),
    radial-gradient(circle at 88% 80%, rgba(91, 6, 56, 0.9) 0 12%, transparent 30%),
    linear-gradient(115deg, #3b0227 0%, #5b0638 30%, #8b164f 55%, #4e0433 100%);
  background-size: 140% 140%, 150% 150%, 130% 130%, 145% 145%, 260% 260%;
  content: "";
  filter: blur(14px) saturate(1.1);
  animation: hero-lava-flow 9s ease-in-out infinite alternate;
}

.crate-hero__crop {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 0 solid rgba(255, 253, 248, 0.5);
}

.crate-hero__crop--tl { top: 92px; left: clamp(16px, 3vw, 40px); border-top-width: 1px; border-left-width: 1px; }
.crate-hero__crop--tr { top: 92px; right: clamp(16px, 3vw, 40px); border-top-width: 1px; border-right-width: 1px; }
.crate-hero__crop--bl { bottom: 100px; left: clamp(16px, 3vw, 40px); border-bottom-width: 1px; border-left-width: 1px; }
.crate-hero__crop--br { right: clamp(16px, 3vw, 40px); bottom: 100px; border-right-width: 1px; border-bottom-width: 1px; }

.crate-hero__meta {
  position: absolute;
  top: 104px;
  margin: 0;
  color: rgba(255, 253, 248, 0.72);
  font: 600 11px var(--blog-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.crate-hero__meta--left { left: clamp(48px, 5vw, 80px); }
.crate-hero__meta--right { right: clamp(48px, 5vw, 80px); }

.crate-hero__kicker {
  margin: 0 0 18px;
  color: #ffb6cf;
  font: 600 12px var(--blog-mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.crate-hero__title {
  margin: 0 0 26px;
  font: 400 clamp(62px, 9.6vw, 164px) / 0.86 var(--blog-display);
  letter-spacing: -0.035em;
}

.crate-hero__title em {
  display: block;
  padding-left: 0.4em;
  color: #ffb6cf;
  font: italic 500 1.12em / 0.85 var(--blog-italic);
  letter-spacing: -0.02em;
}

.crate-hero__dek {
  max-width: 38ch;
  margin: 0;
  color: rgba(255, 253, 248, 0.84);
  font: 300 clamp(17px, 1.4vw, 21px) / 1.6 var(--blog-font);
}

.crate-hero__feature {
  display: grid;
  justify-items: center;
  gap: 14px;
  color: inherit;
  text-align: center;
  text-decoration: none;
}

.crate-hero__feature .record__deck {
  width: min(78%, 380px);
  margin: 0 12% 16px 0;
}

/* The featured record is playing: its vinyl is out and turning. */
.crate-hero__feature .record__vinyl,
.post-hero__record .record__vinyl {
  translate: 34% -50%;
  animation-play-state: running;
}

.crate-hero__feature:hover .record__sleeve {
  rotate: 0deg;
  translate: 0 -6px;
}

.crate-hero__feature:hover .record__vinyl {
  translate: 46% -50%;
}

.crate-hero__now {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 4px 8px;
  padding: 9px 16px;
  border: 1px solid rgba(255, 253, 248, 0.22);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.08);
  font: 500 13px var(--blog-font);
  backdrop-filter: blur(10px);
}

.crate-hero__now small {
  color: #ffb6cf;
  font: 600 9.5px var(--blog-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.crate-hero__now b {
  font-weight: 700;
}

.crate-hero__feature-title {
  display: grid;
  gap: 6px;
  max-width: 24ch;
  font: 400 clamp(22px, 2vw, 30px) / 1.1 var(--blog-display);
  text-wrap: balance;
}

.crate-hero__feature-title span {
  color: rgba(255, 253, 248, 0.6);
  font: 600 10.5px var(--blog-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.crate-hero__read {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  background: #fffdf8;
  color: #4e0433;
  font: 600 14px var(--blog-font);
  transition: box-shadow 300ms ease;
}

.crate-hero__read span {
  transition: translate 300ms var(--blog-ease);
}

.crate-hero__feature:hover .crate-hero__read {
  box-shadow: 0 16px 30px -14px rgba(0, 0, 0, 0.6);
}

.crate-hero__feature:hover .crate-hero__read span {
  translate: 5px 0;
}

/* --- The tape: every soundtrack, scrolling across the seam ------------------ */
.crate-tape {
  --tape-half: clamp(25px, 2.5vw, 37px);
  position: relative;
  z-index: 3;
  margin: calc(-1.75vw - var(--tape-half)) -3% 0;
  padding: clamp(12px, 1.3vw, 18px) 0;
  overflow: hidden;
  background: var(--lava);
  background-size: 260% 260%;
  box-shadow: 0 24px 40px -24px rgba(40, 6, 26, 0.8);
  rotate: -2deg;
  animation: lava-flow 4.2s ease-in-out infinite alternate;
}

.crate-tape p {
  display: flex;
  align-items: center;
  gap: 22px;
  width: max-content;
  margin: 0;
  animation: crate-tape-scroll 60s linear infinite;
}

.crate-tape span {
  color: #fffdf8;
  font: 400 clamp(20px, 2.2vw, 32px) var(--blog-display);
  white-space: nowrap;
}

.crate-tape em {
  color: #ffb6cf;
  font: 600 clamp(10px, 0.9vw, 12px) var(--blog-mono);
  font-style: normal;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.crate-tape i {
  color: #ffb6cf;
  font-style: normal;
}

@keyframes crate-tape-scroll {
  to { transform: translateX(-50%); }
}

/* --- The crate ---------------------------------------------------------------- */
.crate {
  width: min(100%, 1320px);
  margin: 0 auto;
  padding: clamp(80px, 9vw, 140px) clamp(20px, 4vw, 56px) clamp(70px, 8vw, 120px);
}

.crate__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 22px 30px;
  margin-bottom: clamp(44px, 6vw, 80px);
}

.crate__title {
  display: flex;
  align-items: flex-start;
  gap: 0.15em;
  margin: 0;
  color: #171215;
  font: 400 clamp(52px, 7.4vw, 116px) / 0.85 var(--blog-display);
  letter-spacing: -0.035em;
}

.crate__title sup {
  margin-top: 0.4em;
  color: #8b164f;
  font: 600 clamp(11px, 1vw, 14px) var(--blog-mono);
  letter-spacing: 0.12em;
}

/* Filters: the divider strip of a record crate. One line between two fine
   rules, each column with how many records it holds; the one playing gets a
   spinning mini vinyl and a lava underline. On phones the strip slides. */
.crate__filters {
  display: flex;
  flex-basis: 100%;
  overflow-x: auto;
  border-top: 1px solid rgba(23, 18, 21, 0.14);
  border-bottom: 1px solid rgba(23, 18, 21, 0.14);
  scrollbar-width: none;
}

.crate__filters::-webkit-scrollbar {
  display: none;
}

.crate__filters button {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 17px clamp(16px, 1.8vw, 26px);
  border: 0;
  border-right: 1px solid rgba(23, 18, 21, 0.1);
  background: none;
  color: rgba(23, 18, 21, 0.58);
  font: 600 14px var(--blog-font);
  white-space: nowrap;
  cursor: pointer;
  transition: color 250ms ease, background-color 250ms ease;
}

.crate__filters button:first-child {
  padding-left: 4px;
}

.crate__filters button:last-child {
  border-right: 0;
}

.crate__filters sup {
  align-self: flex-start;
  margin-top: 1px;
  color: #b12b63;
  font: 600 10px var(--blog-mono);
  letter-spacing: 0.06em;
}

.crate__filters button:hover {
  color: #171215;
}

/* The mini vinyl: hidden until its column is the one playing. */
.crate__filters button::before {
  width: 0;
  height: 16px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #b12b63 0 24%, #0d0a0b 25% 29%, transparent 30%),
    repeating-radial-gradient(circle, #151012 0 1px, #2a2025 1px 2px);
  content: "";
  opacity: 0;
  transition: width 350ms var(--blog-ease), opacity 250ms ease;
  animation: record-spin 2.4s linear infinite;
}

.crate__filters button::after {
  position: absolute;
  right: clamp(16px, 1.8vw, 26px);
  bottom: -1px;
  left: clamp(16px, 1.8vw, 26px);
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--lava);
  background-size: 260% 260%;
  content: "";
  scale: 0 1;
  transition: scale 450ms var(--blog-ease);
  animation: lava-flow 4.2s ease-in-out infinite alternate;
}

.crate__filters button:first-child::after {
  left: 4px;
}

.crate__filters button.is-active {
  color: #171215;
}

.crate__filters button.is-active::before {
  width: 16px;
  opacity: 1;
}

.crate__filters button.is-active::after {
  scale: 1 1;
}

.crate__filters button:focus-visible {
  outline: 2px solid #8b164f;
  outline-offset: -4px;
  border-radius: 6px;
}

/* Three columns that never line up: the middle one drops, the sleeves lean. */
.crate__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(50px, 6vw, 96px) clamp(26px, 4vw, 64px);
}

.crate__grid > .record:nth-child(3n + 2) {
  margin-top: clamp(40px, 6vw, 100px);
}

.crate__grid > .record:nth-child(3n) {
  margin-top: clamp(16px, 2.4vw, 40px);
}

/* --- Article hero: the article's colour, its record beside the title -------- */
.post-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: center;
  gap: clamp(30px, 5vw, 90px);
  width: min(100%, 1320px);
  margin: 0 auto;
  padding: clamp(140px, 13vw, 190px) clamp(20px, 4vw, 56px) clamp(70px, 8vw, 120px);
}

.post-hero::before {
  position: absolute;
  inset: 0 calc(50% - 50vw);
  z-index: -1;
  background:
    radial-gradient(ellipse 45% 60% at 78% 45%, rgba(255, 255, 255, 0.6), transparent 70%),
    var(--tint);
  content: "";
  -webkit-mask-image: linear-gradient(180deg, #000 74%, transparent);
  mask-image: linear-gradient(180deg, #000 74%, transparent);
}

.post-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
  color: rgba(23, 18, 21, 0.55);
  font: 600 10.5px var(--blog-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.post-crumbs a {
  color: inherit;
  text-decoration: none;
}

.post-crumbs a:hover {
  color: var(--ink);
}

.post-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0 0 18px;
  color: var(--ink);
  font: 600 11.5px var(--blog-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.post-kicker span + span::before {
  margin-right: 14px;
  content: "✦";
}

.post-title {
  margin: 0 0 22px;
  color: var(--deep);
  font: 400 clamp(44px, 6vw, 92px) / 0.96 var(--blog-display);
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.post-dek {
  max-width: 44ch;
  margin: 0 0 26px;
  color: #3a2e33;
  font: 300 clamp(17px, 1.5vw, 21px) / 1.55 var(--blog-font);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0 0 22px;
  color: rgba(23, 18, 21, 0.6);
  font: 600 10.5px var(--blog-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.post-meta a {
  color: var(--ink);
}

.post-song {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 7px 18px 7px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 24px -16px rgba(40, 10, 20, 0.5);
  font: 500 13.5px var(--blog-font);
}

.post-song small {
  display: block;
  color: var(--ink);
  font: 600 9.5px var(--blog-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.post-song__disc {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--ink) 0 22%, #111 23% 26%, transparent 27%),
    repeating-radial-gradient(circle, #1b1b1b 0 2px, #2b2b2b 2px 3px);
  animation: record-spin 4s linear infinite;
}

.post-hero__record {
  justify-self: center;
  width: min(100%, 440px);
  margin: 0;
}

.post-hero__record .record__deck {
  width: 78%;
}

/* --- Article body ------------------------------------------------------------ */
.post-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 720px) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px);
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: clamp(30px, 5vw, 70px) clamp(20px, 4vw, 56px) clamp(50px, 6vw, 90px);
}

.post-toc {
  position: sticky;
  top: 96px;
  align-self: start;
}

.post-toc__label,
.post-takeaways__label,
.post-related__label,
.post-cta__eyebrow {
  margin: 0 0 14px;
  color: var(--ink);
  font: 600 10.5px var(--blog-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.post-toc ol {
  display: grid;
  gap: 2px;
  margin: 0 0 24px;
  padding: 0;
  border-left: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
  list-style: none;
}

.post-toc a {
  display: flex;
  gap: 10px;
  margin-left: -1px;
  padding: 8px 0 8px 14px;
  border-left: 2px solid transparent;
  color: rgba(23, 18, 21, 0.62);
  font: 500 13px / 1.4 var(--blog-font);
  text-decoration: none;
  transition: color 200ms ease, border-color 200ms ease;
}

.post-toc a span {
  color: var(--ink);
  font: 600 11px / 1.6 var(--blog-mono);
}

.post-toc a:hover,
.post-toc a.is-current {
  border-left-color: var(--ink);
  color: #171215;
}

.post-toc__back {
  color: var(--ink);
  font: 600 13px var(--blog-font);
  text-decoration: none;
}

.post-body {
  color: #2a2226;
  font: 400 clamp(16.5px, 1.15vw, 18px) / 1.8 var(--blog-font);
}

.post-body > * {
  max-width: 720px;
}

.post-body p {
  margin: 0 0 1.2em;
}

.post-body .post-lede {
  color: #171215;
  font-size: 1.16em;
  font-weight: 300;
  line-height: 1.7;
}

.post-body .post-lede::first-letter {
  float: left;
  margin: 0.06em 0.12em 0 0;
  color: var(--ink);
  font: 400 4.6em / 0.78 var(--blog-display);
}

.post-body h2 {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 2em 0 0.7em;
  color: #171215;
  font: 400 clamp(30px, 3vw, 44px) / 1.05 var(--blog-display);
  letter-spacing: -0.015em;
  scroll-margin-top: 100px;
}

.post-body__count {
  flex: none;
  padding: 4px 9px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font: 600 10.5px var(--blog-mono);
  letter-spacing: 0.06em;
  transform: translateY(-0.5em);
}

.post-body strong {
  color: #171215;
  font-weight: 700;
}

.post-body a {
  color: var(--ink);
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.post-pull {
  position: relative;
  max-width: none !important;
  margin: 1.8em 0;
  padding: 0.4em 0 0 0;
}

.post-pull::before {
  display: block;
  height: 0.5em;
  color: var(--ink);
  content: "“";
  font: 400 5em / 0.8 var(--blog-display);
  opacity: 0.35;
}

.post-pull p {
  margin: 0;
  color: var(--ink);
  font: italic 500 clamp(32px, 3.2vw, 48px) / 1.12 var(--blog-italic);
  text-wrap: balance;
}

.post-note {
  margin: 1.4em 0;
  padding: 16px 18px;
  border-top: 2px solid var(--ink);
  background: color-mix(in srgb, var(--tint) 45%, #fff);
  color: #3a2e33;
  font: 400 14px / 1.65 var(--blog-font);
}

.post-note span {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font: 600 10px var(--blog-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.post-note p {
  margin: 0;
}

.post-list {
  margin: 0 0 1.3em;
  padding: 0;
  list-style: none;
  counter-reset: post-list;
}

.post-list li {
  position: relative;
  margin-bottom: 0.6em;
  padding-left: 1.7em;
}

.post-list li::before {
  position: absolute;
  top: 0.05em;
  left: 0.2em;
  color: var(--ink);
  content: "✦";
  font-size: 0.8em;
}

.post-list--numbered li {
  counter-increment: post-list;
  padding-left: 2.4em;
}

.post-list--numbered li::before {
  top: 0.15em;
  left: 0;
  display: grid;
  place-items: center;
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  background: var(--ink);
  color: var(--tint);
  content: counter(post-list);
  font: 600 0.68em var(--blog-mono);
}

.post-figure {
  max-width: none !important;
  margin: 2em 0;
}

.post-figure img {
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 30px 50px -30px rgba(40, 10, 20, 0.5);
}

.post-figure figcaption {
  margin-top: 10px;
  color: rgba(23, 18, 21, 0.6);
  font: 500 13px / 1.5 var(--blog-font);
}

/* Wide screens: notes move into the margin, quotes and figures break out. */
@media (min-width: 1400px) {
  .post-note {
    float: right;
    clear: right;
    width: 230px;
    margin: 0.3em -270px 1em 0;
    padding: 12px 0 0;
    background: none;
  }

  .post-pull {
    margin-right: -200px;
  }

  .post-figure {
    margin-right: -240px;
  }
}

/* --- Takeaways: a dark card in the article's deepest colour ------------------- */
.post-takeaways {
  width: min(calc(100% - 40px), 1040px);
  margin: 0 auto clamp(60px, 8vw, 110px);
  padding: clamp(30px, 4.5vw, 60px);
  border-radius: 28px;
  background: var(--deep);
  color: #fffdf8;
}

.post-takeaways .post-takeaways__label {
  color: color-mix(in srgb, var(--tint) 85%, #fff);
}

.post-takeaways h2 {
  margin: 0 0 28px;
  font: italic 500 clamp(38px, 4vw, 60px) / 1 var(--blog-italic);
}

.post-takeaways ol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: takeaway;
}

.post-takeaways li {
  counter-increment: takeaway;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 253, 248, 0.2);
  color: rgba(255, 253, 248, 0.86);
  font: 400 15.5px / 1.6 var(--blog-font);
}

.post-takeaways li::before {
  display: block;
  margin-bottom: 10px;
  color: var(--tint);
  content: "0" counter(takeaway);
  font: 400 44px / 1 var(--blog-display);
}

/* --- Call to action: the portfolio's lava -------------------------------------- */
.post-cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(80px, 9vw, 140px) clamp(20px, 4vw, 56px);
  background: #2a0418;
  color: #fffdf8;
  font-family: var(--blog-font);
  text-align: center;
}

.post-cta::before {
  position: absolute;
  inset: -20%;
  z-index: -1;
  background:
    radial-gradient(circle at 20% 25%, rgba(177, 43, 99, 0.8) 0 10%, transparent 32%),
    radial-gradient(circle at 80% 75%, rgba(216, 95, 63, 0.5) 0 8%, transparent 30%),
    linear-gradient(115deg, #3b0227 0%, #5b0638 30%, #8b164f 55%, #4e0433 100%);
  background-size: 140% 140%, 150% 150%, 260% 260%;
  content: "";
  filter: blur(12px);
  animation: footer-lava 14s ease-in-out infinite alternate;
}

.post-cta .post-cta__eyebrow {
  color: #ffb6cf;
}

.post-cta h2 {
  max-width: 18ch;
  margin: 0 auto 18px;
  font: 400 clamp(36px, 4.8vw, 72px) / 1 var(--blog-display);
  text-wrap: balance;
}

.post-cta > p:not(.post-cta__eyebrow) {
  max-width: 52ch;
  margin: 0 auto 30px;
  color: rgba(255, 253, 248, 0.82);
  font: 400 16px / 1.6 var(--blog-font);
}

.post-cta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* --- Keep reading ------------------------------------------------------------- */
.post-related {
  width: min(100%, 1320px);
  margin: 0 auto;
  padding: clamp(80px, 9vw, 130px) clamp(20px, 4vw, 56px) clamp(50px, 6vw, 90px);
}

.post-related h2 {
  margin: 0 0 clamp(40px, 5vw, 64px);
  color: #171215;
  font: 400 clamp(38px, 4.6vw, 70px) / 0.95 var(--blog-display);
  letter-spacing: -0.025em;
}

/* --- Smaller screens ------------------------------------------------------------ */
@media (max-width: 1000px) {
  .crate-hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-bottom: 140px;
  }

  .crate-hero__meta--right {
    display: none;
  }

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

  .crate__grid > .record:nth-child(n) {
    margin-top: 0;
  }

  .crate__grid > .record:nth-child(2n) {
    margin-top: clamp(30px, 6vw, 70px);
  }
}

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

  .post-hero__record {
    order: -1;
    width: min(80%, 340px);
  }

  .post-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-toc {
    position: static;
    padding: 18px 20px;
    border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
    border-radius: 16px;
  }
}

@media (max-width: 560px) {
  .crate-hero {
    padding-top: 130px;
  }

  .crate-hero__meta {
    top: 92px;
  }



  .crate__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 56px;
  }

  .crate__grid > .record:nth-child(n) {
    margin-top: 0;
  }

  .record .record__deck {
    width: 76%;
  }

  .post-hero {
    padding-top: 120px;
  }

  .post-body__count {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .crate-hero::before,
  .crate-tape,
  .crate-tape p,
  .crate__filters button::before,
  .crate__filters button::after,
  .record__vinyl,
  .post-song__disc,
  .post-cta::before {
    animation: none;
  }
}

/* --- More swing in the crate ------------------------------------------------- */
/* Each record sits on its own glow, with its number huge behind it in the
   article's colour. The vinyls always turn slowly and peek out; hovering
   pulls them out. The rows never line up. */
.record {
  position: relative;
  isolation: isolate;
}

.record::before {
  position: absolute;
  top: -6%;
  left: -10%;
  z-index: -2;
  width: 95%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--tint) 85%, transparent), transparent);
  content: "";
  opacity: 0.75;
  transition: opacity 500ms ease, scale 700ms var(--blog-ease);
}

.record:hover::before {
  opacity: 1;
  scale: 1.08;
}

.record__ghost {
  position: absolute;
  top: -0.32em;
  right: 2%;
  z-index: -1;
  color: color-mix(in srgb, var(--tint) 70%, var(--ink) 30%);
  font: italic 500 clamp(120px, 13vw, 210px) / 1 var(--blog-italic);
  letter-spacing: -0.04em;
  opacity: 0.55;
  pointer-events: none;
  transition: translate 800ms var(--blog-ease), opacity 400ms ease;
}

.record:hover .record__ghost {
  opacity: 0.85;
  translate: 0 -10px;
}

.record .record__vinyl {
  translate: 20% -50%;
  animation: record-spin 9s linear infinite;
}

.record:hover .record__vinyl,
.record:focus-visible .record__vinyl {
  translate: 46% -50%;
}

/* The rows sway: alternate records step sideways as well as down. */
.crate__grid > .record:nth-child(3n + 1) {
  translate: -2% 0;
}

.crate__grid > .record:nth-child(3n + 2) {
  translate: 3% 0;
}

.crate__grid > .record:nth-child(3n) {
  translate: 1% 0;
}

/* The soundtrack: a little equalizer that dances while you hover. */
.record__song {
  align-items: center;
}

.record__eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 13px;
}

.record__eq i {
  width: 3px;
  height: 40%;
  border-radius: 1px;
  background: var(--ink);
  animation: record-eq 900ms ease-in-out infinite alternate paused;
}

.record__eq i:nth-child(2) { height: 85%; animation-delay: -300ms; }
.record__eq i:nth-child(3) { height: 60%; animation-delay: -600ms; }
.record__eq i:nth-child(4) { height: 100%; animation-delay: -150ms; }

.record:hover .record__eq i,
.record:focus-visible .record__eq i {
  animation-play-state: running;
}

@keyframes record-eq {
  from { scale: 1 0.35; }
  to { scale: 1 1; }
}

.record__eq i {
  transform-origin: bottom;
}

/* Records drop into the crate one after another as you scroll. */
.record.reveal {
  opacity: 0;
  rotate: calc(var(--tilt, 0deg) * -2.5);
  transform: translateY(70px);
  transition: opacity 800ms ease, transform 1100ms var(--blog-ease), rotate 1100ms var(--blog-ease);
}

.record.reveal.is-in {
  opacity: 1;
  rotate: 0deg;
  transform: none;
}

.crate__grid > .record:nth-child(3n + 2).reveal { transition-delay: 90ms; }
.crate__grid > .record:nth-child(3n).reveal { transition-delay: 180ms; }

@media (max-width: 1000px) {
  .crate__grid > .record:nth-child(n) {
    translate: 0 0;
  }

  .crate__grid > .record:nth-child(2n).reveal {
    transition-delay: 90ms;
  }
}

@media (prefers-reduced-motion: reduce) {
  .record .record__vinyl,
  .record__eq i {
    animation: none;
  }

  .record.reveal {
    opacity: 1;
    rotate: 0deg;
    transform: none;
  }
}

/* Narrow screens: the strip fades at the right edge, a hint that it slides. */
@media (max-width: 1100px) {
  .crate__filters {
    -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent);
    mask-image: linear-gradient(90deg, #000 82%, transparent);
  }
}

/* The date each record came out. */
.record__date {
  margin-top: -4px;
  color: rgba(23, 18, 21, 0.5);
  font: 500 10.5px var(--blog-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* --- Research: tables ---------------------------------------------------------- */
.post-table {
  max-width: none !important;
  margin: 1.6em 0 1.8em;
  overflow-x: auto;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 25%, transparent);
}

.post-table table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font: 400 14px / 1.45 var(--blog-font);
}

.post-table th {
  padding: 12px 14px 10px;
  color: var(--ink);
  font: 600 10.5px var(--blog-mono);
  letter-spacing: 0.12em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.post-table td {
  padding: 11px 14px;
  border-top: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  color: #2a2226;
  vertical-align: top;
}

.post-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--tint) 35%, transparent);
}

.post-table td:first-child {
  color: #171215;
  font-weight: 600;
}

/* --- Research: authorship and rights ---------------------------------------------- */
.post-rights {
  width: min(calc(100% - 40px), 1040px);
  margin: 0 auto clamp(30px, 4vw, 48px);
  padding: clamp(26px, 3.6vw, 44px);
  border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent);
  border-radius: 28px;
  background:
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--tint) 45%, transparent) 0 2px, transparent 2px 14px),
    #fffdf9;
}

.post-rights__label,
.post-rights__cite-label {
  margin: 0 0 10px;
  color: var(--ink);
  font: 600 10.5px var(--blog-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.post-rights h2 {
  margin: 0 0 6px;
  color: var(--deep);
  font: 400 clamp(26px, 2.8vw, 38px) / 1.05 var(--blog-display);
}

.post-rights__meta {
  margin: 0 0 16px;
  color: rgba(23, 18, 21, 0.62);
  font: 600 11px var(--blog-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.post-rights__notice {
  max-width: 68ch;
  margin: 0 0 22px;
  color: #2a2226;
  font: 400 14.5px / 1.65 var(--blog-font);
}

.post-rights__cite {
  padding: 16px 18px;
  border-left: 3px solid var(--ink);
  border-radius: 0 14px 14px 0;
  background: color-mix(in srgb, var(--tint) 60%, #fff);
}

.post-rights__citation {
  margin: 0;
  color: #171215;
  font: 400 14px / 1.6 var(--blog-font);
  overflow-wrap: anywhere;
  user-select: all;
}

/* --- A sleeve without a cover yet: column, title and number, set in type ----------- */
.record__type {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: space-between;
  padding: 10% 10% 9%;
  background:
    radial-gradient(circle at 85% 12%, color-mix(in srgb, var(--ink) 18%, transparent), transparent 45%),
    var(--tint);
  color: var(--deep);
}

.record__type small {
  color: var(--ink);
  font: 600 clamp(8px, 0.75vw, 11px) var(--blog-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.record__type b {
  font: 400 clamp(17px, 2.2vw, 34px) / 1.02 var(--blog-display);
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.record__type i {
  justify-self: end;
  color: var(--ink);
  font: italic 500 clamp(36px, 5vw, 76px) / 0.8 var(--blog-italic);
}

/* --- Soundtrack player --------------------------------------------------------
   A small turntable pinned to the corner: the record spins while the song plays,
   the speaker mutes it, the note opens the full song on Apple Music. */
.sound {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(340px, calc(100vw - 220px));
  padding: 6px 7px 6px 6px;
  border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--tint) 38%, #fffdf9);
  box-shadow: 0 18px 40px -22px rgba(30, 6, 18, 0.55);
  color: var(--ink);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.sound__toggle {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: color-mix(in srgb, var(--tint) 60%, #fff);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sound__disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--ink) 0 31%, #0d0a0b 32% 34%, transparent 35%),
    conic-gradient(from 30deg, transparent 0 18%, rgba(255, 255, 255, 0.14) 24%, transparent 30% 68%, rgba(255, 255, 255, 0.1) 74%, transparent 80%),
    repeating-radial-gradient(circle, #151012 0 1.2px, #2a2026 1.2px 2.4px);
  box-shadow: 0 8px 16px -8px rgba(0, 0, 0, 0.6);
  animation: record-spin 2.8s linear infinite paused;
}

.sound[data-state="playing"] .sound__disc {
  animation-play-state: running;
}

/* Invites the first tap while the browser is still holding the sound back. */
.sound[data-state="waiting"] .sound__toggle::after {
  position: absolute;
  inset: -5px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  content: "";
  animation: sound-call 1.8s ease-out infinite;
}

@keyframes sound-call {
  from { opacity: 0.7; scale: 0.92; }
  to { opacity: 0; scale: 1.25; }
}

.sound__icon {
  position: relative;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sound__icon path:first-child {
  fill: currentColor;
}

.sound__cross,
.sound:not([data-state="playing"]) .sound__waves {
  display: none;
}

.sound[data-state="muted"] .sound__cross {
  display: inline;
}

.sound__label {
  display: grid;
  min-width: 0;
  margin: 0;
  line-height: 1.15;
}

.sound__label small {
  font: 600 9.5px var(--blog-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.72;
}

.sound__label b,
.sound__label span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sound__label b {
  font: italic 500 18px var(--blog-italic);
}

.sound__label span {
  font-size: 11.5px;
  opacity: 0.75;
}

.sound__source {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 9%, transparent);
  color: var(--ink);
  transition: background-color 200ms ease;
}

.sound__source:hover,
.sound__source:focus-visible {
  background: color-mix(in srgb, var(--ink) 18%, transparent);
}

.sound__source svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 560px) {
  .sound {
    right: 14px;
    bottom: 16px;
    gap: 9px;
    max-width: calc(100vw - 200px);
    padding-right: 14px;
  }

  .sound__toggle {
    width: 42px;
    height: 42px;
  }

  .sound__label b {
    font-size: 16px;
  }

  .sound__label span,
  .sound__source {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sound__disc,
  .sound[data-state="waiting"] .sound__toggle::after {
    animation: none;
  }
}
