/*
  Deep Field, a Ghost theme for trinadh.com
  Posts are presented like space telescope image releases. Subjects are infrared
  filters (Physics F150W blue, Essays F277W green, Compute F444W orange); list
  thumbnails are shown through their subject's filter. One signature motion:
  the hero image is composed from three colour-channel exposures on load.

  1. Tokens          5. Release (homepage hero)   9. Post
  2. Base            6. Plates, recent            10. Ghost content + cards
  3. Utilities       7. Archive rows, filter      11. Subscribe, footer
  4. Header          8. Pagination, list heads    12. Motion, responsive
*/

/* 1. Tokens ---------------------------------------------------------------- */
:root {
    --bg: oklch(0.165 0.004 260);
    --raised: oklch(0.2 0.005 260);
    --well: oklch(0.13 0.004 260);
    --rule: oklch(0.32 0.006 260);
    --ink: oklch(0.97 0.003 260);
    --body: oklch(0.87 0.005 260);
    --quiet: oklch(0.74 0.008 260);

    --physics: oklch(0.80 0.11 235);
    --essays: oklch(0.83 0.14 150);
    --compute: oklch(0.80 0.14 60);

    /* Ghost's font settings (Design > Brand) override these when set */
    --display: var(--gh-font-heading, 'STIX Two Text', Georgia, serif);
    --sans: var(--gh-font-body, 'Atkinson Hyperlegible Next', system-ui, sans-serif);
    --mono: 'Atkinson Hyperlegible Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    --gutter: clamp(1rem, 4vw, 3rem);
    --measure: 45rem;
    --wide: 68rem;
    --note: 15rem;
    --r: 2px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--body); font-family: var(--sans); font-size: 1.08rem; line-height: 1.65; -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: inherit; }
img, svg, video { display: block; max-width: 100%; }
img, video { height: auto; } /* keep intrinsic proportions when width/height attributes are present */
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
::selection { background: var(--c, var(--physics)); color: var(--well); }
.site { min-height: 100vh; display: flex; flex-direction: column; }
#main { flex: 1; }

/* 3. Utilities ------------------------------------------------------------- */
.wrap { width: min(1280px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.col { width: min(var(--measure), 100% - 2 * var(--gutter)); margin-inline: auto; }
.wide, .col-wide { width: min(var(--wide), 100% - 2 * var(--gutter)); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.disp { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.band { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--mono); font-size: .8rem; color: var(--c); white-space: nowrap; text-decoration: none; }
.band svg { width: 30px; height: 10px; flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 1.5rem; font-weight: 600; color: var(--well); background: var(--ink); padding: .8rem 1.1rem; border-radius: var(--r); text-decoration: none; transition: background-color .2s var(--ease); }
.btn:hover { background: var(--c, var(--compute)); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; transition: transform .3s var(--expo); }
.btn:hover svg { transform: translateX(3px); }
.sec-title { font-size: clamp(1.5rem, 2.6vw, 1.95rem); line-height: 1.1; }

/* 4. Header ---------------------------------------------------------------- */
.top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.3rem 0; border-bottom: 1px solid var(--rule); }
.top__name { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 1.02rem; }
.top__name svg { width: 30px; height: 10px; }
.top__logo { height: 28px; width: auto; }
.top__nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .25rem 1.75rem; }
.top__nav a { text-decoration: none; color: var(--quiet); transition: color .2s var(--ease); }
.top__nav a:hover, .top__nav a[aria-current] { color: var(--ink); }
.top__nav a[aria-current] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }

