/* awni.in writing: index and post templates. Shared tokens and components come from base.css. */
body { background: var(--bg) radial-gradient(120% 60% at 80% -10%, rgba(91, 10, 110, .28), transparent 60%) no-repeat; }
.w-sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: .7; }
main { padding: 0 var(--m); }

/* ---------- index ---------- */
.w-hero { padding: clamp(150px, 20vw, 260px) 0 0; display: grid; gap: 28px; max-width: 1180px; }
.w-title { font: 300 var(--t-mega)/.86 var(--display); letter-spacing: -.045em; margin-left: -.04em; }
.w-hero .lead { max-width: 40ch; color: var(--muted); }
.shelves { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.shelves[hidden] { display: none; }
.shelf { background: none; border: 0; box-shadow: inset 0 0 0 1px var(--line); padding: 12px 16px; cursor: pointer; font: 500 12px/1 var(--data); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); transition: color .3s, box-shadow .3s, background .3s; }
.shelf sup { font-size: 10px; margin-left: 4px; color: var(--faint); }
.shelf:hover { color: var(--ink); box-shadow: inset 0 0 0 1px rgba(236, 232, 223, .3); }
.shelf.on { color: var(--p0); background: var(--ink); box-shadow: none; }
.shelf.on sup { color: var(--p0); }

