/* Mochi Squad blog: the home page's look for the articles (paper and ink, big Geist type, quiet cards, mono kickers),
   and the Mochi of each article. Loaded after site.css and docs.css; --m is the colour of the article's Mochi. */
.blog-page { --m: #2f6bff; /* --m is the article Mochi's own colour (its hands); every mark on the page uses the site accent */ --glass: linear-gradient(180deg, #fcfaf6, #f8f5ef); }
.blog-page .bwrap { max-width: 1180px; }
.blog-page .doc { position: relative; }
.mochi-blink { transform-box: fill-box; transform-origin: center; animation: m-blink 5.6s infinite; }
.mochi-eyes { transition: transform .3s ease-out; }
@keyframes m-blink { 0%, 94%, 100% { transform: none; } 96.5% { transform: scaleY(.1); } }
[data-mochi], .cta-squad i { display: block; font-style: normal; }
[data-mochi] img { display: block; width: 100%; height: auto; }

/* ---------- article: header ---------- */
.blog-page .post h1 { font: 800 clamp(38px, 5.3vw, 64px)/1.0 var(--body); letter-spacing: -.05em; text-wrap: balance; }
.blog-page .post .post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 22px 0 28px; font-size: 14px; color: var(--faint); }
.post .meta-m { width: 30px; height: 30px; margin-right: 6px; flex: none; }
.doc .post-meta a { color: var(--text); text-decoration: none; font-weight: 550; } .doc .post-meta a:hover { text-decoration: underline; }

/* the answer-first lead, in the colour of the article's Mochi */
.lead-box { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 20px; align-items: start; margin: 0 0 34px; padding: 22px 24px 22px 20px; border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
  background: radial-gradient(120% 130% at 0% 0%, color-mix(in srgb, var(--accent) 17%, transparent), transparent 62%), var(--glass);
  box-shadow: 0 30px 60px -50px color-mix(in srgb, var(--accent) 70%, transparent); }
.lead-m { width: 64px; height: 64px; margin-top: 2px; }
.blog-page .doc .lead-box .lead { margin: 0; max-width: none; color: rgba(17,17,20,.88); font-size: clamp(17px, 1.4vw, 19px); line-height: 1.6; }
.doc .lead-box .lead strong:first-child { display: block; margin-bottom: 4px; font: 500 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: color-mix(in srgb, var(--accent) 58%, black); }

/* ---------- article: reading ---------- */
.blog-page .post p, .blog-page .post li { font-size: 17px; line-height: 1.72; }
.blog-page .post h2 { font: 700 clamp(26px, 2.6vw, 32px)/1.12 var(--body); letter-spacing: -.04em; margin: 64px 0 16px; text-wrap: balance; }
.blog-page .post h2::before { content: ""; display: block; width: 28px; height: 3px; border-radius: 3px; margin-bottom: 18px; background: var(--accent); }
.blog-page .post h2 .hash { top: 21px; }
.blog-page .post h3 { font: 650 21px/1.25 var(--body); letter-spacing: -.025em; margin: 38px 0 10px; }
.post a { text-decoration-color: color-mix(in srgb, var(--accent) 70%, transparent); }
.post a:hover { text-decoration-color: var(--accent); }
.post ul > li::marker { color: color-mix(in srgb, var(--accent) 80%, black); }
.post ol > li::marker { color: color-mix(in srgb, var(--accent) 58%, black); font: 500 .9em var(--mono); }
.post blockquote { margin: 22px 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); color: var(--dim); }
.post .code { background: #16161a; border-radius: 16px; }
.post .toc-inline { padding: 18px 22px 16px; border-radius: 20px; background: var(--glass); }
.post .toc-inline ol > li::marker { color: var(--faint); }
.post .note { border-radius: 18px; }
.post strong { color: var(--text); }

/* tables: striped and rounded; wide ones get a wider measure than the reading column, centred; they never cut a cell */
.post .table { margin: 22px 0 28px; border-radius: 18px; background: none; }
.post .table table { font-size: 14.5px; }
.post .table tbody tr:nth-child(even) td { background: rgba(17,17,20,.028); }
.post .table th { font: 500 11.5px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); padding-top: 13px; padding-bottom: 13px; }
.post .table td:first-child strong { color: var(--text); }
.post .table-wide { --w: max(100%, min(1100px, 100vw - 72px)); width: var(--w); max-width: none; margin-left: calc((100% - var(--w)) / 2); }
.post .table-wide table { font-size: 13.5px; }
.post .table-wide th, .post .table-wide td { padding: 11px 12px; }
.post .table-wide th:first-child, .post .table-wide td:first-child { position: sticky; left: 0; z-index: 1; background: var(--paper); box-shadow: inset -1px 0 0 var(--edge); }
.post .table-wide tbody tr:nth-child(even) td:first-child { background: color-mix(in srgb, var(--ink) 3%, var(--paper)); }
.post .table-wide th:first-child { background: color-mix(in srgb, var(--ink) 5%, var(--paper)); }
/* the edge where more of the table is hidden fades out (blog.js marks it) */
.post .table.more-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 56px), rgba(0,0,0,.25)); mask-image: linear-gradient(90deg, #000 calc(100% - 56px), rgba(0,0,0,.25)); }
.table-hint { display: none; margin: -18px 0 22px; font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); text-align: right; }
.table.more-r + .table-hint, .table.more-l + .table-hint { display: block; }