/* 5. Release (homepage hero) ----------------------------------------------- */
.release { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); margin-top: clamp(1.5rem, 4vw, 2.5rem); border: 1px solid var(--rule); border-radius: var(--r); }
.release--no-image { grid-template-columns: minmax(0, 1fr); }
.release__fig { position: relative; display: block; background: #000; overflow: hidden; border-right: 1px solid var(--rule); }
.release__frame { position: relative; height: 100%; min-height: 30rem; }
.release__frame > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.overlay-mark { position: absolute; z-index: 2; color: #fff; filter: drop-shadow(0 0 2px rgb(0 0 0 / .9)) drop-shadow(0 0 6px rgb(0 0 0 / .5)); pointer-events: none; }
.scalebar { right: 1rem; bottom: 1rem; font-family: var(--mono); font-size: .76rem; text-align: right; }
.scalebar i { display: block; width: 80px; height: 2px; background: currentColor; margin: 0 0 .35rem auto; position: relative; }
.scalebar i::before, .scalebar i::after { content: ''; position: absolute; top: -4px; width: 2px; height: 10px; background: currentColor; }
.scalebar i::before { left: 0; } .scalebar i::after { right: 0; }
.sheet { display: grid; align-content: space-between; gap: 2rem; padding: clamp(1.5rem, 3vw, 2.5rem); }
.sheet__k { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-family: var(--mono); font-size: .8rem; color: var(--quiet); }
.sheet__title { margin-top: 1.1rem; font-size: clamp(2.2rem, 4vw, 3.6rem); line-height: 1.02; text-wrap: balance; }
.sheet__title a { text-decoration: none; }
.sheet__title a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.sheet__dek { margin-top: 1rem; font-size: 1.1rem; text-wrap: pretty; max-width: 40ch; }
.facts { border-top: 1px solid var(--rule); margin-bottom: 1.4rem; }
.facts div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--rule); font-size: .95rem; }
.facts dt { font-family: var(--mono); font-size: .78rem; color: var(--quiet); padding-top: .15rem; }
.facts dd { color: var(--ink); }
.facts dd a { color: inherit; }
.legend { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: .9rem; }

