/* Tailend blog: "Dusk" tokens, shared with the main site. */
:root {
  color-scheme: light;
  --bg: #fffefc; --surface: #ffffff; --soft: #f8f7f4;
  --ink: #24212f; --ink-2: #45404f; --muted: #645e6c;
  --line: #ebe7e0; --line-2: #d8d2c8;
  --lead: #4f48c4; --lead-hover: #433cb0; --lead-ink: #4a43bd; --lead-soft: #eeecf9; --on-lead: #ffffff;
  --accent: #ec9a55; --accent-ink: #9c5219;
  --deep: #201d2a; --deep-2: #2a2636; --deep-line: #3a3447; --deep-text: #ece8f2; --deep-muted: #a59fb2;
  --code-k: #bdb7ff; --code-s: #f4bb8c; --code-n: #a3cbe8;
  --svg-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35  0 0 0 0 .28  0 0 0 0 .2  0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.055'/%3E%3C/svg%3E");
  --svg-wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 480 12'%3E%3Cpath d='M0 6.5C40 4.2 70 8.4 118 6.6S190 3.6 236 5.8 300 9 352 6.4 430 4.4 480 6.5' fill='none' stroke='black' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E");
  --shadow-rgb: 52, 40, 30;
  --radius: 18px; --radius-sm: 12px; --wrap: 1320px; --gutter: clamp(16px, 4.5vw, 64px); --col: 680px;
  --display: "Libre Franklin", "Instrument Sans", system-ui, sans-serif;
  --text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --paper: 0 1px 1px rgba(var(--shadow-rgb), .04), 0 2px 6px rgba(var(--shadow-rgb), .04), 0 14px 32px -16px rgba(var(--shadow-rgb), .16);
  --paper-lift: 0 1px 1px rgba(var(--shadow-rgb), .05), 0 4px 10px rgba(var(--shadow-rgb), .05), 0 26px 50px -24px rgba(var(--shadow-rgb), .26);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--text); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