/* FAQ as accordions */
.post-faq { display: grid; gap: 10px; margin-top: 18px; }
.faq-item { border-radius: 18px; border: 1px solid var(--edge); background: var(--glass); transition: border-color .25s, background .25s; scroll-margin-top: 90px; }
.faq-item:hover { border-color: rgba(17,17,20,.22); }
.faq-item[open] { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: radial-gradient(100% 120% at 0% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%), var(--glass); }
.faq-item summary { display: flex; align-items: center; gap: 16px; padding: 17px 18px 17px 22px; cursor: pointer; list-style: none; border-radius: 18px; }
.faq-item summary::-webkit-details-marker { display: none; }
.blog-page .post .faq-item h3 { flex: 1; margin: 0; font: 600 17.5px/1.35 var(--body); letter-spacing: -.015em; }
.faq-x { position: relative; flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--edge); transition: transform .35s var(--ease), background .25s, border-color .25s; }
.faq-x::before, .faq-x::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 1.6px; margin: -.8px 0 0 -5.5px; border-radius: 2px; background: var(--text); }
.faq-x::after { transform: rotate(90deg); }
.faq-item[open] .faq-x { transform: rotate(45deg); background: var(--accent); border-color: var(--accent); }
.faq-item[open] .faq-x::before, .faq-item[open] .faq-x::after { background: var(--paper); }
.faq-a { padding: 0 22px 18px; }
.faq-a > :first-child { margin-top: 0; }

/* ---------- calls to action, with a little squad ---------- */
.post .btn { text-decoration: none; }
.post .btn-light { color: var(--paper); } .post .btn-light:hover { color: var(--ink); }
.post .btn-ghost { color: var(--text); }
.cta-squad { position: relative; display: flex; align-items: flex-end; }
.cta-squad::after { content: ""; position: absolute; left: -10px; right: -10px; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(17,17,20,.32) 18%, rgba(17,17,20,.32) 82%, transparent); }
.cta-squad i { flex: none; clip-path: inset(-60% -60% 0 -60%); }
.cta-squad svg.mochi { overflow: visible; translate: 0 12%; }
.cta-squad i + i { margin-left: -9px; }
@keyframes sq-hop { 40% { transform: translateY(-14%) scale(.97, 1.04); } 70% { transform: translateY(1px) scale(1.04, .96); } }
.cta-inline:hover .cta-squad svg, .cta-end:hover .cta-squad svg { animation: sq-hop .7s var(--ease) calc(var(--i) * 70ms); }

.cta-inline { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px 20px; margin: 44px 0 10px; padding: 16px 16px 16px 20px; border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  background: radial-gradient(90% 160% at 0% 50%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%), var(--glass); }
.cta-inline .cta-squad i { width: 42px; height: 42px; }
.blog-page .post .cta-inline p { margin: 0; font-size: 15.5px; line-height: 1.45; color: var(--text); font-weight: 500; }