/* Channel registration entrance (shared by the homepage hero and post figure 1) */
.js-develop [data-develop] { opacity: 0; }
.js-develop .developing [data-develop], .js-develop .revealed [data-develop], .vt-arrived [data-develop] { opacity: 1; }
.chs { display: none; position: absolute; inset: 0; z-index: 1; background: #000; isolation: isolate; }
.ch { position: absolute; inset: 0; background-size: cover; background-position: center; mix-blend-mode: screen; opacity: 0; }
.ch--b { filter: url(#ch-b); --dx: 24px; --dy: -8px; --d: .05s; }
.ch--g { filter: url(#ch-g); --dx: -6px; --dy: 14px; --d: .22s; }
.ch--r { filter: url(#ch-r); --dx: -22px; --dy: -6px; --d: .39s; }

/* 6. Plates, recent ---------------------------------------------------------- */
/* Thumbnail seen through its subject's filter: greyscale, multiplied onto the filter colour, blacks lifted to the page */
/* The filter colour is a multiply layer above the image, so an image that has not loaded yet reads as a dark tinted plate, not a flat colour block */
.plate { position: relative; background: var(--raised); isolation: isolate; overflow: hidden; border-radius: var(--r); }
.plate img { position: relative; z-index: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.15) brightness(1.06); }
.plate::before, .plate::after { content: ''; position: absolute; inset: 0; pointer-events: none; }
.plate::before { z-index: 1; background: var(--c); mix-blend-mode: multiply; }
.plate::after { z-index: 2; background: var(--bg); mix-blend-mode: lighten; }
.plate:not(:has(img))::before { display: none; }
.plate:not(:has(img))::after { mix-blend-mode: normal; background: linear-gradient(var(--c), var(--c)) bottom / 100% 3px no-repeat; }

.recent { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(1.25rem, 3vw, 2.5rem); padding-top: clamp(3.5rem, 8vw, 5.5rem); }
.recent .sec-title { grid-column: 1 / -1; padding-bottom: .9rem; border-bottom: 1px solid var(--rule); }
.big { text-decoration: none; display: grid; gap: .9rem; align-content: start; }
.big .plate, .small .plate { outline: 1px solid transparent; outline-offset: 3px; transition: outline-color .2s var(--ease); }
.big .plate { aspect-ratio: 16 / 9; }
.big:hover .plate, .small:hover .plate { outline-color: var(--c); }
.big h3 { font-size: clamp(1.5rem, 2.5vw, 2.05rem); line-height: 1.1; text-wrap: balance; }
.big p { max-width: 56ch; text-wrap: pretty; }
.big:hover h3, .small:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.stack { display: grid; align-content: start; }
.small { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1rem; text-decoration: none; padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.small:first-child { padding-top: 0; }
.small .plate { aspect-ratio: 1; }
.small h3 { margin-top: .35rem; font-size: 1.12rem; line-height: 1.22; text-wrap: balance; }
.small__m { display: block; margin-top: .35rem; font-family: var(--mono); font-size: .78rem; color: var(--quiet); }

/* 7. Archive rows, filter -------------------------------------------------- */
.archive { padding: clamp(4rem, 8vw, 6rem) 0; }
.archive--page { padding-top: clamp(2.5rem, 6vw, 4rem); }
.archive__head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; padding-bottom: .9rem; border-bottom: 1px solid var(--rule); }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--r); }
.seg button { display: inline-flex; align-items: center; gap: .55rem; font-weight: 500; font-size: .88rem; line-height: 1; color: var(--body); background: none; border: 0; border-right: 1px solid var(--rule); padding: .6rem .9rem; cursor: pointer; transition: background-color .2s var(--ease), color .2s var(--ease); }
.seg button:last-child { border-right: 0; }
.seg button svg { width: 24px; height: 8px; }
.seg [data-s="physics"] svg { --c: var(--physics); } .seg [data-s="essays"] svg { --c: var(--essays); } .seg [data-s="compute"] svg { --c: var(--compute); }
.seg button:hover { color: var(--ink); background: var(--raised); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--well); }
.seg button[aria-pressed="true"] svg { --c: var(--well); --quiet: var(--well); }
.row { display: grid; grid-template-columns: 5rem minmax(0, 1fr) 10rem 7.5rem 4rem; gap: 1.25rem; align-items: center; padding: .9rem 0; border-bottom: 1px solid var(--rule); text-decoration: none; transition: background-color .2s var(--ease); }
.row:hover { background: linear-gradient(90deg, var(--raised), transparent); }
.row .plate { width: 5rem; height: 3.5rem; }
.row__t { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; font-size: 1.12rem; line-height: 1.25; color: var(--ink); text-wrap: balance; }
.row__t small { display: block; margin-top: .25rem; font-family: var(--sans); font-weight: 400; font-size: .95rem; letter-spacing: 0; color: var(--quiet); line-height: 1.45; }
.row__d, .row__min { font-family: var(--mono); font-size: .8rem; color: var(--quiet); }
.row__min { text-align: right; }
.row[hidden] { display: none; }
.rows__empty { padding: 2rem 0; color: var(--quiet); }

/* 8. Pagination, list heads, error ----------------------------------------- */
.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding-top: 1.5rem; font-size: .95rem; }
.pager__link { color: var(--ink); text-underline-offset: 4px; }
.pager__link[rel="next"] { justify-self: end; }
.pager__count { font-family: var(--mono); font-size: .8rem; color: var(--quiet); }
.list-head { padding-bottom: 1.2rem; border-bottom: 1px solid var(--rule); }
.list-head__k { font-family: var(--mono); font-size: .8rem; color: var(--quiet); }
.list-head .sec-title { margin-top: .4rem; font-size: clamp(2rem, 4vw, 3rem); }
.list-head__dek { margin-top: .7rem; max-width: 60ch; }
.error-page { padding: clamp(4rem, 10vw, 8rem) 0; max-width: 40rem; }
.error-page__code { font-family: var(--mono); color: var(--compute); }
.error-page h1 { margin-top: .6rem; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; }
.error-page p { margin: 1rem 0 2rem; }

/* 9. Post ------------------------------------------------------------------ */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 5; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--c, var(--compute)); transform-origin: left; transform: scaleX(0); }
.post-head { padding: clamp(2.25rem, 5vw, 3.75rem) 0 clamp(1.75rem, 4vw, 2.5rem); }
.post-head__meta { display: flex; gap: .5rem 1.25rem; flex-wrap: wrap; align-items: center; font-family: var(--mono); font-size: .82rem; color: var(--quiet); }
.post-head__meta a { text-decoration: none; }
.post-head__title { margin-top: 1rem; font-size: clamp(2.1rem, 4.4vw, 3.25rem); line-height: 1.06; text-wrap: balance; }
.post-head__dek { margin-top: 1.1rem; font-size: clamp(1.12rem, 1.6vw, 1.3rem); line-height: 1.55; text-wrap: pretty; }