::selection { background: var(--lead-soft); color: var(--ink); }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--lead-ink); text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
a:hover { text-decoration-color: currentColor; }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--lead); outline-offset: 3px; border-radius: 8px; }
code { font-family: var(--mono); font-size: .88em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
h1, h2, h3 { margin: 0; color: var(--ink); font-family: var(--display); }

/* Header: shared, see /header.css. Logo mark sizing for the footer. */
.logo-mark { display: block; width: 28px; height: 28px; flex: none; }
.logo-mark svg { display: block; width: 100%; height: 100%; }

main { display: block; }
[id] { scroll-margin-top: 88px; }

/* Category colours: one tint per category, used by the leading visuals */
.cat-builders { --c: #4f48c4; --c-ink: #4a43bd; }
.cat-organizers { --c: #ec9a55; --c-ink: #9c5219; }
.cat-quality { --c: #5f9a6e; --c-ink: #3c6b4a; }
.cat-company { --c: #5b8fc4; --c-ink: #2f5f8f; }

/* Page mark / label */
.label { font: 500 12.5px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.label a { color: inherit; text-decoration: none; }
.label a:hover { color: var(--ink); text-decoration: underline; }
.badge { display: inline-block; font: 500 12px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase; padding: 5px 9px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 22%, var(--surface)); color: var(--accent-ink); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }

/* Index: featured post, category tabs, then a card grid */
.index-head { padding: 56px 0 40px; }
.index-head h1 { font: 600 clamp(36px, 6vw, 56px)/1.08 var(--display); letter-spacing: -0.024em; margin-top: 14px; max-width: 15em; text-wrap: balance; }
.index-head p { color: var(--ink-2); font-size: 19px; max-width: 34em; margin: 16px 0 0; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.kicker { font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--lead-ink); background: var(--lead-soft); border-radius: 999px; padding: 6px 10px; }

.featured { position: relative; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr); gap: 44px; align-items: center; padding: 28px; margin: 0 0 72px; border-radius: 24px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--paper); }
.feat-text { padding: 8px 0 8px 8px; }
.featured h2 { font: 700 clamp(28px, 3.6vw, 40px)/1.12 var(--display); letter-spacing: -0.022em; margin-top: 18px; text-wrap: balance; }
.featured h2 a { color: var(--ink); text-decoration: none; }
.featured h2 a::after { content: ""; position: absolute; inset: 0; border-radius: 24px; }
.featured:hover h2 a { color: var(--lead-ink); }
.featured h2 a:focus-visible { outline: none; }
.featured h2 a:focus-visible::after { outline: 2px solid var(--lead); outline-offset: 3px; }
.featured .dek { color: var(--ink-2); font-size: 18px; margin: 14px 0 0; max-width: 30em; }
.feat-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin: 22px 0 0; }
.feat-foot .read { margin: 0; }
.feat-art { display: block; border-radius: 16px; overflow: hidden; background: var(--soft); aspect-ratio: 16 / 10; }
.feat-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.featured:hover .feat-art img { transform: scale(1.02); }
.read { display: inline-block; font-weight: 600; font-size: 15px; color: var(--lead-ink); text-decoration: none; }
.read span { display: inline-block; transition: transform .2s; }
.featured:hover .read span { transform: translateX(3px); }
@media (max-width: 820px) {
  .featured { grid-template-columns: 1fr; gap: 22px; padding: 14px 14px 22px; margin-bottom: 56px; }
  .feat-art { order: -1; }
  .feat-text { padding: 0 8px; }
  .featured h2 { margin-top: 14px; }
}

.more { padding: 0 0 72px; }
.more-h { font: 700 clamp(22px, 2.6vw, 26px)/1.2 var(--display); letter-spacing: -0.015em; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 28px; padding: 0 0 14px; border-bottom: 1px solid var(--line); }
.tabs[hidden] { display: none; }
.tabs button { font: 500 15px/1.2 var(--text); color: var(--ink-2); background: none; border: 0; padding: 9px 14px; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s; }
.tabs button:hover { background: var(--soft); color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--surface); }
.tabs button:focus-visible { outline: 2px solid var(--lead); outline-offset: 2px; }
.tabs:not([hidden]) + #post-grid .grid { margin-top: 0; }
#post-grid:focus { outline: none; }
.grid { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 14px 14px 20px; border-radius: var(--radius); background: var(--surface); box-shadow: 0 0 0 1px var(--line); transition: box-shadow .2s, transform .2s; }
.card[hidden] { display: none; }
.card:hover { box-shadow: 0 0 0 1px var(--line-2), var(--paper-lift); transform: translateY(-2px); }
.card img.thumb { border-radius: var(--radius-sm); aspect-ratio: 16 / 9; object-fit: cover; width: 100%; background: var(--soft); }
.card .meta, .card h3, .card .dek, .card time { padding: 0 6px; }
.card h3 { font: 700 20px/1.25 var(--display); letter-spacing: -0.015em; text-wrap: balance; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card h3 a:focus-visible { outline: none; }
.card h3 a:focus-visible::after { outline: 2px solid var(--lead); outline-offset: 3px; }
.card .dek { margin: 0; color: var(--ink-2); font-size: 15.5px; }
.card time.label { margin-top: auto; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; } .tabs button { flex: none; } }
.empty { color: var(--muted); padding: 24px 0 0; margin: 0; }
.grid-empty[hidden] { display: none; }

/* Post: a wide head, a large leading visual, then a chapters rail beside the prose */
article.post { padding-bottom: 24px; }
.post-head { max-width: var(--wrap); margin: 0 auto; padding: 52px var(--gutter) 0; }
@media (min-width: 640px) { .post-head { padding: 64px 28px 0; } }
.post-head .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.post-head .crumb { margin: 0 8px; color: var(--line-2); }
.post-head h1 { font: 700 clamp(34px, 5.6vw, 58px)/1.06 var(--display); letter-spacing: -0.028em; margin-top: 18px; max-width: 17em; text-wrap: balance; }
.post-head .dek { font-size: clamp(18px, 2vw, 21px); line-height: 1.5; color: var(--ink-2); margin: 18px 0 0; max-width: 36em; text-wrap: pretty; }
.post-head .byline { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 22px 0 0; }

/* Leading visual: the hero image on a tinted panel, or a generated glyph panel */
.vis { position: relative; display: block; width: calc(100% - 2 * var(--gutter)); max-width: calc(var(--wrap) - 2 * var(--gutter)); margin: 36px auto 0; border-radius: 28px; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(70% 95% at 82% 28%, color-mix(in srgb, var(--c, var(--lead)) 24%, transparent), transparent 70%),
    radial-gradient(55% 85% at 6% 100%, color-mix(in srgb, var(--c, var(--lead)) 15%, transparent), transparent 72%),
    color-mix(in srgb, var(--c, var(--lead)) 8%, var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c, var(--lead)) 16%, var(--line)); }
