/* Blog index and posts (owner: blog).
   Loads after styles.css, site.css and ucviz.css on /blog and every post.
   Sections: covers · founder photo · cards · index masthead · all posts ·
   post hero · post cover · article layout · prose · after the article · motion */

/* ---------- Covers (shared vocabulary, no grid) ----------
   Animations run only while a cover is live: in view (focal covers, touch
   screens) or hovered (grid cards with a mouse), see p-blog.js. A paused
   cover sits on a "complete" frame (negative delays), so nothing jumps when
   it starts or stops. */
.cover:not(.is-live) * { animation-play-state: paused !important; }
.cover--still * { animation: none !important; }
.cover .cv-ok { animation-delay: calc(var(--d, 0s) - 3.1s); }
.cover .cv-pop { animation-delay: calc(var(--d, 0s) - 2.4s); }
/* build log rows type in, the chart line draws (static and complete where p-blog.css is not loaded) */
.cover .cvb-code { transform-box: fill-box; transform-origin: left; animation: cvTypeB 5s var(--ease) calc(var(--d, 0s) - 2.4s) infinite; }
.cover .cvb-draw { animation: cvDrawB 5s var(--ease) -3s infinite; }
@keyframes cvTypeB { 0% { transform: scaleX(0); opacity: 1; } 18%, 85% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes cvDrawB { 0% { stroke-dashoffset: 700; opacity: 1; } 45%, 85% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
/* Guardrails cover: the token waits at the gate, the gate turns green ("approved"), the token passes */
.cover .cv-travel { animation-delay: -4.7s; }
.cover .cv-gok { animation: cvGok 6s linear -4.7s infinite; }
.cover .cv-gwait { animation: cvGwait 6s linear -4.7s infinite; }
@keyframes cvGok { 0%, 44% { opacity: 0; } 49%, 95% { opacity: 1; } 100% { opacity: 0; } }
@keyframes cvGwait { 0%, 44% { opacity: 1; } 49%, 95% { opacity: 0; } 100% { opacity: 1; } }
.cover__label {
  left: 18px; top: 18px; z-index: 2; padding: 7px 12px; border-radius: var(--r-pill);
  background: rgba(15, 12, 11, .55); border: 1px solid var(--line-d2); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font: 500 11px/1.2 'Geist Mono', ui-monospace, monospace; letter-spacing: .14em; color: var(--cream);
}

/* ---------- Founder photo: the cutout, cropped to a circle around the face ---------- */
.face {
  position: relative; display: inline-block; flex: none; width: 40px; height: 40px; overflow: hidden; border-radius: 50%;
  background: radial-gradient(90% 80% at 50% 100%, #8a1f17, #3a0f0b 55%, #1f1a18); isolation: isolate;
}
.face img, .byline .face img, .author .face img {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; border-radius: 0; box-shadow: none;
  object-fit: cover; object-position: 50% 15%; transform: scale(2.1); transform-origin: 40% 7%;
}

/* ---------- Post cards (e1 on light) ---------- */
.pcard__link {
  border-radius: var(--r-md); background: var(--paper); border: 1px solid var(--line-l); box-shadow: var(--sh-card-l);
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.pcard__media { margin: 6px 6px 0; border-radius: calc(var(--r-md) - 6px); isolation: isolate; }
.pcard__media .cover { transition: transform .6s var(--ease); }
.pcard__body { gap: 10px; padding: 20px 22px 24px; }
.pcard__meta { display: grid; justify-items: start; gap: 10px; font: 500 11px/1.3 'Geist Mono', ui-monospace, monospace; letter-spacing: .12em; color: var(--label-on-light); }
.pcard__cat { padding: 5px 9px; border-radius: var(--r-pill); background: rgba(215, 55, 43, .08); color: var(--red-deep); }
.pcard--feature .pcard__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pcard__kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.pcard__kicker::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(215, 55, 43, .14); }
.pcard__title { font-size: 20px; line-height: 1.25; letter-spacing: -.022em; }
.pcard__tt {
  padding-bottom: 2px; background: linear-gradient(var(--red), var(--red)) 0 100% / 0 1.5px no-repeat;
  transition: background-size .5s var(--ease);
}
.pcard__desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; font-size: 15px; line-height: 1.55; }
.pcard__more { padding-top: 10px; }
.pcard__more span { transition: transform .35s var(--ease); }
.pcard__link:hover .pcard__title { color: var(--ink); }
.pcard__link:hover .pcard__tt, .pcard__link:focus-visible .pcard__tt { background-size: 100% 1.5px; }
.pcard__link:hover .cover { transform: scale(1.04); }
.pcard__link:hover .pcard__more span { transform: translateX(3px); }
@media (hover: hover) {
  .pcard__link:hover { transform: translateY(-4px); border-color: rgba(215, 55, 43, .45); box-shadow: var(--sh-card-l), 0 32px 60px -38px rgba(20, 17, 16, .45); }
}
.latest__grid, .bindex__grid { gap: var(--gap); }

/* ---------- Blog index: short hero [paper], then every post [sand] ---------- */
.bhero { position: relative; padding: var(--hero-top) var(--gutter) clamp(56px, 6vw, 88px); background: var(--paper); color: var(--ink); overflow-x: clip; }
.bhero__wrap { display: flex; flex-direction: column; }
.bhero__title {
  margin: clamp(22px, 2.6vw, 36px) 0 clamp(28px, 3vw, 40px);
  font-size: clamp(52px, 7.2vw, 108px); font-weight: 500; line-height: .96; letter-spacing: -.05em; text-wrap: balance;
}
.bhero__line { display: block; overflow: hidden; padding: 0 .06em .14em; margin: 0 -.06em -.14em; }
.bhero__line > span { display: inline-block; }
.bhero__title .serif { letter-spacing: -.025em; }
.bhero__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px 48px; padding-top: 28px; border-top: 1px solid var(--line-l2); }
.bhero__lede { max-width: 560px; font-size: clamp(17px, 1.45vw, 20px); line-height: 1.6; color: var(--body-on-light); }
.bhero__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  font: 500 11px/1.3 'Geist Mono', ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--label-on-light);
}
.bhero__face { width: 28px; height: 28px; margin-right: 2px; box-shadow: 0 0 0 1px var(--line-l2); }
.bhero__dot { color: rgba(20, 17, 16, .3); }
.bhero__meta a { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; color: var(--red-deep); background: linear-gradient(currentColor, currentColor) 0 calc(100% - 4px) / 0 1px no-repeat; transition: background-size .35s var(--ease); }
.bhero__meta a:hover { background-size: 100% 1px; }
/* entrance: title lines unmask, then the foot fades up */
.js .bhero__line > span { animation: rise 1s var(--ease-expo) calc(.1s + var(--i, 0) * .12s) both; }
.js .bhero__foot { animation: fadeUp 1s var(--ease) .45s both; }