.fig { border: 1px solid var(--rule); border-radius: var(--r); }
.zoomable { display: block; width: 100%; border: 0; padding: 0; background: #000; cursor: zoom-in; position: relative; overflow: hidden; color: inherit; }
.fig__frame { display: grid; place-items: center; background: #000; }
.fig__shot { position: relative; display: block; max-width: 100%; }
.fig__shot > img, .fig__frame--static > img { width: auto; max-width: 100%; height: auto; max-height: min(78vh, 50rem); margin-inline: auto; }
.fig__frame--static > img { width: 100%; }
.post-hero-img { view-transition-name: post-hero; }
.hint { right: 1rem; bottom: 1rem; display: inline-flex; align-items: center; gap: .4rem; font: 500 .8rem var(--mono); opacity: 0; transition: opacity .2s var(--ease); }
.hint svg { width: 14px; height: 14px; }
.zoomable:hover .hint, .zoomable:focus-visible .hint { opacity: 1; }
.fig figcaption { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; padding: .9rem 1rem; border-top: 1px solid var(--rule); font-size: .92rem; }
.fig__no { font-family: var(--mono); font-size: .8rem; color: var(--c); padding-top: .1rem; }
.fig__cap { color: var(--ink); }
.fig__cap a { color: inherit; }
.fig__desc summary { font-family: var(--mono); font-size: .8rem; color: var(--quiet); cursor: pointer; list-style: none; display: inline-flex; gap: .4rem; align-items: center; }
.fig__desc summary::-webkit-details-marker { display: none; }
.fig__desc summary::before { content: '+'; width: 1em; text-align: center; }
.fig__desc[open] summary::before { content: '\2212'; }
.fig__desc p { margin-top: .4rem; }

dialog.zoom { margin: auto; width: min(96vw, 1600px); max-height: 92vh; border: 0; padding: 0; background: transparent; overflow: visible; color: var(--quiet); }
dialog.zoom::backdrop { background: oklch(0.1 0.004 260 / .94); }
dialog.zoom img { width: 100%; max-height: 86vh; object-fit: contain; cursor: zoom-out; }
dialog.zoom p { margin-top: .6rem; display: flex; justify-content: space-between; gap: 1rem; font-family: var(--mono); font-size: .8rem; }
dialog.zoom button { color: var(--ink); background: none; border: 1px solid var(--rule); border-radius: var(--r); padding: .25rem .75rem; cursor: pointer; }

.strip { display: grid; grid-template-columns: repeat(3, auto) minmax(14rem, 1fr); margin-top: 1.5rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.strip > div { padding: .8rem 1.5rem .8rem 0; margin-right: 1.5rem; border-right: 1px solid var(--rule); }
.strip > div:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.strip dt { font-family: var(--mono); font-size: .76rem; color: var(--quiet); }
.strip dd { margin-top: .15rem; color: var(--ink); font-size: .95rem; }
.strip dd a { color: inherit; text-underline-offset: 3px; }
.exposure dt { display: flex; justify-content: space-between; align-items: baseline; }
.exposure dt b { font-family: var(--mono); font-weight: 500; font-size: .85rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.exposure__bar { margin-top: .5rem !important; height: 4px; background: var(--well); }
.exposure__bar span { display: block; height: 100%; background: var(--c); transform-origin: left; transform: scaleX(0); }

.after { padding-top: clamp(4rem, 8vw, 5.5rem); }
.next { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); border: 1px solid var(--rule); border-radius: var(--r); text-decoration: none; }
.next .plate { min-height: 15rem; border-radius: 0; }
.next .plate img { position: absolute; inset: 0; z-index: 0; }
.next__body { padding: clamp(1.5rem, 3.5vw, 2.5rem); display: grid; align-content: center; gap: .8rem; border-left: 1px solid var(--rule); }
.next__k { display: flex; gap: .5rem 1rem; flex-wrap: wrap; font-family: var(--mono); font-size: .8rem; color: var(--quiet); }
.next h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.05; text-wrap: balance; }
.next:hover h2 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* 10. Ghost content + cards ------------------------------------------------ */
.gh-content { margin-top: clamp(2.5rem, 5vw, 3.5rem); font-size: 1.15rem; line-height: 1.8; }
.gh-content::after { content: ''; display: block; clear: both; }
.gh-content > * + * { margin-top: 1.35em; }
.gh-content > p:first-child { font-size: 1.28rem; line-height: 1.65; color: var(--ink); }
.gh-content p, .gh-content li { text-wrap: pretty; }
.gh-content :is(h2, h3, h4) { position: relative; font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; color: var(--ink); scroll-margin-top: 1.5rem; }
.gh-content h2 { font-size: 1.75rem; line-height: 1.15; margin-top: 2.1em; }
.gh-content h3 { font-size: 1.4rem; line-height: 1.2; margin-top: 1.8em; }
.gh-content h4 { font-size: 1.15rem; margin-top: 1.6em; }
.gh-content .anchor { position: absolute; left: -1.3em; top: 0; width: 1.1em; text-align: center; font-family: var(--mono); font-size: .8em; color: var(--quiet); text-decoration: none; opacity: 0; transition: opacity .2s var(--ease); }
.gh-content :is(h2, h3):hover .anchor, .gh-content .anchor:focus-visible { opacity: 1; }
.gh-content a:not(.anchor):not(.ref):not([class*="kg-"]) { color: var(--physics); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.gh-content a:not(.anchor):not(.ref):not([class*="kg-"]):hover { text-decoration-thickness: 2px; }
.gh-content :is(ul, ol) { padding-left: 1.4em; }
.gh-content li + li { margin-top: .4em; }
.gh-content li::marker { color: var(--quiet); }
.gh-content strong { color: var(--ink); }
.gh-content hr { border: 0; border-top: 1px solid var(--rule); margin-block: 2.5em; }
.gh-content :not(pre) > code { font-family: var(--mono); font-size: .86em; color: var(--ink); background: var(--raised); border: 1px solid var(--rule); padding: .06em .3em; border-radius: var(--r); overflow-wrap: anywhere; }
.gh-content blockquote:not(.kg-blockquote-alt) { position: relative; padding-left: 2.2rem; font-family: var(--display); font-style: italic; font-size: 1.5rem; line-height: 1.4; color: var(--ink); }
.gh-content blockquote:not(.kg-blockquote-alt)::before { content: '\201C'; position: absolute; left: 0; top: -.15em; font-size: 3rem; line-height: 1; color: var(--c); font-style: normal; }
.gh-content blockquote p + p { margin-top: .8em; }
.gh-content .kg-blockquote-alt { font-family: var(--display); font-style: italic; font-size: 1.85rem; line-height: 1.3; text-align: center; color: var(--ink); padding-block: .5em; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.gh-content table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.gh-content :is(th, td) { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--rule); }
.gh-content th { font-family: var(--mono); font-weight: 500; font-size: .8rem; color: var(--quiet); }

/* code: JS wraps each <pre> in .code with a label and copy button */
.gh-content pre { font-family: var(--mono); font-size: .9rem; line-height: 1.7; color: var(--ink); background: var(--well); padding: 1.1rem 1.2rem; overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r); }
.gh-content pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.code { border: 1px solid var(--rule); border-radius: var(--r); background: var(--well); }
.code pre { border: 0; border-radius: 0; }
.code__bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .4rem .4rem .4rem 1rem; border-bottom: 1px solid var(--rule); font-family: var(--mono); font-size: .78rem; color: var(--quiet); line-height: 1.4; }
.code__bar button { display: inline-flex; align-items: center; gap: .4rem; font: 500 .78rem var(--mono); color: var(--body); background: none; border: 1px solid var(--rule); border-radius: var(--r); padding: .3rem .65rem; cursor: pointer; transition: color .2s var(--ease), border-color .2s var(--ease); }
.code__bar button:hover { color: var(--ink); border-color: var(--quiet); }
.code__bar button.ok { color: var(--essays); border-color: var(--essays); }
.code__bar svg { width: 13px; height: 13px; }

/* figures inside posts are numbered after figure 1 */
.gh-content figure { margin-top: 2em; }
.gh-content figure:is(.kg-image-card, .kg-gallery-card, .kg-embed-card, .kg-video-card):has(figcaption) { counter-increment: fig; }
.gh-content figcaption { margin-top: .7rem; font-size: .92rem; color: var(--quiet); text-align: left; }
.gh-content figure:is(.kg-image-card, .kg-gallery-card, .kg-embed-card, .kg-video-card) figcaption::before { content: 'Fig. ' counter(fig); font-family: var(--mono); font-size: .8rem; color: var(--c); margin-right: .9rem; }
.gh-content .kg-image { margin-inline: auto; border-radius: var(--r); }
.gh-content .kg-image-card img, .gh-content .kg-gallery-image img { height: auto; }
.gh-content iframe { max-width: 100%; }
.gh-content .kg-embed-card { display: block; }
.gh-content .kg-embed-card iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: var(--r); }
.gh-content .kg-width-wide { position: relative; width: min(var(--wide), 100vw - 2 * var(--gutter)); left: 50%; transform: translateX(-50%); }
.gh-content .kg-width-full { position: relative; width: 100vw; left: 50%; transform: translateX(-50%); }
.gh-content .kg-width-full .kg-image { border-radius: 0; width: 100%; }
.gh-content .kg-width-full figcaption { padding-inline: var(--gutter); }