.vis::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--svg-grain); opacity: .9; pointer-events: none; }
@media (min-width: 640px) { .vis { width: calc(100% - 56px); margin-top: 44px; } }
.vis-img { padding: clamp(12px, 4.4vw, 52px); margin-bottom: 0; }
.vis-img img { width: 100%; max-width: 940px; margin: 0 auto; border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 1px rgba(var(--shadow-rgb), .07), var(--paper-lift); }
.vis-gen { aspect-ratio: 21 / 8; min-height: 230px; }
.vis svg { position: absolute; overflow: visible; fill: none; stroke: var(--c-ink, var(--lead-ink)); stroke-linecap: round; stroke-linejoin: round; }
.vis .g-big { right: 7%; top: 9%; height: 82%; width: auto; aspect-ratio: 26 / 24; stroke-width: .24; }
.vis .g-sm { stroke-width: .5; opacity: .42; }
.vis .g1 { left: 7%; top: 14%; height: 24%; aspect-ratio: 26 / 24; }
.vis .g2 { left: 31%; bottom: 12%; height: 17%; aspect-ratio: 26 / 24; }
.vis-wave { position: absolute; left: 0; right: 0; bottom: 21%; height: 14px; background: color-mix(in srgb, var(--c-ink, var(--lead-ink)) 28%, transparent);
  -webkit-mask: var(--svg-wave) 0 50% / 520px 14px repeat-x; mask: var(--svg-wave) 0 50% / 520px 14px repeat-x; }
.vis-k { position: absolute; left: clamp(18px, 3.4vw, 36px); bottom: clamp(16px, 3vw, 30px); font: 500 12.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--c-ink, var(--lead-ink));
  background: color-mix(in srgb, var(--surface) 75%, transparent); padding: 7px 10px; border-radius: 999px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--c, var(--lead)) 22%, transparent); }
@media (max-width: 640px) {
  .vis-gen { aspect-ratio: 16 / 10; min-height: 0; border-radius: 22px; }
  .vis-img { border-radius: 22px; }
  .vis .g-big { right: 5%; top: 12%; height: 66%; }
  .vis .g2 { left: 40%; }
}
/* Small version: card thumbnails and the featured slot */
.thumb.vis { display: block; width: 100%; max-width: none; margin: 0; border-radius: var(--radius-sm); aspect-ratio: 16 / 9; min-height: 0; box-shadow: none; }
.thumb.vis .g-big { right: 9%; top: 14%; height: 72%; stroke-width: .42; }
.thumb.vis .g1 { left: 9%; top: 18%; height: 28%; stroke-width: .7; }
.feat-art .thumb.vis { height: 100%; aspect-ratio: auto; border-radius: 0; }

/* Body grid: chapters rail + prose column */
.post-body { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 640px) { .post-body { padding: 0 28px; } }
.post-main { max-width: var(--col); margin: 0 auto; min-width: 0; }
@media (min-width: 1024px) {
  .has-toc .post-body { display: grid; grid-template-columns: minmax(180px, 232px) minmax(0, 1fr); justify-content: start; column-gap: 64px; }
  .has-toc .post-main { margin: 0; max-width: 920px; }
}

/* Chapters rail */
.toc { min-width: 0; }
.toc summary { list-style: none; cursor: pointer; }
.toc summary::-webkit-details-marker { display: none; }
.toc-h { margin: 0 0 12px; font: 500 12px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; margin-left: -1px; padding: 7px 0 7px 14px; border-left: 2px solid transparent; color: var(--muted); font-size: 14.5px; line-height: 1.4; text-decoration: none; text-wrap: pretty;
  transition: color .2s ease, border-color .2s ease; }
