/* Blog: the list of posts and a single post.
   Same world as the rest of the site (site.css holds the tokens, header and footer). These pages are
   for reading, so the type gets larger and looser and everything else stays out of its way.
   Each post borrows the tint of the app it is about, set as --tint on the element. */

html { scrollbar-color: #24406b var(--ground); }
::selection { background: var(--blue); color: #03101f; }

.blog { padding: clamp(118px, 15vw, 176px) 0 clamp(72px, 10vw, 130px); }

/* ================= List ================= */
.blog__head { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: end; gap: 20px clamp(28px, 5vw, 72px); }
.blog__title { font: 700 clamp(2.4rem, 5.6vw, 4.6rem)/1.02 var(--display); letter-spacing: -.04em; text-wrap: balance; }
.blog__lede { max-width: 30rem; padding-bottom: .5em; color: var(--ink-2); font-size: clamp(16px, 1.3vw, 18px); }

.topics { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: clamp(36px, 5vw, 60px); }
.topic {
  min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: none; color: var(--ink-2);
  font: 500 14.5px/1 var(--body); cursor: pointer;
  transition: color .2s, border-color .2s, background-color .2s;
}
.topic:hover { color: var(--ink); border-color: #2a4674; }
.topic[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #03101f; }
.topics__count { margin-left: auto; font: 400 12px/1 var(--mono); letter-spacing: .04em; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* Post art: screens from the app on a panel lit by its tint. */
.art {
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid color-mix(in srgb, var(--tint) 24%, var(--line));
  border-radius: 16px;
  background:
    radial-gradient(62% 85% at 68% 22%, color-mix(in srgb, var(--tint) 36%, transparent), transparent 72%),
    var(--ground-2);
}
.art__s {
  position: absolute; top: 13%; width: 30%; height: auto;
  border-radius: 9% / 4.4%;
  box-shadow: 0 26px 46px -20px rgba(0,0,0,.75);
  transition: transform .7s var(--ease);
}
.art__s--a { left: 21%; transform: rotate(-5deg); }
.art__s--b { left: 50%; top: 22%; transform: rotate(4deg); }
.art__mark { position: absolute; left: 50%; top: 50%; width: 46%; height: auto; translate: -50% -50%; fill: none; stroke: var(--pale); stroke-width: 3; stroke-linecap: round; opacity: .5; }

/* The newest post, large. */
.lead {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center;
  gap: clamp(24px, 4vw, 60px);
  margin-top: clamp(24px, 3vw, 36px);
}
.lead[hidden] { display: none; }
.lead:hover .art__s--a { transform: rotate(-6deg) translateY(-3%); }
.lead:hover .art__s--b { transform: rotate(5deg) translateY(-4%); }
.lead__title { margin-top: 14px; font: 600 clamp(1.7rem, 3vw, 2.5rem)/1.08 var(--display); letter-spacing: -.035em; text-wrap: balance; }
.lead__text { margin-top: 16px; max-width: 34rem; color: var(--ink-2); font-size: clamp(16px, 1.25vw, 17.5px); text-wrap: pretty; }
.lead__more { display: inline-block; margin-top: 22px; color: var(--blue); font-weight: 600; transition: color .2s; }
.lead:hover .lead__more { color: var(--pale); }

/* Date, topic, reading time: one line of small mono facts. */
.meta { display: flex; flex-wrap: wrap; gap: 4px 0; font: 400 12px/1.5 var(--mono); letter-spacing: .04em; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.meta > * + *::before { content: "·"; margin: 0 .7em; opacity: .6; }
.meta__app { color: color-mix(in srgb, var(--tint, #17a2ff) 55%, var(--pale)); }

/* A title link whose hit area is its whole row or panel. */
.cover { text-decoration: none; }
.cover::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.cover:focus-visible { outline: none; }
.cover:focus-visible::after { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 14px; }

/* Every other post: a row. */
.posts { margin-top: clamp(40px, 6vw, 72px); border-top: 1px solid var(--line); }
.post {
  position: relative;
  display: grid; grid-template-columns: 128px minmax(0, 1fr) 148px; align-items: center;
  gap: 16px clamp(18px, 3vw, 40px);
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.post[hidden] { display: none; }
.post__date { align-self: start; padding-top: 7px; font: 400 12px/1.5 var(--mono); letter-spacing: .04em; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.post__title { font: 600 clamp(1.2rem, 1.9vw, 1.55rem)/1.16 var(--display); letter-spacing: -.03em; text-wrap: balance; transition: color .2s; }
.post:hover .post__title { color: var(--pale); }
.post__text { margin-top: 8px; max-width: 40rem; color: var(--ink-2); font-size: 15.5px; line-height: 1.5; text-wrap: pretty; }
.post .meta { margin-top: 12px; }
.post .meta__date { display: none; }
.post .meta__date + *::before { content: none; }

.thumb {
  position: relative; overflow: hidden;
  width: 148px; aspect-ratio: 3 / 2;
  border-radius: 12px;
  background:
    radial-gradient(80% 100% at 70% 10%, color-mix(in srgb, var(--tint) 42%, transparent), transparent 75%),
    var(--ground-2);
}
.thumb img { position: absolute; left: 23%; top: 14%; width: 54%; height: auto; border-radius: 9% / 4.4%; box-shadow: 0 10px 20px -8px rgba(0,0,0,.7); transition: transform .5s var(--ease); }
.post:hover .thumb img { transform: translateY(-9%); }
.thumb svg { position: absolute; left: 50%; top: 50%; width: 44%; height: auto; translate: -50% -50%; fill: none; stroke: var(--pale); stroke-width: 4; stroke-linecap: round; opacity: .55; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 36px; font: 400 12px/1 var(--mono); letter-spacing: .04em; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pager[hidden] { display: none; }
.pager__links { display: flex; gap: 10px; }
.pager__links .btn { min-height: 44px; padding: 0 20px; font-size: 14.5px; }
.pager__links .btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }

/* ================= Single post ================= */
/* How far down the post you are: a line across the very top. */
.read-bar { position: fixed; inset: 0 0 auto; z-index: 40; height: 2px; background: var(--blue); transform: scaleX(var(--read, 0)); transform-origin: 0 50%; pointer-events: none; }

.article__head { max-width: 54rem; }
.back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500; transition: color .2s; }
.back:hover { color: var(--ink); }
.back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.back:hover svg { transform: translateX(-3px); }
.article__title { margin-top: 20px; font: 700 clamp(2.1rem, 4.8vw, 3.9rem)/1.04 var(--display); letter-spacing: -.04em; text-wrap: balance; }
.article__stand { margin-top: 22px; max-width: 44rem; font: 300 clamp(1.15rem, 1.9vw, 1.5rem)/1.4 var(--display); letter-spacing: -.02em; color: var(--pale); text-wrap: pretty; }
.article__head .meta { margin-top: 26px; }

.article__cover { margin: clamp(36px, 5vw, 60px) 0 0; }
.article__cover .art { aspect-ratio: 16 / 7.4; }
.article__cover .art__s { width: 19%; top: 12%; }
.article__cover .art__s--a { left: 19%; }
.article__cover .art__s--b { left: 40.500%; top: 20%; transform: rotate(1deg); }
.article__cover .art__s--c { left: 62%; top: 12%; transform: rotate(5deg); }

.article__body { display: grid; grid-template-columns: 210px minmax(0, 43rem); gap: clamp(32px, 6vw, 96px); margin-top: clamp(40px, 6vw, 76px); }

.toc { position: sticky; top: 104px; align-self: start; font-size: 14.5px; }
.toc__label { font: 400 12px/1.5 var(--mono); letter-spacing: .04em; color: var(--ink-2); }
.toc ol { margin-top: 14px; display: grid; gap: 2px; }
.toc a { display: block; padding: 7px 0; color: var(--ink-2); text-decoration: none; line-height: 1.35; transition: color .2s; }
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { color: var(--pale); }

/* The words. */
.prose { color: #d6e1f0; font-size: clamp(17px, 1.35vw, 19px); line-height: 1.68; }
.prose > * + * { margin-top: 1.3em; }
.prose h2 { margin-top: 2.3em; color: var(--ink); font: 600 clamp(1.45rem, 2.4vw, 1.9rem)/1.15 var(--display); letter-spacing: -.03em; text-wrap: balance; scroll-margin-top: 96px; }
.prose h2 + * { margin-top: .75em; }
.prose h3 { margin-top: 1.9em; color: var(--ink); font: 600 1.15em/1.25 var(--display); letter-spacing: -.02em; }
.prose h3 + * { margin-top: .55em; }
.prose p { text-wrap: pretty; }
.prose a { color: var(--pale); text-decoration: underline; text-decoration-color: var(--blue); text-decoration-thickness: 1.5px; text-underline-offset: .22em; transition: color .2s; }
.prose a:hover { color: var(--blue); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .5em; }
.prose li::marker { color: var(--blue); }
.prose code { padding: .12em .4em; border-radius: 6px; background: var(--ground-3); font: 400 .88em/1 var(--mono); color: var(--pale); }
.prose hr { height: 1px; margin: 2.6em 0; border: 0; background: var(--line); }

/* A line pulled out of the post: larger and lighter, held between two rules. */
.prose blockquote { margin: 2.2em 0; padding: 1.1em 0; border-block: 1px solid var(--line); }
.prose blockquote p { color: var(--ink); font: 300 clamp(1.3rem, 2.3vw, 1.75rem)/1.3 var(--display); letter-spacing: -.03em; text-wrap: balance; }

.prose figure { margin: 2.4em 0; }
.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: clamp(18px, 3vw, 34px) clamp(18px, 6vw, 72px) 0; overflow: hidden; border-radius: 16px; background: radial-gradient(70% 90% at 50% 0, color-mix(in srgb, var(--tint) 30%, transparent), transparent 75%), var(--ground-2); }
.shots img { width: 100%; border-radius: 9% / 4.4%; margin-bottom: -22%; box-shadow: 0 22px 40px -18px rgba(0,0,0,.75); }
.prose figcaption { margin-top: 12px; font: 400 12.5px/1.55 var(--mono); letter-spacing: .02em; color: var(--ink-2); }

/* An aside the reader should not miss. */
.note { padding: 18px 22px; border: 1px solid color-mix(in srgb, var(--tint) 34%, var(--line)); border-radius: 14px; background: color-mix(in srgb, var(--tint) 9%, var(--ground-2)); font-size: .94em; line-height: 1.55; }
.note strong { color: var(--ink); }

/* The app the post is about, at the foot of it. */
.plug { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 18px 20px; margin-top: 3em; padding: 22px; border-radius: 16px; background: var(--ground-2); }
.plug__icon { width: 64px; height: 64px; border-radius: 15px; }
.plug__name { color: var(--ink); font: 600 1.15rem/1.2 var(--display); letter-spacing: -.02em; }
.plug__line { margin-top: 4px; color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.plug__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
.plug__actions .btn { min-height: 44px; padding: 0 20px; text-decoration: none; }
.plug__actions .btn--solid, .plug__actions .btn--solid:hover { color: #03101f; }
.plug__actions .btn--ghost { color: var(--ink); }
.plug__actions .btn--ghost:hover { color: var(--pale); }

.more { margin-top: clamp(64px, 9vw, 116px); }
.more__title { font: 700 clamp(1.6rem, 3vw, 2.3rem)/1.05 var(--display); letter-spacing: -.04em; }
.more .posts { margin-top: 28px; }
.more__all { display: inline-block; margin-top: 28px; color: var(--blue); text-decoration: none; font-weight: 600; transition: color .2s; }
.more__all:hover { color: var(--pale); }

.nav__links a[aria-current="page"] { color: var(--ink); }

/* ---------- Narrower ---------- */
@media (max-width: 1080px) {
  .article__body { grid-template-columns: minmax(0, 43rem); justify-content: center; }
  .article__head { margin-inline: auto; max-width: 43rem; }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .blog__head { grid-template-columns: 1fr; }
  .blog__lede { padding-bottom: 0; }
  .lead { grid-template-columns: 1fr; }
  .post { grid-template-columns: minmax(0, 1fr) 112px; align-items: start; }
  .post__date { display: none; }
  .post .meta__date { display: inline; }
  .post .meta__date + *::before { content: "·"; }
  .thumb { width: 112px; }
  .plug { grid-template-columns: 56px minmax(0, 1fr); }
  .plug__icon { width: 56px; height: 56px; border-radius: 13px; }
  .article__cover .art { aspect-ratio: 16 / 10; }
  .article__cover .art__s { width: 27%; }
  .article__cover .art__s--a { left: 6%; }
  .article__cover .art__s--b { left: 36.500%; }
  .article__cover .art__s--c { left: 67%; }
}
@media (max-width: 520px) {
  .topics { flex-wrap: nowrap; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); overflow-x: auto; scrollbar-width: none; }
  .topics::-webkit-scrollbar { display: none; }
  .topic { flex: none; }
  .topics__count { display: none; }
  .post { grid-template-columns: minmax(0, 1fr) 84px; gap: 14px; padding: 22px 0; }
  .thumb { width: 84px; aspect-ratio: 1; border-radius: 10px; }
  .post__text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .pager { flex-direction: column-reverse; align-items: stretch; text-align: center; }
  .pager__links .btn { flex: 1; }
  .shots { gap: 10px; padding-inline: 14px; }
  .plug__actions { flex-direction: column; }
  /* Rows keep only the date and the app here: the full line of facts wraps badly beside a thumbnail. */
  .post .meta > :not(.meta__date):not(.meta__app) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .art__s, .thumb img, .back svg { transition: none; }
  .lead:hover .art__s--a { transform: rotate(-5deg); }
  .lead:hover .art__s--b { transform: rotate(4deg); }
  .post:hover .thumb img, .back:hover svg { transform: none; }
}