/* cards: Ghost's card_assets provide structure; these align them with the palette */
.gh-content .kg-callout-card { border-radius: var(--r); border: 1px solid var(--rule); background: var(--raised) !important; color: var(--body); }
.gh-content .kg-callout-text { font-size: 1.05rem; }
.gh-content .kg-bookmark-card a.kg-bookmark-container { border: 1px solid var(--rule); border-radius: var(--r); background: var(--raised); color: var(--body); text-decoration: none; }
.gh-content .kg-bookmark-title { color: var(--ink); font-weight: 600; }
.gh-content .kg-bookmark-description, .gh-content .kg-bookmark-metadata { color: var(--quiet); }
.gh-content .kg-toggle-card { border: 1px solid var(--rule); border-radius: var(--r); background: var(--raised); }
.gh-content .kg-toggle-heading-text { color: var(--ink); }
.gh-content .kg-button-card a.kg-btn { border-radius: var(--r); font-weight: 600; }
.gh-content .kg-header-card, .gh-content .kg-cta-card, .gh-content .kg-signup-card { border-radius: var(--r); }
.gh-content .kg-file-card-container { border: 1px solid var(--rule); border-radius: var(--r); background: var(--raised); color: var(--body); }

/* margin notes: markdown-card footnotes, moved beside their reference by JS */
.ref { font-family: var(--mono); font-size: .72em; color: var(--c); text-decoration: none; vertical-align: super; line-height: 0; padding: 0 .1em; }
.ref:hover { text-decoration: underline; }
.note { display: block; margin: .9rem 0 0; padding: .8rem 1rem; background: var(--raised); border: 1px solid var(--rule); border-radius: var(--r); font-size: .95rem; line-height: 1.55; color: var(--quiet); }
.note b { font-family: var(--mono); font-weight: 500; color: var(--c); margin-right: .35rem; }
.has-notes .footnotes { display: none; }
.gh-content .footnotes { font-size: .95rem; color: var(--quiet); border-top: 1px solid var(--rule); padding-top: 1rem; }