.toc a:hover { color: var(--ink); }
.toc a[aria-current] { color: var(--ink); font-weight: 600; border-left-color: var(--c, var(--lead)); }
.toc .lv3 a { padding-left: 26px; font-size: 13.5px; }
@media (min-width: 1024px) {
  .toc { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 112px); overflow-y: auto; padding: 50px 4px 12px 0; scrollbar-width: thin; }
  .toc summary { display: none; }
}
@media (max-width: 1023px) {
  .toc { max-width: var(--col); margin: 32px auto 0; }
  .toc-d { border-radius: 14px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
  .toc summary { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; font: 600 15px/1.3 var(--text); color: var(--ink); border-radius: 14px; }
  .toc summary svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
  .toc-d[open] summary svg { transform: rotate(180deg); }
  .toc summary:focus-visible { outline: 2px solid var(--lead); outline-offset: 2px; }
  .toc-h { display: none; }
  .toc ol { margin: 0 16px 14px; }
}

.prose { padding: 44px 0 0; font-size: 18px; line-height: 1.7; color: var(--ink); }
.has-toc .prose { padding-top: 46px; }
@media (max-width: 1023px) { .has-toc .prose { padding-top: 32px; } }
.prose > * { margin: 0 0 1.25em; }
.prose h2 { font: 700 clamp(24px, 3.4vw, 30px)/1.2 var(--display); letter-spacing: -0.018em; margin: 2.1em 0 .6em; text-wrap: balance; }
.prose > h2:first-child { margin-top: 0; }
.prose h3 { font: 600 21px/1.3 var(--display); letter-spacing: -0.01em; margin: 1.8em 0 .5em; }
.prose h2 + p, .prose h3 + p { margin-top: 0; }
.prose p { text-wrap: pretty; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 0 0 .5em; padding-left: .2em; }
.prose li::marker { color: var(--accent-ink); }
.prose strong { font-weight: 600; }
.prose a { text-decoration-thickness: 1px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--accent); color: var(--ink-2); font-size: 1.06em; }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose code { background: var(--soft); padding: 2px 6px; border-radius: 6px; box-shadow: 0 0 0 1px var(--line); overflow-wrap: anywhere; }
.prose pre { background: var(--deep); color: var(--deep-text); border-radius: var(--radius-sm); padding: 18px 20px; overflow-x: auto; font: 14px/1.65 var(--mono); box-shadow: var(--paper); margin: 1.6em 0; -webkit-overflow-scrolling: touch; tab-size: 2; }
.prose pre code { background: none; box-shadow: none; padding: 0; font-size: inherit; overflow-wrap: normal; border-radius: 0; }
.prose pre .k { color: var(--code-k); } .prose pre .s { color: var(--code-s); } .prose pre .n { color: var(--code-n); } .prose pre .c { color: var(--deep-muted); }
.prose pre.plain { background: var(--soft); color: var(--ink); box-shadow: 0 0 0 1px var(--line); white-space: pre-wrap; font-size: 14.5px; }
.prose figure { margin: 2em 0; }
.prose figure img { border-radius: var(--radius-sm); box-shadow: 0 0 0 1px var(--line), var(--paper); width: 100%; }
.prose figcaption { margin-top: 10px; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.prose img { border-radius: var(--radius-sm); }

/* Generic code with a language bar */
.prose figure.code { margin: 1.6em 0; border-radius: var(--radius-sm); overflow: hidden; background: var(--deep); box-shadow: var(--paper); }
.prose figure.code pre { margin: 0; box-shadow: none; border-radius: 0; }
.code-bar { padding: 9px 18px; border-bottom: 1px solid var(--deep-line); font: 500 12px/1.4 var(--mono); color: var(--deep-muted); }

/* API examples: a request card, with the sample response when the post shows one */
.prose .api { margin: 2em 0; border-radius: 16px; overflow: hidden; background: var(--deep); color: var(--deep-text); box-shadow: 0 0 0 1px color-mix(in srgb, var(--deep) 80%, transparent), var(--paper-lift); }
.api-bar { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--deep-line); font: 500 12.5px/1.4 var(--mono); color: var(--deep-muted); }
.api-verb { color: var(--code-s); font-weight: 600; letter-spacing: .02em; }
.api-path { color: var(--deep-text); overflow-wrap: anywhere; min-width: 0; }
.api-tag { margin-left: auto; white-space: nowrap; font-size: 11px; border: 1px solid var(--deep-line); border-radius: 999px; padding: 3px 9px; }
.api-dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 0 3px color-mix(in srgb, #3ddc97 22%, transparent); flex: none; }
.api-params { list-style: none; margin: 0; padding: 14px 16px 2px; display: flex; flex-wrap: wrap; gap: 8px; }
.api-params li { display: inline-flex; max-width: 100%; margin: 0; padding: 0; border-radius: 8px; overflow: hidden; font: 500 12.5px/1.35 var(--mono); box-shadow: 0 0 0 1px var(--deep-line); }
.api-params .pk { padding: 5px 8px; background: var(--deep-2); color: var(--code-k); white-space: nowrap; }
.api-params .pv { padding: 5px 9px; color: var(--deep-text); overflow-wrap: anywhere; min-width: 0; }
.api-params .hdr .pk { color: var(--code-n); }
.prose .api pre { margin: 0; background: none; box-shadow: none; border-radius: 0; padding: 14px 16px 16px; font-size: 13px; }
.prose .api .api-cmd { color: var(--deep-muted); }
.api-res { border-top: 1px solid var(--deep-line); background: color-mix(in srgb, var(--deep-2) 70%, var(--deep)); }
.api-res .api-bar { border-bottom-color: color-mix(in srgb, var(--deep-line) 70%, transparent); color: var(--deep-text); }
.prose .api-res pre { max-height: 440px; }

/* Before / after listing examples */
.prose .ba { margin: 1.8em 0; border-radius: 14px; overflow: hidden; background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--paper); }
.ba-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: baseline; padding: 14px 18px; }
.ba-row + .ba-row { border-top: 1px dashed var(--line-2); }
.ba-k { font: 500 11.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ba-row p { margin: 0; font-size: 16px; line-height: 1.55; }
.ba-before p { color: var(--muted); }
.ba-after { background: color-mix(in srgb, var(--c, var(--lead)) 7%, var(--surface)); }
.ba-after .ba-k { color: var(--c-ink, var(--lead-ink)); }

@media (max-width: 520px) {
  .prose { font-size: 17px; }
  .prose pre, .prose .api, .prose figure.code { margin-left: -16px; margin-right: -16px; border-radius: 0; }
  .ba-row { grid-template-columns: 1fr; gap: 6px; }
}

/* End-of-post CTA */
.cta { margin: 56px 0 0; }
.cta-card { background: color-mix(in srgb, var(--c, var(--lead)) 5%, var(--surface)); border-radius: var(--radius); padding: 28px; box-shadow: 0 0 0 1px var(--line), var(--paper); }
.cta-card h2 { font: 700 24px/1.2 var(--display); letter-spacing: -0.015em; }
.cta-card p { color: var(--ink-2); margin: 10px 0 0; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 21px; border-radius: 12px; font: 600 16px/1.3 var(--text); text-decoration: none; border: 1px solid transparent; transition: background .15s, box-shadow .15s, transform .15s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--lead); color: var(--on-lead); box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 6px 16px -8px color-mix(in srgb, var(--lead) 70%, transparent); }
.btn.primary:hover { background: var(--lead-hover); }
.btn.quiet { color: var(--ink); background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--paper); }
.btn.quiet:hover { box-shadow: 0 0 0 1px var(--line-2), var(--paper-lift); }
.back { margin: 28px 0 0; font-weight: 600; }