.bindex { padding: clamp(56px, 6vw, 88px) var(--gutter) var(--section-y); background: var(--sand); }
.bindex__wrap { display: block; }

/* ---------- Post hero [ink-deep, lit by its own cover] ---------- */
.post-hero { position: relative; isolation: isolate; display: flow-root; overflow: visible; padding: var(--hero-top) var(--gutter) 0; background: var(--ink-deep); }
.post-hero__bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.post-hero__glow {
  position: absolute; inset: 0; opacity: .35;
  -webkit-mask-image: radial-gradient(75% 80% at 50% 48%, #000 35%, transparent 85%); mask-image: radial-gradient(75% 80% at 50% 48%, #000 35%, transparent 85%);
}
.post-hero__drift { position: absolute; left: 50%; top: 46%; width: min(1500px, 120%); aspect-ratio: 16 / 10; transform: translate(-50%, -50%); animation: glowDrift 20s ease-in-out infinite; }
.post-hero__drift .cover { width: 100%; height: 100%; transform: scale(1.6); filter: blur(40px) saturate(1.2) brightness(1.5); will-change: transform; }
@keyframes glowDrift { 0%, 100% { transform: translate(-50%, calc(-50% - 12px)); } 50% { transform: translate(-50%, calc(-50% + 12px)); } }
.post-hero__shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15, 12, 11, .7) 0%, rgba(15, 12, 11, 0) 28%), radial-gradient(70% 60% at 50% 45%, transparent 40%, rgba(15, 12, 11, .55) 100%);
}
.post-hero__wrap { position: relative; display: flex; flex-direction: column; align-items: center; gap: 24px; max-width: 920px; margin: 0 auto; text-align: center; }
.post-hero .crumbs { justify-content: center; }
.post-hero__title { max-width: 880px; font-size: clamp(40px, 5vw, 72px); line-height: 1.02; letter-spacing: -.045em; }
.post-hero__lede { max-width: 640px; font-size: 20px; line-height: 1.6; }
.post-hero__meta {
  justify-content: center; gap: 12px 28px; width: 100%; max-width: 680px; margin-top: 8px; padding-top: 24px;
  border-top: 1px solid var(--line-d2); color: var(--cream);
}
.byline { gap: 12px; text-align: left; }
.byline__face { box-shadow: 0 0 0 1px rgba(245, 239, 230, .2); }
.byline > span:last-child { gap: 2px; font-size: 13px; line-height: 1.3; color: var(--muted); }
.byline strong { font-size: 15px; font-weight: 500; letter-spacing: -.01em; }
.post-hero__facts { gap: 10px; font: 500 11.5px/1.3 'Geist Mono', ui-monospace, monospace; letter-spacing: .12em; color: var(--muted-light); }
.post-hero__facts > span[aria-hidden] { color: var(--muted); }
/* entrance (Frame, Voice, Proof, System) */
.js .post-hero__glow { animation: glowBloom 1.4s var(--ease) both; }
@keyframes glowBloom { from { opacity: 0; } to { opacity: .35; } }
.js .post-hero .crumbs { animation: fadeUp .9s var(--ease) .05s both; }
.js .post-hero__lede { animation: fadeUp 1s var(--ease) .5s both; }
.js .post-hero__meta { animation: fadeUp 1s var(--ease) .6s both; }

