/* Blog archive. Three designs live here while the choice is made (see tools/build/from-wp.mjs
   renderBlogArchive): grid (editorial), stack (cinematic) and split (reader). */

/* ---------- shared: the typographic tile for a note without a cover, category chips ---------- */
.btile {
  position: relative; display: grid; place-items: center; width: 100%; height: 100%;
  background: radial-gradient(120% 90% at 18% 0%, rgba(255, 100, 40, 0.3), transparent 60%), linear-gradient(160deg, #171717, #0a0a0a);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btile[hidden] { display: none; }
.btile em { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-size: clamp(3.5rem, 6vw, 5rem); line-height: 1; color: var(--orange); }
.btile .mono { position: absolute; left: 1rem; bottom: 0.9rem; font-size: 0.66rem; letter-spacing: 0.05em; color: var(--paper-dim); }

.bchips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.bchip {
  display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.55rem 0.95rem; border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line); color: var(--paper-dim); font-size: 0.88rem; text-decoration: none;
  transition: color 0.4s var(--ease), box-shadow 0.4s var(--ease), background 0.4s var(--ease);
}
.bchip .mono { font-size: 0.64rem; color: var(--orange); }
.bchip:hover { color: var(--paper); box-shadow: inset 0 0 0 1px rgba(255, 100, 40, 0.6); }
.bchip.is-on { background: var(--paper); color: var(--ink); box-shadow: none; }
.bchip.is-on .mono { color: var(--orange-deep); }

/* ---------- grid: the latest note leads, the rest in a grid that grows on demand ---------- */
.bhero {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 5rem); align-items: end;
  padding: calc(var(--nav-h) + clamp(3.5rem, 7vw, 6.5rem)) var(--gutter) clamp(3rem, 6vw, 5rem); overflow: hidden;
}
.bhero__glow { position: absolute; inset: -10% -10% auto; height: 80%; pointer-events: none; background: radial-gradient(45% 55% at 28% 45%, rgba(255, 100, 40, 0.16), transparent 70%); }
.bhero__copy { position: relative; }
.bhero__title { margin-top: 1rem; font-size: clamp(3rem, 7.2vw, 7.2rem); line-height: 0.95; letter-spacing: -0.045em; font-weight: 500; }
.bhero__title em, .bsplit__title em { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; color: var(--orange); }
.bhero__lede { margin-top: 1.5rem; max-width: 34rem; color: var(--paper-dim); font-size: clamp(1rem, 1.3vw, 1.2rem); line-height: 1.6; }

.bfeat { position: relative; display: grid; gap: 1.25rem; color: var(--paper); text-decoration: none; }
.bfeat__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 1.5rem; background: #111; box-shadow: 0 3rem 6rem -2rem rgba(0, 0, 0, 0.85), inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.bfeat__img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease); }
.bfeat:hover .bfeat__img { transform: scale(1.04); }
.bfeat__media .btile em { font-size: clamp(6rem, 12vw, 10rem); }
.bfeat__body { display: grid; gap: 0.6rem; }
.bfeat__meta { font-size: 0.72rem; letter-spacing: 0.04em; color: var(--orange); }
.bfeat__title { font-size: clamp(1.5rem, 2.6vw, 2.4rem); line-height: 1.08; letter-spacing: -0.03em; font-weight: 500; }
.bfeat__text { max-width: 40rem; color: var(--paper-dim); line-height: 1.55; }
.bfeat__cta { font-size: 0.72rem; letter-spacing: 0.04em; }
.bfeat__cta i { font-style: normal; display: inline-block; margin-left: 0.3rem; transition: transform 0.5s var(--ease); }
.bfeat:hover .bfeat__cta i { transform: translateX(0.4rem); }