/* Footer: shared, see /footer.css */
main + .site-foot { margin-top: 56px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card:hover, .featured:hover .feat-art img { transform: none !important; }
}
@media (prefers-reduced-motion: no-preference) {
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  .post-head, .featured, .card { animation: rise .45s ease both; }

  /* Leading visual: the glyphs draw themselves in, then drift */
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes drift { from { transform: translateY(0) rotate(0deg); } to { transform: translateY(-7px) rotate(-1.5deg); } }
  @keyframes wave { to { -webkit-mask-position: -520px 50%; mask-position: -520px 50%; } }
  .js .vis-gen[data-reveal] path { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .js .vis-gen.in path { animation: draw 1.6s cubic-bezier(.45,.1,.2,1) .1s forwards; }
  .js .vis-gen.in .g-sm path { animation-delay: .7s; animation-duration: 1.2s; }
  .vis-gen.in .g-big { animation: drift 7s ease-in-out 1.8s infinite alternate; }
  .vis-gen.in .g1 { animation: drift 9s ease-in-out 1s infinite alternate-reverse; }
  .vis-gen .vis-wave { animation: wave 28s linear infinite; }
  .js .vis-img[data-reveal] img { opacity: 0; transform: translateY(14px) scale(.985); transition: opacity .7s ease, transform .9s cubic-bezier(.2,.8,.2,1); }
  .js .vis-img.in img { opacity: 1; transform: none; }

  /* API cards rise in on scroll; parameters follow; the response unrolls */
  .js .api[data-reveal] { opacity: 0; transform: translateY(22px) scale(.985); transition: opacity .6s ease, transform .75s cubic-bezier(.2,.8,.2,1); }
  .js .api[data-reveal].in { opacity: 1; transform: none; }
  .js .api[data-reveal] .api-params li { opacity: 0; transform: translateY(6px); transition: opacity .35s ease, transform .35s ease; transition-delay: calc(.3s + var(--i, 0) * 70ms); }
  .js .api[data-reveal].in .api-params li { opacity: 1; transform: none; }
  .js .api[data-reveal] .api-res { clip-path: inset(0 0 100% 0); transition: clip-path .8s cubic-bezier(.2,.8,.2,1) .5s; }
  .js .api[data-reveal].in .api-res { clip-path: inset(0 0 0 0); }
}

/* Tables (GFM pipe tables in posts) */
.prose .table-wrap { margin: 1.6em 0; overflow-x: auto; border-radius: var(--radius-sm); box-shadow: 0 0 0 1px var(--line); background: var(--surface); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.prose th, .prose td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.prose th { font-weight: 600; color: var(--ink); background: var(--soft); }
.prose td { color: var(--ink-2); }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose td code, .prose th code { font-size: .92em; }