/* 11. Subscribe, footer ---------------------------------------------------- */
.sub { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem 4rem; align-items: end; padding: clamp(1.75rem, 4vw, 2.75rem); border: 1px solid var(--rule); border-radius: var(--r); background: var(--raised); }
.sub h2.disp { font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.05; text-wrap: balance; }
.sub p { margin-top: .8rem; max-width: 42ch; }
.sub--compact { margin-top: 1.5rem; padding: 1.2rem 1.4rem; align-items: center; }
.sub--compact p { margin-top: .2rem; }
.sub__lead { font-family: var(--sans); font-size: 1rem; font-weight: 600; color: var(--ink); }
.sub__form { display: grid; gap: .5rem; }
.sub__form label { font-size: .92rem; font-weight: 500; }
.sub__field { display: flex; }
.sub__field input { flex: 1; min-width: 0; color: var(--ink); background: var(--well); border: 1px solid var(--rule); border-right: 0; border-radius: var(--r) 0 0 var(--r); padding: .75rem 1rem; }
.sub__field input::placeholder { color: var(--quiet); }
.sub__field input:focus { outline: 2px solid var(--physics); outline-offset: -1px; }
.sub__field button { font-weight: 600; color: var(--well); background: var(--ink); border: 1px solid var(--ink); border-radius: 0 var(--r) var(--r) 0; padding: .75rem 1.2rem; cursor: pointer; transition: background-color .2s var(--ease); }
.sub__field button:hover { background: var(--essays); border-color: var(--essays); }
.sub__btn-busy, .sub__msg { display: none; }
.sub__form.loading .sub__btn-idle { display: none; }
.sub__form.loading .sub__btn-busy { display: inline; }
.sub__form.success .sub__msg--ok, .sub__form.error .sub__msg--err { display: block; margin-top: .2rem; font-size: .92rem; }
.sub__msg--ok { color: var(--essays); } .sub__msg--err { color: var(--compute); }
.archive + .sub, .rows + .sub { margin-bottom: 1rem; }