.bgrid-wrap { padding: var(--section-y) var(--gutter); border-top: 1px solid var(--line); }
.bgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.75rem, 3vw, 2.75rem) clamp(1.25rem, 2vw, 2rem); }
.bcard.is-hidden { display: none; }
.bcard__link { display: grid; gap: 0.7rem; color: var(--paper); text-decoration: none; }
.bcard__media { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 1.1rem; background: #111; box-shadow: inset 0 0 0 1px var(--line); }
.bcard__img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.bcard__link:hover .bcard__img { transform: scale(1.05); }
.bcard__meta { margin-top: 0.4rem; font-size: 0.7rem; letter-spacing: 0.04em; color: var(--paper-dim); }
.bcard__title { font-size: clamp(1.15rem, 1.5vw, 1.4rem); line-height: 1.15; letter-spacing: -0.025em; font-weight: 500; transition: color 0.4s var(--ease); }
.bcard__link:hover .bcard__title { color: var(--orange); }
.bcard__text { color: var(--paper-dim); font-size: 0.92rem; line-height: 1.5; }
.bmore { display: flex; flex-direction: column; align-items: center; gap: 0.9rem; margin-top: clamp(2.5rem, 5vw, 4rem); }
.bmore .mono { font-size: 0.7rem; letter-spacing: 0.04em; color: var(--paper-dim); }

@media (max-width: 1000px) {
  .bhero { grid-template-columns: 1fr; align-items: start; }
  .bgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) { .bgrid { grid-template-columns: 1fr; } }

/* ---------- a note: cover hero, sticky contents, the reading column, what comes next ---------- */
.post-hero__title { font-size: clamp(2.4rem, 6.2vw, 6.4rem); line-height: 0.96; letter-spacing: -0.045em; font-weight: 500; max-width: 16ch; text-wrap: balance; }
.post-hero__lede { max-width: 42rem; color: var(--paper-dim); font-size: clamp(1rem, 1.3vw, 1.2rem); line-height: 1.55; }
.post-hero__copy { gap: 0.9rem; }
.post-hero__tile { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(60% 70% at 30% 30%, rgba(255, 100, 40, 0.35), transparent 65%), linear-gradient(160deg, #1b1b1b, #070707); }
.post-hero__tile em { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-size: clamp(14rem, 40vw, 34rem); line-height: 1; color: var(--orange); opacity: 0.9; }

.post { position: relative; background: var(--paper); color: var(--ink); --fg: var(--ink); --fg-dim: rgba(5, 5, 5, 0.58); --line: var(--line-on-paper); padding: clamp(3rem, 6vw, 5rem) var(--gutter) var(--section-y); border-radius: 2rem 2rem 0 0; margin-top: -2rem; z-index: 1; }
.post__progress { position: sticky; top: var(--nav-h); z-index: 5; height: 2px; margin: 0 calc(-1 * var(--gutter)) clamp(2rem, 4vw, 3rem); background: var(--line); }
.post__progress span { display: block; height: 100%; background: var(--orange); transform-origin: 0 50%; transform: scaleX(0); }
.post__grid { display: grid; grid-template-columns: minmax(15rem, 0.72fr) minmax(0, 1.6fr); gap: clamp(2.5rem, 7vw, 8rem); align-items: start; max-width: 96rem; margin-inline: auto; }
.post__sticky { position: sticky; top: calc(var(--nav-h) + 2rem); max-height: calc(100svh - var(--nav-h) - 3rem); overflow: auto; scrollbar-width: none; display: grid; gap: 2rem; padding-bottom: 2.5rem; -webkit-mask-image: linear-gradient(#000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(#000 calc(100% - 2.5rem), transparent); }
.post__meta { display: grid; gap: 0.9rem; }
.post__meta dt { font-size: 0.66rem; letter-spacing: 0.06em; color: var(--fg-dim); margin-bottom: 0.2rem; }
.post__meta dd { font-size: 0.95rem; }
.post__meta a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--orange); text-underline-offset: 0.2em; }
.ptoc__list { display: grid; gap: 0.15rem; margin-top: 0.9rem; border-left: 1px solid var(--line); }
.ptoc__link { position: relative; display: block; padding: 0.4rem 0 0.4rem 1.1rem; color: var(--fg-dim); font-size: 0.92rem; line-height: 1.35; text-decoration: none; transition: color 0.3s var(--ease); }
.ptoc__item--h3 .ptoc__link { padding-left: 2rem; font-size: 0.84rem; }
.ptoc__bar { position: absolute; left: -1px; top: 0; bottom: 0; width: 2px; background: var(--orange); transform: scaleY(0); transform-origin: 50% 0; transition: transform 0.4s var(--ease); }
.ptoc__link:hover, .ptoc__link.is-on { color: var(--ink); }
.ptoc__link.is-on .ptoc__bar { transform: scaleY(1); }
.post__all { font-size: 0.72rem; letter-spacing: 0.04em; color: var(--fg-dim); text-decoration: none; transition: color 0.3s; }
.post__all:hover { color: var(--orange-deep); }

/* the reading column: the sanitised markup from the CMS given a long-form voice */
.prose { max-width: 46rem; font-size: clamp(1.08rem, 1.25vw, 1.2rem); line-height: 1.7; color: rgba(5, 5, 5, 0.86); }
.prose > * + * { margin-top: 1.15em; }
.prose > p:first-child::first-letter { float: left; margin: 0.08em 0.14em 0 0; font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-size: 4.6em; line-height: 0.78; color: var(--orange-deep); }
.prose h2 { margin-top: 2.2em; font-size: clamp(1.6rem, 2.4vw, 2.1rem); line-height: 1.12; letter-spacing: -0.03em; font-weight: 500; color: var(--ink); scroll-margin-top: calc(var(--nav-h) + 2rem); }
.prose h3 { margin-top: 1.8em; font-size: clamp(1.2rem, 1.6vw, 1.45rem); line-height: 1.2; letter-spacing: -0.02em; font-weight: 600; color: var(--ink); scroll-margin-top: calc(var(--nav-h) + 2rem); }
.prose h4 { margin-top: 1.5em; font-size: 1.05rem; font-weight: 600; color: var(--ink); }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--orange); text-underline-offset: 0.2em; text-decoration-thickness: 1.5px; transition: color 0.3s var(--ease); }
.prose a:hover { color: var(--orange-deep); }
.prose strong { font-weight: 600; color: var(--ink); }
.prose em { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-size: 1.06em; }
.prose ul, .prose ol { display: grid; gap: 0.5rem; padding-left: 0; list-style: none; counter-reset: prose; }
.prose li { position: relative; padding-left: 1.8rem; }
.prose ul > li::before { content: ""; position: absolute; left: 0.1rem; top: 0.8em; width: 0.75rem; height: 1.5px; background: var(--orange-deep); }
.prose ol > li::before { counter-increment: prose; content: counter(prose, decimal-leading-zero); position: absolute; left: 0; top: 0.35em; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.72rem; color: var(--orange-deep); }
.prose li > ul, .prose li > ol { margin-top: 0.5rem; }
.prose blockquote { margin: 2rem 0; padding: 0.2rem 0 0.2rem 1.5rem; border-left: 2px solid var(--orange); font-family: "Instrument Serif", Georgia, serif; font-size: clamp(1.35rem, 1.9vw, 1.7rem); line-height: 1.35; letter-spacing: -0.015em; color: var(--ink); }
.prose blockquote p { margin: 0; }
.prose blockquote p + p { margin-top: 0.6rem; }
.prose pre { margin-top: 1.5rem; padding: 1.2rem 1.35rem; border-radius: 1rem; background: var(--ink); color: rgba(255, 255, 255, 0.86); font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.86rem; line-height: 1.6; overflow-x: auto; }
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.prose code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.86em; background: rgba(5, 5, 5, 0.06); padding: 0.1em 0.4em; border-radius: 0.35em; color: var(--ink); }
.prose figure { margin: 2rem 0; }
.prose img { display: block; width: 100%; height: auto; border-radius: 1rem; }
.prose figcaption { margin-top: 0.6rem; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.72rem; color: var(--fg-dim); }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2.5rem 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92rem; line-height: 1.45; margin-top: 1.5rem; }
.prose th, .prose td { padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.7rem; letter-spacing: 0.05em; color: var(--fg-dim); font-weight: 500; }
.prose .table-wrap, .prose table { overflow-x: auto; display: block; }
.prose table { display: table; }