.cta-end { position: relative; overflow: hidden; margin-top: 72px; padding: 30px 30px 30px; border-radius: 28px; text-align: center; isolation: isolate;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--edge)); background: var(--glass); }
.cta-end::before { content: ""; position: absolute; inset: -40% -20% auto; height: 120%; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%); }
.cta-end .cta-squad { justify-content: center; width: max-content; max-width: 100%; margin: 0 auto 22px; }
.cta-end .cta-squad i { width: 64px; height: 64px; }
.blog-page .post .cta-end h2 { margin: 0 0 10px; font-size: clamp(30px, 3.6vw, 42px); letter-spacing: -.05em; }
.blog-page .post .cta-end h2::before { display: none; }
.blog-page .post .cta-end p { max-width: 50ch; margin-left: auto; margin-right: auto; color: var(--dim); font-size: 16px; }
.doc .cta-end .cta-row { justify-content: center; margin-top: 22px; }

/* author */
.blog-page .author-box { margin-top: 18px; padding: 22px 24px; border-radius: 22px; background: var(--glass); align-items: center; }
.author-box .author-m { width: 64px; height: 64px; flex: none; }
.author-page .author-avatar { width: 88px; height: 88px; margin: 8px 0 22px; }

/* ---------- cards (index, related, author page) ---------- */
.doc .pgrid { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 16px; }
.doc .pgrid > li { margin: 0; }
.doc .pcard > a { position: relative; display: flex; flex-direction: column; height: 100%; padding: 24px 24px 20px; border-radius: 24px; overflow: hidden; isolation: isolate;
  border: 1px solid var(--edge); background: var(--glass); text-decoration: none; color: var(--text);
  transition: border-color .35s, transform .5s var(--ease), box-shadow .5s var(--ease); }
.pcard > a::before { content: ""; position: absolute; inset: -30% -30% auto auto; width: 90%; height: 90%; z-index: -1; pointer-events: none; opacity: .18; transition: opacity .5s;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 55%, transparent), transparent); }
.doc .pcard > a:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); transform: translateY(-3px); box-shadow: 0 26px 50px -36px color-mix(in srgb, var(--accent) 80%, rgba(17,17,20,.5)); }
.pcard > a:hover::before { opacity: 1; }
.doc .pcard > a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 24px; }
.pcard-m { width: 64px; height: 64px; margin-bottom: 18px; transition: transform .5s var(--ease); transform-origin: 50% 100%; }
.pcard > a:hover .pcard-m { transform: translateY(-4px) rotate(-4deg); }
.doc .pcard b, .blog-page .doc .pcard h2 { display: block; margin: 0; font: 650 19px/1.22 var(--body); letter-spacing: -.025em; color: var(--text); }
.blog-page .doc .pcard h2::before { display: none; }
.doc .pcard .pcard-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; margin: 10px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--dim); }
.pcard .pcard-text strong { color: var(--dim); font-weight: 500; }
.pcard-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: auto; padding-top: 20px; font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.pcard-meta em { font-style: normal; white-space: nowrap; color: color-mix(in srgb, var(--accent) 58%, black); }
.pcard-meta em i { display: inline-block; font-style: normal; transition: transform .35s var(--ease); }
.pcard > a:hover .pcard-meta em i { transform: translateX(4px); }
.post-related h2 + .pgrid { margin-top: 0; }

/* ---------- blog index ---------- */
.blog-page .doc.blog-index { max-width: 1120px; }
.blog-hero { position: relative; isolation: isolate; padding: 18px 0 86px; margin-bottom: 40px; border-bottom: 1px solid var(--edge); }
.blog-hero::before { content: ""; position: absolute; z-index: -1; pointer-events: none; left: -10%; right: -10%; top: -160px; height: 620px;
  background: none; }