/* ---------- Post cover card: overlaps the paper below by 160px ---------- */
.post-cover { position: relative; z-index: 3; max-width: 1080px; margin: clamp(40px, 5vw, 60px) auto -160px; padding: 0; }
.post-cover__frame { position: relative; border-radius: var(--r-lg); }
.post-cover__frame::before { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: var(--sh-float-d); pointer-events: none; }
.post-cover .cover { aspect-ratio: 16 / 7; border-radius: var(--r-lg); border: 1px solid var(--line-d); box-shadow: none; }
.js .post-cover .cover { animation: coverReveal 1.1s cubic-bezier(.87, 0, .13, 1) .4s both; }
.js .post-cover__frame::before { animation: fadeIn .9s var(--ease) 1s both; }
@keyframes coverReveal { from { clip-path: inset(0 0 100% 0 round var(--r-lg)); } to { clip-path: inset(0 round var(--r-lg)); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Article [paper]: reading split 3 / 7 / 2 ---------- */
.post-main { padding: calc(160px + clamp(56px, 6vw, 88px)) var(--gutter) clamp(80px, 9vw, 128px); background: var(--paper); color: var(--ink); }
.post-layout { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 var(--gap); justify-content: stretch; padding: 0; }
.post-aside { grid-column: 1 / 4; grid-row: 1; min-width: 0; }
.prose, .post-end { grid-column: 4 / 11; min-width: 0; }
.post-end { grid-row: 2; }
.toc-m { display: none; }
.post-aside__inner { position: sticky; top: 120px; gap: 32px; padding-right: clamp(0px, 2vw, 32px); }
.post-aside__label { font: 500 11px/1.3 'Geist Mono', ui-monospace, monospace; letter-spacing: .14em; color: var(--label-on-light); }
/* On this page: a hairline rail, the active item gets a red bar that slides */
.toc { position: relative; }
.toc__list { position: relative; margin: 14px 0 0; padding: 0; list-style: none; border-left: 1px solid var(--line-l2); }
.toc__list a { display: block; padding: 7px 0 7px 16px; font-size: 14px; line-height: 1.4; color: var(--label-on-light); text-wrap: pretty; transition: color var(--dur-1) var(--ease); }
.toc__list a:hover, .toc__list a.is-active { color: var(--ink); }
.toc__bar {
  position: absolute; left: 0; top: 0; width: 2px; height: var(--h, 0); border-radius: 2px; background: var(--red); opacity: 0;
  transform: translateY(var(--y, 0)); transition: transform .45s var(--ease-out), height .45s var(--ease-out), opacity .3s var(--ease);
}
.toc.has-active .toc__bar { opacity: 1; }
.post-aside__share { display: block; }
.post-aside__row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.share-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-l2); transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease); }
.share-btn .share-ic { width: 18px; height: 18px; }
.share-btn .share-ic rect { fill: transparent; }
.share-btn .share-ic path { fill: var(--ink); }
.share-btn:hover { border-color: var(--ink); background: rgba(20, 17, 16, .04); }
.copy-link { min-height: 44px; padding: 0 18px; border-color: var(--line-l2); }
.post-aside__cta { gap: 8px; margin-top: 0; padding: 24px; border-radius: var(--r-md); border: 1px solid var(--line-d); box-shadow: var(--sh-raise); }
.post-aside__t { font-size: 20px; line-height: 1.25; letter-spacing: -.02em; text-wrap: balance; }
.post-aside__cta .card__cta { margin-top: 10px; }
.toc-m { margin-bottom: 32px; border: 1px solid var(--line-l2); border-radius: var(--r-md); background: var(--cream); }
.toc-m summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 0 20px; cursor: pointer; list-style: none;
  font: 500 11.5px/1.3 'Geist Mono', ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--ink);
}
.toc-m summary::-webkit-details-marker { display: none; }
.toc-m__ic { position: relative; width: 14px; height: 14px; }
.toc-m__ic::before, .toc-m__ic::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; margin-top: -.75px; background: var(--red); transition: transform var(--dur-2) var(--ease); }
.toc-m__ic::after { transform: rotate(90deg); }
.toc-m[open] .toc-m__ic::after { transform: rotate(0); }
.toc-m .toc__list { margin: 0 20px 18px; }
.toc-m .toc__list a { padding: 12px 0 12px 16px; font-size: 15px; }
@media (max-width: 1023px) {
  .post-layout { grid-template-columns: minmax(0, 1fr); max-width: 680px; }
  .post-aside, .prose, .post-end, .toc-m { grid-column: 1; grid-row: auto; }
  .toc-m { display: block; order: 1; }
  .prose { order: 2; }
  .post-aside { order: 3; margin-top: 56px; }
  .post-end { order: 4; }
  .post-aside .toc { display: none; }
  .post-aside__inner { position: static; padding: 0; gap: 24px; }
}