.post-next__title { font-size: clamp(2.2rem, 6.5vw, 7rem); max-width: 16ch; }
.post-related { padding: var(--section-y) var(--gutter); border-top: 1px solid var(--line); }
.post-related .bgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 900px) {
  .post__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .post__sticky { position: static; max-height: none; }
  .ptoc { display: none; }
  .post-related .bgrid { grid-template-columns: 1fr; }
  .prose > p:first-child::first-letter { font-size: 3.6em; }
}

/* ---------- stack: the projects design carrying notes, then the whole archive as a ledger ---------- */
.wk-card .wk-card__title--note { font-size: clamp(1.9rem, 4.2vw, 4rem); max-width: 20ch; }
.bledger { padding: var(--section-y) var(--gutter); border-top: 1px solid var(--line); }
.bledger__head { margin-bottom: clamp(2rem, 4vw, 3rem); }
.bledger .pindex__name { font-size: clamp(1.3rem, 2.4vw, 2.2rem); }
.bledger .pindex__row { padding-block: clamp(1rem, 2vw, 1.5rem); }

/* ---------- split: a sticky browse column, rows by year, a cover that follows the pointer ---------- */
.bsplit__hero { padding: calc(var(--nav-h) + clamp(3rem, 7vw, 6rem)) var(--gutter) clamp(2rem, 4vw, 3rem); }
.bsplit__title { margin-top: 1rem; font-size: clamp(3rem, 8vw, 8rem); line-height: 0.95; letter-spacing: -0.045em; font-weight: 500; }
.bsplit__lede { margin-top: 1.25rem; max-width: 36rem; color: var(--paper-dim); font-size: clamp(1rem, 1.3vw, 1.2rem); line-height: 1.6; }
.bsplit {
  position: relative; display: grid; grid-template-columns: minmax(14rem, 0.8fr) minmax(0, 2.4fr); gap: clamp(2rem, 6vw, 7rem);
  padding: clamp(2rem, 4vw, 3rem) var(--gutter) var(--section-y); border-top: 1px solid var(--line);
}
.bsplit__nav { position: sticky; top: calc(var(--nav-h) + 1.5rem); align-self: start; }
.bsplit__cats { display: grid; margin-top: 1rem; }
.bsplit__cats a {
  display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line);
  color: var(--paper-dim); font-size: 0.95rem; text-decoration: none; transition: color 0.3s var(--ease), transform 0.4s var(--ease);
}
.bsplit__cats a .mono { font-size: 0.64rem; color: var(--orange); }
.bsplit__cats a:hover, .bsplit__cats a.is-on { color: var(--paper); transform: translateX(0.5rem); }
.bsplit__years-label { margin-top: 2rem; }
.bsplit__years { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; margin-top: 0.75rem; font-size: 0.75rem; }
.bsplit__years a { color: var(--paper-dim); text-decoration: none; transition: color 0.3s; }
.bsplit__years a:hover { color: var(--orange); }
.bsplit__year { display: flex; align-items: center; gap: 1rem; margin: 2.75rem 0 0.5rem; font-size: 0.72rem; letter-spacing: 0.08em; color: var(--orange); scroll-margin-top: calc(var(--nav-h) + 1rem); }
.bsplit__year:first-child { margin-top: 0; }
.bsplit__year i { flex: 1; height: 1px; background: var(--line); }
.brow {
  display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) auto 1.5rem; gap: 1rem; align-items: baseline;
  padding: 1.05rem 0; border-bottom: 1px solid var(--line); color: var(--paper); text-decoration: none;
}
.brow__num { font-size: 0.7rem; color: var(--paper-dim); }
.brow__title { font-size: clamp(1.15rem, 1.7vw, 1.6rem); line-height: 1.15; letter-spacing: -0.025em; font-weight: 500; transition: transform 0.6s var(--ease), color 0.4s var(--ease); }
.brow:hover .brow__title { transform: translateX(0.6rem); color: var(--orange); }
.brow__meta { font-size: 0.7rem; white-space: nowrap; color: var(--paper-dim); }
.brow__arrow { justify-self: end; transition: transform 0.5s var(--ease), color 0.4s var(--ease); }
.brow:hover .brow__arrow { transform: rotate(45deg); color: var(--orange); }
.bsplit__follow { position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none; }
.bsplit__card { position: relative; display: block; width: clamp(14rem, 22vw, 20rem); aspect-ratio: 4 / 3; overflow: hidden; border-radius: 1rem; background: #111; box-shadow: 0 2rem 4rem -1rem rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
.bsplit__card img { width: 100%; height: 100%; object-fit: cover; }
.bsplit__card img[hidden] { display: none; }
.bsplit__cap { position: absolute; left: 0.9rem; bottom: 0.8rem; padding: 0.35rem 0.6rem; border-radius: 999px; background: var(--orange); color: var(--ink); font-size: 0.62rem; letter-spacing: 0.08em; }
@media (max-width: 900px) {
  .bsplit { grid-template-columns: 1fr; }
  .bsplit__nav { position: static; }
  .brow { grid-template-columns: 2.4rem minmax(0, 1fr) 1.2rem; }
  .brow__meta { grid-column: 2; }
  .bsplit__follow { display: none; }
}