.blog-hero .kicker { margin-bottom: 20px; }
.blog-page .doc .blog-hero h1 { font: 800 clamp(44px, 6.8vw, 122px)/.92 var(--body); letter-spacing: -.055em; text-wrap: balance; }
.blog-hero h1 > span { display: block; }
.blog-hero h1 .nw { white-space: nowrap; }
.blog-page .doc .blog-hero .lead { margin: 36px 0 0; max-width: 54ch; }
.hero-peek { --w: clamp(84px, 13vw, 168px); position: absolute; right: 5%; bottom: 0; width: var(--w); height: calc(var(--w) * .78); cursor: pointer; }
.hp-clip { position: absolute; inset: 0; clip-path: inset(-60% -60% 0 -60%); }
.hp-bob { position: absolute; left: 0; top: 0; width: var(--w); height: var(--w); transform-origin: 50% 100%; }
.hero-peek svg.mochi, .peek svg.mochi { overflow: visible; }
.hp-hand { position: absolute; bottom: -7px; width: 18%; height: 13px; border-radius: 45% 45% 50% 50%; background: radial-gradient(70% 80% at 50% 25%, #fff, #e4e4e4 60%, #bdbdbd); box-shadow: 0 5px 10px -5px rgba(17,17,20,.3); }
.hp-hand.l { left: 26%; } .hp-hand.r { right: 26%; }
.hero-peek.glance .mochi-eyes { animation: hp-look 1.9s var(--ease); }
.hero-peek.glance .hp-bob { animation: hp-tilt 1.9s var(--ease); }
@keyframes hp-look { 20%, 42% { transform: translate(-2.6px, -.4px); } 58%, 80% { transform: translate(2.6px, -.4px); } }
@keyframes hp-tilt { 25% { rotate: -4deg; } 65% { rotate: 4deg; } }
.hero-peek.bounce .hp-bob, .peek.bounce .peek-squish { animation: m-bounce .7s var(--ease); }
@keyframes m-bounce { 25% { scale: 1.08 .9; } 50% { scale: .94 1.08; translate: 0 -12%; } 75% { scale: 1.03 .97; } }
.doc .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.post-grid .pcard:first-child { grid-column: 1 / -1; }
@media (max-width: 640px) { .doc .post-grid { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 861px) {
  .post-grid .pcard:first-child > a { display: grid; grid-template-columns: minmax(0, 1fr) 200px; grid-template-rows: auto auto 1fr auto; column-gap: 40px; padding: 34px 36px 26px; }
  .post-grid .pcard:first-child .pcard-m { grid-column: 2; grid-row: 1 / 5; align-self: center; width: 170px; height: 170px; margin: 0 auto; }
  .blog-page .doc .post-grid .pcard:first-child h2 { grid-column: 1; grid-row: 1; font-size: clamp(28px, 3vw, 40px); line-height: 1.05; letter-spacing: -.045em; }
  .post-grid .pcard:first-child .pcard-text { grid-column: 1; grid-row: 2; font-size: 16px; -webkit-line-clamp: 3; max-width: 62ch; }
  .post-grid .pcard:first-child .pcard-meta { grid-column: 1; grid-row: 4; }
  .post-grid .pcard:first-child > a::before { inset: -40% -10% auto auto; width: 60%; height: 140%; }
}

/* ---------- sources: small and quiet ---------- */
.blog-page .post .sources h2 { margin-top: 64px; font: 500 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.blog-page .post .sources h2::before { display: none; }
.blog-page .post .sources p, .blog-page .post .sources li { font-size: 13px; line-height: 1.6; color: var(--faint); }
.blog-page .post .sources a { color: var(--faint); text-decoration-color: rgba(17,17,20,.2); }
.blog-page .post .sources a:hover { color: var(--text); }

/* ---------- reading progress ---------- */
.read-progress { position: fixed; z-index: 70; left: 0; right: 0; top: 0; height: 3px; pointer-events: none; }
.read-progress i { display: block; height: 100%; transform: scaleX(0); transform-origin: 0 50%; border-radius: 0 3px 3px 0;
  background: var(--accent); }

/* ---------- the article's Mochi: it sits on a small glass ledge in the margin, fully visible, and travels with your reading ---------- */
.peek { --s: 84px; position: fixed; z-index: 40; left: 0; top: 0; width: calc(var(--s) + 24px); height: calc(var(--s) + 12px); display: none; transition: opacity .45s, filter .45s; }
.peek.on { display: block; }
.peek.tuck { opacity: 0; filter: blur(6px); pointer-events: none; }
.peek-in { position: absolute; inset: 0; animation: peek-in 1s var(--ease) .4s backwards; }
@keyframes peek-in { from { opacity: 0; translate: -18px 6px; } }
.peek-body { position: absolute; left: 0; right: 0; top: 0; height: var(--s); clip-path: inset(-80% -80% 0 -80%); }
.peek-tilt { position: absolute; left: 12px; top: 10px; width: var(--s); height: var(--s); transform-origin: 50% 100%; transform: rotate(7deg); }
.peek-squish { width: 100%; height: 100%; transform-origin: 50% 100%; cursor: pointer; }
.peek-eyes { transition: transform .35s var(--ease); }
.peek-shelf { position: absolute; left: 0; right: 0; top: calc(var(--s) - 1px); height: 9px; border-radius: 6px; pointer-events: none;
  background: var(--ink); border: 0;
  box-shadow: 0 12px 18px -12px rgba(17,17,20,.35); }
.peek-hand { position: absolute; top: calc(var(--s) - 5px); width: 16px; height: 12px; border-radius: 45% 45% 50% 50%; pointer-events: none;
  background: radial-gradient(80% 90% at 50% 25%, color-mix(in srgb, var(--m) 85%, white), var(--m) 60%, color-mix(in srgb, var(--m) 70%, black));
  box-shadow: 0 3px 5px -2px rgba(17,17,20,.3); }
.peek-hand.l { left: calc(12px + var(--s) * .26); } .peek-hand.r { left: calc(12px + var(--s) * .62); }
.peek.glance .peek-squish { animation: peek-tilt 2s var(--ease); }
@keyframes peek-tilt { 20% { rotate: -8deg; } 55% { rotate: 6deg; } }
.peek.hop .peek-tilt, .peek.hop .peek-hand { animation: peek-hop .9s var(--ease); }
@keyframes peek-hop { 30% { translate: 0 -18px; scale: .96 1.05; } 55% { translate: 0 0; scale: 1.05 .95; } 72% { translate: 0 -6px; scale: 1; } }
.peek.doze .mochi-blink { animation: none; transform: scaleY(.12); }
.peek.doze .peek-squish { animation: peek-breathe 3.6s ease-in-out infinite; }
@keyframes peek-breathe { 50% { scale: 1.03 .98; } }
.peek-z { position: absolute; left: calc(var(--s) * .78); top: -14px; display: flex; gap: 2px; font: 700 14px var(--body); color: var(--faint); pointer-events: none; opacity: 0; transition: opacity .6s; }
.peek-z b { animation: peek-z 2.6s ease-in-out infinite; } .peek-z b:nth-child(2) { animation-delay: .35s; font-size: 17px; } .peek-z b:nth-child(3) { animation-delay: .7s; font-size: 20px; }
@keyframes peek-z { 0%, 100% { translate: 0 4px; opacity: .3; } 50% { translate: 0 -6px; opacity: 1; } }
.peek.doze .peek-z { opacity: 1; }

/* ---------- smaller screens ---------- */
@media (max-width: 860px) {
  .lead-box { grid-template-columns: 46px minmax(0, 1fr); gap: 14px; padding: 18px 18px 18px 14px; }
  .lead-m { width: 46px; height: 46px; }
  .blog-page .post p, .blog-page .post li { font-size: 16.5px; }
  .cta-inline { grid-template-columns: auto minmax(0, 1fr); padding: 16px; }
  .cta-inline .btn { grid-column: 1 / -1; justify-self: start; }
  .cta-end { padding: 26px 18px; }
  .cta-end .cta-squad i { width: 52px; height: 52px; }
  .blog-hero { padding-bottom: 100px; }
  .hero-peek { right: 4%; }
}
@media (max-width: 480px) {
  .cta-inline { grid-template-columns: minmax(0, 1fr); }
  .blog-page .author-box { flex-direction: column; align-items: flex-start; }
  .doc .cta-end .cta-row .btn { flex: 1 1 auto; justify-content: center; }
  .doc .pcard > a { padding: 20px 20px 18px; }
}

/* quiet motion: the Mochis sit still */
@media (prefers-reduced-motion: reduce) {
  .mochi-blink, .peek-in, .peek-tilt, .peek-hand, .peek-squish, .peek-z b, .cta-squad svg, .hp-bob, .hero-peek .mochi-eyes { animation: none !important; }
  .doc .pcard > a:hover, .pcard > a:hover .pcard-m { transform: none; }
}

/* accent: the second line of the blog's headline, and what you can follow */
.blog-hero h1 .soft { color: var(--accent); }
.dnav-blog[aria-current="page"] { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 6px; }