/* ---------- Prose: 18px / 1.75, max 680px ---------- */
.prose { max-width: 680px; font-size: 18px; line-height: 1.75; color: var(--body-on-light); }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { margin-top: 64px; font-size: 30px; font-weight: 500; line-height: 1.2; letter-spacing: -.03em; color: var(--ink); scroll-margin-top: 110px; }
.prose h3 { margin-top: 40px; font-size: 22px; font-weight: 500; line-height: 1.3; letter-spacing: -.02em; color: var(--ink); }
.prose h2 + *, .prose h3 + * { margin-top: 16px; }
.prose a {
  color: var(--red-deep); text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: rgba(184, 41, 31, .45); transition: text-decoration-color var(--dur-2) var(--ease), text-decoration-thickness var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.prose a:hover { color: var(--red-deep); text-decoration-thickness: 2px; text-decoration-color: currentColor; }
.prose ul { padding-left: 0; list-style: none; }
.prose ul > li { position: relative; padding-left: 26px; }
.prose ul > li::before { content: ''; position: absolute; left: 3px; top: .74em; width: 6px; height: 6px; background: var(--red); }
.prose ol { padding-left: 1.5em; }
.prose ol > li { padding-left: 6px; }
.prose ol > li::marker { font: 500 .8em 'Geist Mono', ui-monospace, monospace; color: var(--red-deep); }
.prose li + li { margin-top: .55em; }
.prose blockquote {
  margin: 1.6em 0; padding-left: 24px; border-left: 2px solid var(--red);
  font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-size: 28px; line-height: 1.3; letter-spacing: -.01em; color: var(--ink);
}
/* "In short": a cream panel with a red left rule */
.prose .tldr { position: relative; padding: 26px 28px 26px 32px; border-radius: var(--r-md); background: var(--cream); border: 1px solid var(--line-l); }
.prose .tldr::before { content: ''; position: absolute; left: -1px; top: 22px; bottom: 22px; width: 3px; border-radius: 0 3px 3px 0; background: var(--red); }
.tldr__k { font: 500 11px/1.3 'Geist Mono', ui-monospace, monospace; letter-spacing: .14em; color: var(--red-deep); }
.prose .tldr ul { margin-top: 12px; font-size: 16.5px; line-height: 1.6; }
.prose .tldr li + li { margin-top: .45em; }
.prose .pfig__loop { border-radius: var(--r-md); }
.prose .pfig__loop span { border-radius: var(--r-sm); }
.prose .ptable, .prose .pdl { border-top-color: var(--line-l2); }
.prose .ptable__row, .prose .pdl > div { border-bottom-color: var(--line-l2); }

/* ---------- After the article: author card and pager ---------- */
.post-end { display: flex; flex-direction: column; gap: 20px; max-width: 680px; margin-top: 72px; padding: 0; }
.author { align-items: center; gap: 22px; max-width: none; padding: 26px 28px; border-radius: var(--r-lg); background: var(--cream); border: 1px solid var(--line-l); }
.author__face { width: 72px; height: 72px; box-shadow: 0 0 0 1px var(--line-l2); }
.author__txt { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.author__name { font-size: 19px; font-weight: 500; letter-spacing: -.02em; }
.author__bio { font-size: 15.5px; line-height: 1.55; color: var(--body-on-light); }
.author .link-arrow { margin-top: 4px; }
.pager { gap: var(--gap); }
.pager__a {
  gap: 10px; padding: 22px 24px; border-radius: var(--r-md); border: 1px solid var(--line-l2); background: transparent;
  transition: border-color .35s var(--ease), background .35s var(--ease), transform .35s var(--ease);
}
.pager__a:hover { border-color: rgba(215, 55, 43, .45); background: var(--cream); }
.pager__k { font: 500 11px/1.3 'Geist Mono', ui-monospace, monospace; letter-spacing: .14em; }
.pager__arr { display: inline-block; transition: transform .35s var(--ease); }
.pager__a:hover .pager__arr { transform: translateX(-4px); }
.pager__a--next:hover .pager__arr { transform: translateX(4px); }
.pager__t { font-size: 17px; line-height: 1.35; text-wrap: balance; }
@media (hover: hover) { .pager__a:hover { transform: translateY(-2px); } }

/* ---------- More from the blog [sand] ---------- */
.latest--related .latest__wrap { gap: clamp(48px, 6vw, 80px); }
.latest--related .sec-head > .link-arrow { align-self: flex-end; margin-bottom: 8px; }

/* ---------- Phones and tablets ---------- */
@media (max-width: 700px) {
  .post-cover .cover { aspect-ratio: 16 / 10; }
  .post-cover { margin-bottom: -88px; }
  .post-cover .cover__label { display: none; }
  .post-main { padding-top: calc(88px + 56px); }
}
@media (max-width: 599px) {
  .bhero__meta { font-size: 10.5px; }
  .bhero__dot { display: none; }
  .bhero__meta a { flex-basis: 100%; min-height: 44px; background-position: 0 calc(100% - 12px); }
  .bhero__title { font-size: 48px; letter-spacing: -.05em; }
  .bhero__foot { padding-top: 20px; }
  .post-hero__wrap { gap: 20px; }
  .post-hero__title { font-size: 36px; line-height: 1.06; letter-spacing: -.04em; }
  .post-hero__lede { font-size: 18px; }
  .post-hero__meta { gap: 14px; padding-top: 20px; }
  .post-hero__facts { width: 100%; justify-content: center; }
  /* phones: no blurred copy, a static two-stop radial instead */
  .post-hero__glow { display: none; }
  .post-hero__bg { background: radial-gradient(90% 55% at 50% 38%, rgba(138, 31, 23, .42), rgba(15, 12, 11, 0) 70%); }
  .prose { font-size: 17px; }
  .prose h2 { margin-top: 52px; font-size: 26px; }
  .prose h3 { font-size: 20px; }
  .prose .tldr { padding: 22px 20px 22px 24px; }
  .author { flex-direction: column; align-items: flex-start; padding: 24px; }
  .pager { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Reduced motion: final frames, nothing loops ---------- */
@media (prefers-reduced-motion: reduce) {
  .cover *, .post-hero__drift { animation: none !important; }
  .pcard__media .cover, .pcard__tt, .toc__bar { transition: none !important; }
}

/* Short laptop screens: keep the whole sticky aside, Book card included, on screen */
@media (min-width: 1024px) and (max-height: 820px) {
  .post-aside__inner { top: 100px; gap: 20px; }
  .toc__list a { padding: 4px 0 4px 16px; font-size: 13.5px; }
  .post-aside__d { display: none; }
}
@media (min-width: 1024px) and (max-height: 680px) { .post-aside__cta { display: none; } }

/* Phones: cover labels never render as unreadable specks.
   Card and feature covers show the art alone; the post cover's labels grow to about 10px. */
@media (max-width: 600px) {
  .pcard .cover svg text { display: none; }
  .post-cover .cover svg > g { font-size: 19px; }
  .post-cover .cover svg text[font-size="13"] { font-size: 13.6px; letter-spacing: .06em; }
}