.site-footer { margin-top: clamp(3rem, 6vw, 4.5rem); border-top: 1px solid var(--rule); padding: 2.25rem 0 3rem; display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 2rem; font-size: .95rem; color: var(--quiet); }
.site-footer h2 { font-family: var(--mono); font-size: .76rem; font-weight: 500; color: var(--quiet); margin-bottom: .6rem; }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: .35rem; }
.site-footer a { text-decoration: none; color: var(--body); display: inline-flex; align-items: center; gap: .5rem; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.site-footer svg { width: 24px; height: 8px; }
.site-footer__me { display: grid; gap: .5rem; align-content: start; max-width: 40ch; }
.site-footer__me b { color: var(--ink); font-weight: 600; }
.site-footer__fine { grid-column: 1 / -1; font-family: var(--mono); font-size: .76rem; }

/* 12. Motion, responsive --------------------------------------------------- */
@view-transition { navigation: auto; }
::view-transition-group(post-hero) { animation-duration: .55s; animation-timing-function: var(--expo); }
::view-transition-group(zoom) { animation-duration: .45s; animation-timing-function: var(--expo); }

@media (prefers-reduced-motion: no-preference) {
    .developing .chs { display: block; animation: df-focus 1.5s var(--expo) both, df-out .5s var(--ease) 1.7s forwards; }
    .developing .ch { animation: df-ch 1.45s var(--expo) var(--d) forwards; }
    .post .developing .chs { animation-duration: 1.1s, .4s; animation-delay: 0s, 1.25s; }
    .post .developing .ch { animation-duration: 1.05s; }
}
@keyframes df-ch { 0% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.035); } 30% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes df-focus { from { filter: blur(10px) brightness(.7); } to { filter: none; } }
@keyframes df-out { to { opacity: 0; visibility: hidden; } }

/* margin notes move into the right margin once there is room beside the centred column */
@media (min-width: 1360px) {
    .note { float: right; clear: right; width: var(--note); margin: .35rem calc(-1 * (var(--note) + 2.5rem)) 0 0; padding: 0; background: none; border: 0; font-size: .9rem; }
    .note:target { color: var(--body); }
}
@media (max-width: 900px) {
    .release { grid-template-columns: minmax(0, 1fr); }
    .release__fig { border-right: 0; border-bottom: 1px solid var(--rule); }
    .release__frame { min-height: 0; aspect-ratio: 4 / 3; }
    .recent, .sub { grid-template-columns: minmax(0, 1fr); }
    .row { grid-template-columns: 4rem minmax(0, 1fr) auto; gap: .35rem 1rem; }
    .row .plate { width: 4rem; height: 4rem; grid-row: 1 / span 2; }
    .row .band { grid-column: 2; grid-row: 2; }
    .row__t { grid-column: 2 / -1; grid-row: 1; }
    .row__min { grid-column: 3; grid-row: 2; }
    .row__d, .row__t small { display: none; }
    .fig figcaption { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
    .strip { grid-template-columns: 1fr 1fr; }
    .strip > div { border-right: 0; margin-right: 0; border-bottom: 1px solid var(--rule); }
    .strip > div:last-child { grid-column: 1 / -1; border-bottom: 0; }
    .next { grid-template-columns: minmax(0, 1fr); }
    .next .plate { min-height: 0; aspect-ratio: 16 / 9; }
    .next__body { border-left: 0; border-top: 1px solid var(--rule); }
    .gh-content .anchor { display: none; }
    .site-footer { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .site-footer__me { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
    .top { flex-wrap: wrap; }
    .top__nav { gap: .25rem 1rem; }
    .seg { width: 100%; }
    .seg button { flex: 1; justify-content: center; padding: .6rem .4rem; }
    .seg button svg { display: none; }
    .sub__field { flex-direction: column; gap: .5rem; }
    .sub__field input, .sub__field button { border-radius: var(--r); border-right: 1px solid var(--rule); }
    .gh-content { font-size: 1.08rem; }
    .gh-content > p:first-child { font-size: 1.18rem; }
    .gh-content pre { font-size: .8rem; padding: .9rem 1rem; }
    .gh-content blockquote:not(.kg-blockquote-alt) { font-size: 1.22rem; padding-left: 1.8rem; }
    .gh-content blockquote:not(.kg-blockquote-alt)::before { font-size: 2.4rem; }
    .gh-content .kg-blockquote-alt { font-size: 1.45rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
    @view-transition { navigation: none; }
}