.w-list { margin-top: clamp(64px, 8vw, 120px); }
.entries { list-style: none; border-top: 1px solid var(--line); }
.entry { border-bottom: 1px solid var(--line); }
.entry[hidden] { display: none; }
.entry a { position: relative; display: grid; grid-template-columns: 4ch 11ch minmax(0, 1fr) 16ch 7ch 2ch; gap: 24px; align-items: baseline; padding: 28px 0; text-decoration: none; isolation: isolate; }
.entry a::before { content: ''; position: absolute; inset: 0 calc(var(--m) * -1); z-index: -1; background: linear-gradient(90deg, rgba(255, 46, 136, .1), transparent 70%); opacity: 0; transition: opacity .5s var(--ease); }
.entry a:hover::before, .entry a:focus-visible::before { opacity: 1; }
.entry .n, .entry time, .entry .k, .entry .r { font: 400 12px/1.4 var(--data); letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.entry .n { color: var(--faint); }
.entry .t { display: grid; gap: 8px; }
.entry .t b { font: 400 clamp(26px, 2.8vw, 42px)/1.05 var(--display); letter-spacing: -.02em; font-weight: 300; transition: transform .6s var(--ease), color .3s; }
.entry .t .s { color: var(--muted); max-width: 62ch; font-size: var(--t-small); }
.entry .arr { font: 400 22px/1 var(--text); color: var(--accent); opacity: 0; transform: translateX(-10px); transition: .5s var(--ease); }
.entry a:hover .t b { transform: translateX(10px); }
.entry a:hover .arr { opacity: 1; transform: none; }
.empty, .empty-shelf { padding: 64px 0; display: grid; gap: 18px; color: var(--muted); }
.empty[hidden], .empty-shelf[hidden] { display: none; }

/* ---------- post ---------- */
.progress { position: fixed; inset: 0 0 auto; height: 2px; z-index: 30; pointer-events: none; }
.progress i { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
.post { max-width: 1240px; margin: 0 auto; }
.post-head { padding: clamp(150px, 18vw, 240px) 0 0; display: grid; gap: 26px; max-width: 1080px; }
.post-title { font: 300 var(--t-h1)/.95 var(--display); letter-spacing: -.035em; text-wrap: balance; }
.post-sum { color: var(--muted); max-width: 46ch; }
.draft { color: var(--accent); }
.meta { display: flex; flex-wrap: wrap; gap: 16px 48px; padding-top: 22px; border-top: 1px solid var(--line); margin-top: 12px; }
.meta dt { font: 500 11px/1 var(--data); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.meta dd { font-size: var(--t-small); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font: 400 11px/1 var(--data); letter-spacing: .08em; text-transform: uppercase; padding: 6px 8px; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }

.cover { margin: clamp(48px, 6vw, 88px) calc(var(--m) * -1) 0; }
.cover img { width: 100%; max-height: 78svh; object-fit: cover; }
.cover figcaption { padding: 12px var(--m) 0; font: 400 12px/1.5 var(--data); color: var(--muted); letter-spacing: .04em; }

.spec { margin-top: clamp(48px, 6vw, 80px); padding: clamp(24px, 3vw, 40px); background: var(--surface); display: grid; gap: 22px; max-width: 980px; }
.spec dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px 36px; }
.spec dt { font: 500 11px/1 var(--data); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.spec dd, .spec li { font-size: var(--t-small); color: var(--ink); }
.spec ul { padding-left: 1.1em; display: grid; gap: 4px; }

.post-body { display: grid; grid-template-columns: minmax(0, 1fr); margin-top: clamp(56px, 7vw, 104px); gap: 56px; }
.post.has-toc .post-body { grid-template-columns: 220px minmax(0, 1fr); }
.toc { position: sticky; top: 110px; align-self: start; display: grid; gap: 16px; }
.toc ol { list-style: none; display: grid; gap: 10px; border-left: 1px solid var(--line); }
.toc li a { display: block; padding-left: 14px; margin-left: -1px; border-left: 1px solid transparent; text-decoration: none; color: var(--muted); font-size: 14px; line-height: 1.35; transition: color .3s, border-color .3s; }
.toc li.d3 a { padding-left: 26px; font-size: 13px; }
.toc li a:hover, .toc li a.on { color: var(--ink); border-color: var(--accent); }

/* the reading column */
.prose { max-width: 68ch; font: 400 18px/1.75 var(--text); color: #d9d5cc; }
.prose > * + * { margin-top: 1.25em; }
.prose h2 { font: 300 clamp(30px, 3vw, 44px)/1.08 var(--display); letter-spacing: -.02em; color: var(--ink); margin-top: 2.6em; position: relative; }
.prose h3 { font: 400 clamp(22px, 1.9vw, 28px)/1.2 var(--display); color: var(--ink); margin-top: 2em; position: relative; }
.prose h4 { font: 500 12px/1.4 var(--data); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-top: 2em; }
.prose .anchor { position: absolute; left: -1.1em; color: var(--faint); text-decoration: none; opacity: 0; transition: opacity .2s; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .22em; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--accent-hi); }
.prose strong { color: var(--ink); font-weight: 500; }
.prose em { font-style: italic; }
.prose ul, .prose ol { padding-left: 1.3em; display: grid; gap: .45em; }
.prose li::marker { color: var(--accent); }
.prose blockquote { border-left: 1px solid var(--accent); padding: .2em 0 .2em 1.4em; font: 300 italic clamp(22px, 2vw, 28px)/1.4 var(--display); color: var(--ink); }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 3em 0; }
.prose :not(pre) > code { font: 400 .86em/1 var(--data); background: var(--surface-2); padding: .18em .4em; color: var(--pt); }
.prose pre { position: relative; background: #070816; box-shadow: inset 0 0 0 1px var(--line); padding: 22px 24px; overflow-x: auto; font: 400 14px/1.7 var(--data); margin-left: -24px; margin-right: -24px; }
.prose pre code { font: inherit; }
.prose .copy { position: absolute; top: 10px; right: 10px; background: var(--surface-2); border: 0; color: var(--muted); font: 500 10px/1 var(--data); letter-spacing: .14em; text-transform: uppercase; padding: 7px 9px; cursor: pointer; opacity: 0; transition: opacity .2s; }
.prose pre:hover .copy, .prose .copy:focus-visible { opacity: 1; }
.prose figure { margin: 2.4em -24px; }
.prose figure img { width: 100%; }
.prose figcaption { margin-top: 10px; font: 400 12px/1.5 var(--data); color: var(--muted); letter-spacing: .04em; padding: 0 24px; }
.prose .table { overflow-x: auto; margin-left: -24px; margin-right: -24px; padding: 0 24px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th { text-align: left; font: 500 11px/1.4 var(--data); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line); }
.prose td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }

/* callouts: :::note, :::tradeoff, :::warning, :::aside, :::numbers */
.callout { background: var(--surface); padding: 22px 24px; margin-left: -24px; margin-right: -24px; box-shadow: inset 2px 0 0 var(--faint); font-size: 16px; }
.callout > * + * { margin-top: .8em; }
.callout-h { font: 500 11px/1 var(--data); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.callout.tradeoff { box-shadow: inset 2px 0 0 var(--pl); } .callout.tradeoff .callout-h { color: var(--pl); }
.callout.warning { box-shadow: inset 2px 0 0 var(--accent); } .callout.warning .callout-h { color: var(--accent); }
.callout.numbers { box-shadow: inset 2px 0 0 var(--ink); font-family: var(--data); font-size: 14px; }
.callout.aside { background: none; box-shadow: none; font: 300 italic 20px/1.5 var(--display); color: var(--muted); padding-left: 24px; }

/* journal: slower, larger, a drop cap */
.k-journal .post-head { text-align: center; justify-items: center; margin: 0 auto; }
.k-journal .post-title { font-style: italic; }
.k-journal .meta { justify-content: center; }
.k-journal .post-body { justify-items: center; }
.k-journal .prose { font: 300 clamp(20px, 1.6vw, 23px)/1.7 var(--display); color: var(--ink); max-width: 36em; }
.k-journal .prose > p:first-of-type::first-letter { float: left; font: 300 5.2em/.8 var(--display); margin: .06em .1em 0 0; color: var(--accent); }

/* learning: a short note, a narrow column */
.k-learning .post-title { font-size: var(--t-h2); }
.k-learning .post-head { max-width: 860px; }

/* ---------- end of a post ---------- */
.post-end { margin-top: clamp(80px, 10vw, 140px); padding-top: 40px; border-top: 1px solid var(--line); display: grid; gap: 36px; }
.sig { font: 300 italic clamp(36px, 4vw, 60px)/1 var(--display); letter-spacing: -.02em; }
.sig .star { display: inline-block; width: .12em; height: .12em; border-radius: 50%; background: var(--accent); vertical-align: .5em; margin-left: .1em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.nearby { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.near { display: grid; gap: 10px; padding: 24px; background: var(--surface); text-decoration: none; transition: background .4s; }
.near.older { text-align: right; justify-items: end; }
.near b { font: 300 clamp(22px, 2vw, 30px)/1.15 var(--display); }
.near:hover { background: var(--surface-2); }

/* the home page's latest list reuses these */
@media (max-width: 960px) {
  .post.has-toc .post-body { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 760px) {
  .entry a { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; padding: 22px 0; }
  .entry .n, .entry .arr { display: none; }
  .entry time { grid-row: 1; }
  .entry .k { grid-row: 1; grid-column: 2; text-align: right; }
  .entry .t { grid-column: 1 / -1; }
  .entry .r { display: none; }
  .prose { font-size: 17px; }
  .prose pre, .prose .callout, .prose figure, .prose .table { margin-left: calc(var(--m) * -1); margin-right: calc(var(--m) * -1); }
  .nearby { grid-template-columns: minmax(0, 1fr); }
  .near.older { text-align: left; justify-items: start; }
}

/* code colours, in the site's palette */
.hljs { color: #d9d5cc; }
.hljs-comment, .hljs-quote { color: #6b6876; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-type { color: var(--accent-hi); }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute { color: var(--pl); }
.hljs-number, .hljs-literal, .hljs-symbol, .hljs-bullet { color: var(--pt); }
.hljs-title, .hljs-section, .hljs-function .hljs-title { color: var(--ink); font-weight: 500; }
.hljs-variable, .hljs-template-variable, .hljs-attr, .hljs-property { color: #c9a8ff; }
.hljs-meta, .hljs-deletion { color: var(--muted); }

/* the post eyebrow wraps between phrases, never inside one */
.post-head .eyebrow { flex-wrap: wrap; row-gap: 10px; }
.post-head .eyebrow > * { white-space: nowrap; }
