/* Uses only variables from tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--header-height); }  /* keeps focused and anchored content clear of the fixed header */
body { margin: 0; background: var(--color-paper); color: var(--color-ink); font: var(--text-base)/var(--leading-body) var(--font-serif); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: var(--weight-display); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: var(--space-3); top: -4rem; background: var(--color-ink); color: var(--color-paper); padding: var(--space-2) var(--space-3); z-index: 40; }
.skip-link:focus { top: var(--space-3); }

/* Layout: full width, small gutter. Prose keeps the reading measure. No rules: space and flush imagery make the shape. */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.prose { max-width: calc(var(--measure) + 2 * var(--gutter)); }
.kicker, .label, .stat dt { font: var(--weight-sans-strong) var(--text-small)/1.4 var(--font-sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--color-dim); margin: 0 0 var(--space-3); }
.mono { font: 400 var(--text-mono)/1.4 var(--font-mono); letter-spacing: 0.04em; color: var(--color-dim); }

/* ---------- Header: fixed. Name top-left, nav under it ---------- */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 20; display: grid; grid-template-columns: 1fr; grid-template-rows: auto var(--nav-row-h); padding: var(--space-3) calc(var(--gutter) + var(--cord-clearance)) var(--space-2) var(--gutter); color: var(--color-ink); transition: color var(--motion-slow) var(--motion-ease), padding-top var(--motion-shrink) var(--motion-shrink-ease); }
/* Backing: paper across the left 60%, fading out to the right; a matching bottom border that appears once the header has settled into scrolling format */
.site-header::before, .site-header::after { content: ""; position: absolute; left: 0; right: 0; pointer-events: none; z-index: -1; }
.site-header::before { top: 0; bottom: 0; background: linear-gradient(to right, var(--color-paper) var(--header-solid), transparent); transition: opacity var(--motion-slow) var(--motion-ease); }
.site-header::after { bottom: 0; height: 1px; background: linear-gradient(to right, var(--color-line) var(--header-solid), transparent); transition: opacity 0.4s ease var(--motion-slow); }
.site-header a { text-decoration: none; }
.site-header__name { grid-area: 1 / 1; justify-self: start; font: var(--weight-display) var(--text-name-min)/var(--leading-display) var(--font-display); letter-spacing: -0.035em; transition: font-size var(--motion-shrink) var(--motion-shrink-ease); }
.site-header nav { grid-area: 2 / 1; height: var(--nav-row-h); display: flex; align-items: center; padding-left: 0; transition: padding-left var(--motion-shrink) var(--motion-shrink-ease); font: var(--weight-sans-strong) var(--text-small)/1.4 var(--font-sans); letter-spacing: 0.14em; text-transform: uppercase; }
.site-header nav a:hover { text-decoration: underline; }
.site-header ul { display: flex; gap: var(--space-2) var(--space-4); list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }

/* Home at the top: big name, nav inset */
body.is-top .site-header__name { font-size: var(--text-name); }
body.is-top .site-header nav { padding-left: var(--nav-inset); }
@media (min-width: 50rem) { body.is-top .site-header { padding-top: var(--header-top-pad); } }
@media (max-width: 50rem) {
  body.is-top .site-header nav { padding-left: var(--nav-inset-mobile); }
  .site-header::before { background: var(--color-paper); }
  .site-header::after { background: var(--color-line); }
}
@media (max-width: 40rem) { .site-header { padding-right: var(--gutter); } }

/* Over the hero image the header is transparent, with no backing or border, until the hero has passed */
body.home-template:has(.hero__image):not(.is-past-hero) .site-header { color: var(--color-on-image); }
body.home-template:has(.hero__image):not(.is-past-hero) .site-header::before,
body.home-template:has(.hero__image):not(.is-past-hero) .site-header::after { opacity: 0; }
body:not(.home-template) main { padding-top: var(--header-height); }

/* ---------- Hero ---------- */
.hero { view-timeline: --hero; position: relative; min-height: var(--hero-height); display: grid; align-items: end; overflow: hidden; }
.hero__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; z-index: -1; }
@media (min-width: 50rem) {
  .hero { clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--hero-slice-y)), calc(100% - var(--hero-slice-x)) 100%, 0 100%); }
  .hero .hero__text { padding-bottom: calc(var(--hero-slice-y) + var(--space-3)); }
}
.hero__text { justify-self: end; max-width: var(--hero-text-width); padding: var(--space-4) var(--gutter); text-align: right; color: var(--color-on-image); translate: 0 calc(var(--hero-out, 0) * -5rem); opacity: calc(1 - var(--hero-out, 0)); }  /* --hero-out set by the JS fallback */
.hero__text .hero__kicker { margin: 0 0 var(--space-2); font: var(--weight-sans-strong) var(--text-kicker)/1.4 var(--font-sans); letter-spacing: 0.18em; text-transform: uppercase; }  /* styled uppercase; the stored text stays Title Case for metadata and previews */
.hero__text .hero__line { margin: 0; font: var(--weight-display) var(--text-strap-hero)/1.15 var(--font-display); text-wrap: balance; }
@media (max-width: 50rem) { .hero__text { max-width: none; } .hero__text .hero__line { font-size: var(--text-strap-mobile); } }
.hero:has(.hero__image)::after { content: ""; position: absolute; inset: 0; background: var(--scrim); z-index: -1; }
.hero__sentinel, .hero__end { position: absolute; left: 0; width: 1px; height: 1px; pointer-events: none; }
.hero__sentinel { top: var(--shrink-at); }
.hero__end { bottom: var(--header-height); }


/* ---------- Sections: space, not rules ---------- */
.section { padding-block: var(--space-6); }
.section-label { padding: var(--space-6) var(--gutter) var(--space-4); margin: 0; }
.stat-strip__list { display: grid; gap: var(--gutter); grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); margin: 0; }
.stat dd { margin: 0; font-weight: var(--weight-display); font-size: clamp(3rem, 8vw, 8rem); line-height: var(--leading-display); }

/* Editorial split (62/38), alternating, images flush to the edges and to each other */
.split { display: grid; grid-template-columns: var(--split-wide) var(--split-narrow); align-items: stretch; }
.split:nth-child(even) { grid-template-columns: var(--split-narrow) var(--split-wide); }
.split:nth-child(even) .split__media { order: 2; }
.split__media { position: relative; display: block; aspect-ratio: var(--split-media-ratio); overflow: clip; /* clip, not hidden: hidden makes the panel the scroll container for view() timelines */ background: var(--color-line); }
.split__media img { width: 100%; height: 100%; object-fit: cover; }
.split__media--type { display: grid; place-items: center; }
.split__media--type h3 { margin: 0; padding-block: 0.14em; /* room for ascenders: stops tall letters being clipped at the layer edge (seen in Safari) */ font: var(--weight-display) var(--text-value)/var(--leading-display) var(--font-display); letter-spacing: -0.035em; color: var(--color-ink); }
.split__copy { font: var(--weight-display) var(--text-copy)/1.2 var(--font-display) !important; color: var(--color-ink) !important; max-width: 24ch; text-wrap: balance; margin: 0; }
.split__text { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-5); padding: var(--gutter); }
.split__text h3 { margin: 0 0 var(--space-3); font-size: var(--text-h2); line-height: 1.1; }
.split__text h3 a { text-decoration: none; }
.split__text p { margin: 0 0 var(--space-3); font: var(--weight-sans) 0.95rem/1.5 var(--font-sans); color: var(--color-dim); }
.split__text .mono { text-transform: uppercase; letter-spacing: 0.14em; }
@media (max-width: 50rem) {
  .split, .split:nth-child(even) { grid-template-columns: 1fr; }
  .split:nth-child(even) .split__media { order: 0; }
  .split__text { gap: var(--space-3); }
}

/* Card grid (tag, index): covers touch */
.page-head { padding: var(--space-5) var(--gutter) var(--space-4); }
.page-title { margin: 0; font-size: var(--text-h2); }
.card-grid { display: grid; gap: 0; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.card__link { text-decoration: none; display: block; padding-bottom: var(--space-5); }
.card__image { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; }
.card__title { margin: var(--space-3) var(--gutter) var(--space-2); font-size: 1.35rem; line-height: 1.2; }
.card__excerpt { margin: 0 var(--gutter); }
.card__excerpt, .meta, .lede { color: var(--color-dim); font-family: var(--font-sans); font-weight: var(--weight-sans); font-size: 0.95rem; }

/* Posts: full-bleed cover, then prose */
.cover { margin: 0; }
.cover img { width: 100%; max-height: 80svh; object-fit: cover; }
.cover figcaption { padding: var(--space-2) var(--gutter); color: var(--color-dim); font: var(--weight-sans) var(--text-small)/1.4 var(--font-sans); }

/* Footer */
.site-footer { margin-top: var(--space-6); border-top: 1px solid var(--color-line); }
.site-footer .container { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: var(--space-3); padding-block: var(--space-5); font: var(--weight-sans) var(--text-small)/1.4 var(--font-sans); letter-spacing: 0.12em; text-transform: uppercase; flex-wrap: wrap; }
.site-footer ul { display: flex; justify-content: center; gap: var(--space-2) var(--space-4); list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.site-footer p { margin: 0; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* Editor cards */
.kg-width-wide { width: min(80rem, 100vw - 2 * var(--gutter)); margin-inline: calc(50% - min(80rem, 100vw - 2 * var(--gutter)) / 2); }
.kg-width-full { width: 100vw; margin-inline: calc(50% - 50vw); }
.kg-width-full img { width: 100%; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Value accents */
.value-word:not([data-trigger]) { translate: 0 calc(var(--p, 0) * var(--parallax)); }  /* --p set by the JS fallback; identity at rest */
.value-word__text { position: relative; display: inline-block; }
.accent { position: absolute; overflow: visible; fill: none; stroke: var(--color-ink); stroke-linecap: round; stroke-linejoin: round; }
.accent path { stroke-width: var(--accent-stroke); stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--draw, 1)); }
.accent { view-timeline: --accent; }
.accent--craft { left: 0; bottom: -0.02em; width: 100vw; height: 0.09em; } /* runs on past the word to the panel edge (the panel clips it) */
.accent--care { right: 4%; bottom: 3%; width: clamp(6rem, 16vw, 15rem); aspect-ratio: 1; }
/* Impact: a full stop that comes into existence while the word deliberately jumps left to make room (no layout shift: the dot takes no space) */
.stop { position: relative; display: inline-block; width: 0; height: 0; }
.stop::before { content: ""; position: absolute; left: var(--dot-gap); bottom: 0; width: var(--dot-rest); height: var(--dot-rest); border-radius: 50%; background: var(--color-ink); }
.value-word--impact { translate: calc(-1 * var(--woah-rest)) 0; }  /* finished state: nudged left to make room */
.value-word--impact.is-armed { translate: 0 0; }
.value-word--impact.is-armed .stop::before { width: var(--dot-start); height: var(--dot-start); }
.value-word--impact.is-armed.is-in { animation: woah 0.6s linear forwards; }
.value-word--impact.is-armed.is-in .stop::before { animation: stop-pop 0.55s linear forwards; }
/* Scrolling back up: the same keyframes run backwards, so the dot shrinks out of existence and the word slides back to centre */
.value-word--impact.is-armed.is-leaving { animation: woah-out 0.6s linear reverse forwards; }
.value-word--impact.is-armed.is-leaving .stop::before { animation: stop-pop-out 0.55s linear reverse forwards; }
@keyframes woah {
  0%   { translate: 0 0; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }
  40%  { translate: calc(-1 * var(--woah-overshoot)) 0; animation-timing-function: ease-in-out; }
  100% { translate: calc(-1 * var(--woah-rest)) 0; }
}
@keyframes woah-out {
  0%   { translate: 0 0; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }
  40%  { translate: calc(-1 * var(--woah-overshoot)) 0; animation-timing-function: ease-in-out; }
  100% { translate: calc(-1 * var(--woah-rest)) 0; }
}  /* same frames, own name so the browser starts a fresh animation instead of reusing the finished one */
@keyframes stop-pop {
  0%   { width: var(--dot-start); height: var(--dot-start); animation-timing-function: cubic-bezier(0.1, 0.9, 0.2, 1); }
  55%  { width: var(--dot-peak); height: var(--dot-peak); animation-timing-function: ease-in-out; }
  100% { width: var(--dot-rest); height: var(--dot-rest); }
}
@keyframes stop-pop-out {
  0%   { width: var(--dot-start); height: var(--dot-start); animation-timing-function: cubic-bezier(0.1, 0.9, 0.2, 1); }
  55%  { width: var(--dot-peak); height: var(--dot-peak); animation-timing-function: ease-in-out; }
  100% { width: var(--dot-rest); height: var(--dot-rest); }
}  /* same frames, own name so the browser starts a fresh animation instead of reusing the finished one */
/* Care: a gentle nod, like tipping a hat. Pivots on the left middle; the right side dips and comes back. */
.value-word--care { transform-origin: 0 50%; rotate: 0deg; }
.value-word--care.is-armed.is-in { animation: nod 1.1s linear forwards; }
@keyframes nod {
  0%   { rotate: 0deg; animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1); }
  38%  { rotate: var(--nod-angle); animation-timing-function: cubic-bezier(0.5, 0, 0.3, 1); }
  100% { rotate: 0deg; }
}

/* ---------- Home sections ---------- */
.stat { display: flex; flex-direction: column-reverse; gap: var(--space-2); }
.stat dt { margin: 0; max-width: 28ch; }
.more { font: var(--weight-sans-strong) var(--text-small)/1.4 var(--font-sans); letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; }
.more:hover { text-decoration: underline; }
.experience__lead { max-width: 30ch; margin: 0 0 var(--space-5); font: var(--weight-display) var(--text-strap-hero)/1.2 var(--font-display); text-wrap: balance; }
.roles { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: grid; gap: var(--space-4); }
.role { display: grid; grid-template-columns: 2fr 3fr; gap: var(--space-3) var(--gutter); align-items: baseline; }
.role__company { font: var(--weight-display) var(--text-h2)/1.1 var(--font-display); }
.role__tag { margin-left: var(--space-2); font-size: var(--text-mono); letter-spacing: 0.08em; text-transform: uppercase; vertical-align: middle; white-space: nowrap; }
.role__title { font: var(--weight-sans) 0.95rem/1.4 var(--font-sans); color: var(--color-dim); }
@media (max-width: 50rem) { .role { grid-template-columns: 1fr; gap: var(--space-1); } }
.labs__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.lab { display: block; text-decoration: none; padding-bottom: var(--space-5); }
.lab img { width: 100%; height: auto; aspect-ratio: 400 / 190; object-fit: cover; background: var(--color-line); }
.lab__text { display: grid; gap: var(--space-2); padding: var(--space-3) var(--gutter) 0; }
.lab__title { font: var(--weight-display) var(--text-h2)/1.1 var(--font-display); }
.lab__blurb { font: var(--weight-sans) 0.95rem/1.5 var(--font-sans); color: var(--color-dim); max-width: 36ch; }
.labs > .container { padding-bottom: var(--space-4); }

/* ---------- Posts ---------- */
.post__head { padding-block: var(--space-5) var(--space-4); }
.post__head h1 { margin: var(--space-2) 0 var(--space-3); font-size: clamp(2.25rem, 5vw, 4.5rem); line-height: 1.02; letter-spacing: -0.02em; text-wrap: balance; }
.post__head .mono a { text-decoration: none; }
.lede { font-size: 1.25rem; line-height: 1.4; max-width: var(--measure); }
.prose > :where(p, ul, ol, blockquote, pre, figure, table, hr, h2, h3, h4) { max-width: var(--measure); margin-inline: 0; }
.prose p, .prose li { margin-block: 0 var(--space-4); }
.prose h2 { font-size: var(--text-h2); line-height: 1.1; margin: var(--space-6) 0 var(--space-3); }
.prose h3 { font-size: 1.5rem; line-height: 1.2; margin: var(--space-5) 0 var(--space-3); }
.prose a { text-decoration-thickness: 1px; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose blockquote { margin: var(--space-5) 0; padding-left: var(--space-4); border-left: 2px solid var(--color-ink); font-style: italic; }
.prose figure { margin: var(--space-5) 0; }
.prose figcaption { margin-top: var(--space-2); color: var(--color-dim); font: var(--weight-sans) var(--text-small)/1.4 var(--font-sans); }
.prose pre, .prose code { font-family: var(--font-mono); font-size: 0.85em; }
.prose pre { overflow-x: auto; padding: var(--space-3); background: var(--color-line); }
.prose :not(pre) > code { padding: 0.1em 0.3em; background: var(--color-line); }
.prose table { border-collapse: collapse; width: 100%; font-family: var(--font-sans); font-size: 0.9rem; }
.prose th, .prose td { text-align: left; padding: var(--space-2) var(--space-3) var(--space-2) 0; vertical-align: top; }
.prose hr { border: 0; height: var(--space-5); }
.prose.page, .prose.post { padding-bottom: var(--space-5); }

/* Case-study outcome strip: the first callout card, as the opening block */
.case-study > .kg-callout-card:first-of-type { display: block; max-width: none; margin: 0 calc(-1 * var(--gutter)) var(--space-5); padding: var(--space-4) var(--gutter); background: var(--color-line); border: 0; border-radius: var(--radius); color: var(--color-ink); }
.case-study > .kg-callout-card:first-of-type .kg-callout-emoji { display: none; }
.case-study > .kg-callout-card:first-of-type .kg-callout-text { font: var(--weight-display) var(--text-strap-hero)/1.25 var(--font-display); padding: 0; }
.case-study > .kg-callout-card:first-of-type .kg-callout-text * { margin: 0; }

/* Prev / next, flush */
.post-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); margin-top: var(--space-5); }
.post-nav__link { display: grid; gap: var(--space-2); padding: var(--space-5) var(--gutter); background: var(--color-line); text-decoration: none; }
.post-nav__link--next { text-align: right; }
.post-nav__title { font: var(--weight-display) var(--text-h2)/1.1 var(--font-display); }
.pagination { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); padding: var(--space-5) var(--gutter); font: var(--weight-sans-strong) var(--text-small)/1.4 var(--font-sans); letter-spacing: 0.14em; text-transform: uppercase; }
.pagination a { text-decoration: none; }
.pagination a:hover { text-decoration: underline; }

/* ---------- Error ---------- */
.error { padding-top: var(--space-5); }
.error__code { margin: 0; padding-inline: var(--gutter); font: var(--weight-display) var(--text-masthead)/var(--leading-display) var(--font-display); letter-spacing: -0.04em; color: var(--color-dim); }
.error__text { padding-block: var(--space-5); }
.error__text h1 { font-size: var(--text-h2); margin: 0 0 var(--space-3); }

/* Values: the stacked composition at every size (panel with the word, sentence beneath). The word scales with the panel, so it stays as big as it can without crowding. */
.pillars .split, .pillars .split:nth-child(even) { grid-template-columns: 1fr; }
.pillars .split:nth-child(even) .split__media { order: 0; }
.pillars .split__text { padding: var(--space-4) var(--gutter) var(--space-5); }
@media (min-width: 50rem) { .pillars .split__media { aspect-ratio: 16 / 9; } }

/* Safari hardening: grid items with aspect-ratio can shrink to their content, so panels are explicitly full width,
   and the single-column layouts are plain blocks. */
.split__media { width: 100%; }
.pillars .split { display: block; }
@media (max-width: 50rem) { .split { display: block; } }

/* Scroll-linked accents as CSS scroll-driven animations where supported (guidance: modern-web-guidance, parallax-scroll-effects).
   Decorative, so unsupported browsers keep the JS fallback in values.js / header.js. Declared after the shorthand, reduced motion respected. */
@supports ((animation-timeline: view()) and (animation-range: entry)) {
  @media (prefers-reduced-motion: no-preference) {
    @keyframes drift { from { translate: 0 calc(var(--parallax) / 2); } to { translate: 0 calc(var(--parallax) / -2); } }
    @keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
    @keyframes hero-out { to { translate: 0 -5rem; opacity: 0; } }
    .value-word:not([data-trigger]) { animation: drift linear both; animation-timeline: view(); animation-range: cover; }
    .accent path { animation: draw linear both; animation-timeline: --accent; animation-range: entry 0% cover 50%; }
    @media (min-width: 64rem) { .accent--craft path { animation-range: cover 15% cover 50%; } }   /* desktop: the Craft line starts a little later, so it isn't missed while the big name is still shrinking */
    .hero__text { animation: hero-out linear both; animation-timeline: --hero; animation-range: exit 15% exit 85%; }
  }
}

/* ---------- Accessibility ---------- */
/* Target size: links and controls at least 24px tall (WCAG 2.5.8) */
.site-header nav a, .site-footer a, .more, .pagination a, .post__head .mono a { display: inline-block; padding-block: 0.4rem; }
.lab__title { margin: 0; }
/* One stretched link per case-study row: the title link's ::after covers the row; the focus ring goes on the row */
.split { position: relative; }
.split__text h3 a::after { content: ""; position: absolute; inset: 0; }
.split:has(h3 a:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: -2px; }
.split__text h3 a:focus-visible { outline: none; }
.cover img { aspect-ratio: 16 / 9; }
.prose p, .lede { text-wrap: pretty; }

/* Desktop: use the width. Values sit as alternating 62/38 rows (panel and sentence side by side) instead of stacking.
   Phone and tablet keep the stacked composition. */
@media (min-width: 64rem) {
  .pillars .split, .pillars .split:nth-child(even) { display: grid; grid-template-columns: var(--split-wide) var(--split-narrow); align-items: stretch; }
  .pillars .split:nth-child(even) .split__media { order: 0; }
  .pillars .split:nth-of-type(even) { grid-template-columns: var(--split-narrow) var(--split-wide); }
  .pillars .split:nth-of-type(even) .split__media { order: 2; }
  .pillars .split__media { aspect-ratio: var(--split-media-ratio); }
  .pillars .split__text { display: flex; flex-direction: column; justify-content: flex-end; padding: var(--gutter); }
}

/* Blog index (custom-blog.hbs): tag filter row, then one line per post */
.tag-filter { padding: 0 var(--gutter) var(--space-4); }
.tag-filter ul { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); list-style: none; margin: 0; padding: 0; }
.tag-filter a { display: inline-block; padding: 0.35em 0.9em; min-block-size: 24px; border: 1px solid var(--color-line); border-radius: var(--radius); font: 400 var(--text-small)/1.4 var(--font-sans); color: var(--color-ink); text-decoration: none; }
.tag-filter a:hover, .tag-filter a[aria-current] { background: var(--color-ink); color: var(--color-paper); }
.tag-filter__n { color: var(--color-dim); font-size: 0.85em; }
.tag-filter a:hover .tag-filter__n, .tag-filter a[aria-current] .tag-filter__n { color: inherit; }
.post-index { padding: 0 var(--gutter) var(--space-6); }
.post-index__list { list-style: none; margin: 0; padding: 0; }
.post-index__item { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: var(--space-3); align-items: baseline; padding-block: var(--space-3); border-top: 1px solid var(--color-line); }
.post-index__title { font: var(--weight-display) var(--text-h2)/1.25 var(--font-display); color: var(--color-ink); text-decoration: none; }
.post-index__title:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.post-index__tag { text-transform: uppercase; letter-spacing: 0.12em; }
@media (max-width: 40rem) { .post-index__item { grid-template-columns: 1fr; gap: var(--space-1); } .post-index__tag { order: -1; } }

/* Community template (custom-community.hbs; ".community.community" outranks Ghost's cards.min.css, which loads after this file): intro text stays at reading width; Bookmark and Product cards become image-and-text rows */
.community.community { padding-bottom: var(--space-6); }
.community.community.community > * { max-width: var(--measure); margin-inline: 0 auto; padding-inline: var(--gutter); }
.community.community.community > .kg-bookmark-card, .community.community.community > .kg-product-card { max-width: none; margin-inline: 0; padding-inline: 0; margin-block: 0; }
.community.community .kg-bookmark-card a.kg-bookmark-container, .community.community .kg-bookmark-card a.kg-bookmark-container:hover, .community.community .kg-product-card-container {  /* the :hover variant beats Ghost's own, which adds a white background and border on hover and made the row jump */ position: relative; display: grid; grid-template-columns: var(--split-wide) var(--split-narrow); align-items: stretch; min-height: 0; border: 0; border-radius: 0; box-shadow: none; background: none; color: var(--color-ink); text-decoration: none; max-width: none; padding: 0; }
.community.community .kg-bookmark-thumbnail { position: relative; order: -1; min-width: 0; max-height: none; aspect-ratio: var(--split-media-ratio); overflow: clip; background: var(--color-line); }
.community.community .kg-bookmark-thumbnail img, .community.community .kg-product-card-image { position: static; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.community.community .kg-bookmark-content, .community.community .kg-product-card-container > :not(img) { padding: 0 var(--gutter); }
.community.community .kg-bookmark-content { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-5); padding-block: var(--gutter); }
.community.community .kg-bookmark-title, .community.community .kg-product-card-title { margin: 0 0 var(--space-3); font: var(--weight-display) var(--text-h2)/1.1 var(--font-display); color: var(--color-ink); }
.community.community .kg-bookmark-description, .community.community .kg-product-card-description { max-height: none; margin: 0 0 var(--space-3); font: var(--weight-sans) 0.95rem/1.5 var(--font-sans); color: var(--color-dim); }
.community.community .kg-bookmark-description *, .community.community .kg-product-card-description * { margin: 0; color: inherit; }
.community.community .kg-bookmark-metadata { display: flex; margin: 0; font: 400 var(--text-mono)/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: 0.14em; color: var(--color-dim); }
.community.community .kg-bookmark-icon, .community.community .kg-bookmark-author, .community.community .kg-product-card-rating { display: none; }
.community.community .kg-bookmark-publisher { max-width: none; font: inherit; color: inherit; }
.community.community .kg-bookmark-publisher::after { content: " \2192"; }
.community.community .kg-product-card-container { grid-template-rows: auto auto 1fr auto; grid-template-columns: var(--split-wide) var(--split-narrow); }
.community.community .kg-product-card-image { grid-column: 1; grid-row: 1 / -1; aspect-ratio: var(--split-media-ratio); }
.community.community .kg-product-card-container > :not(img) { grid-column: 2; }
.community.community .kg-product-card-title-container { padding-top: var(--gutter); }
.community.community .kg-product-card-button { position: static; align-self: end; justify-self: start; margin: 0 0 var(--gutter) var(--gutter); padding: 0; background: none; border: 0; height: auto; width: auto; color: var(--color-dim); font: 400 var(--text-mono)/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: 0.14em; text-decoration: none; }
.community.community .kg-product-card-button::after { content: ""; position: absolute; inset: 0; }   /* the whole row is the link */
.community.community .kg-bookmark-container:focus-visible, .community.community .kg-product-card-container:has(a:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: -2px; }
.community.community .kg-product-card-button:focus-visible { outline: none; }
@media (max-width: 50rem) {
  .community.community .kg-bookmark-card a.kg-bookmark-container, .community.community .kg-bookmark-card a.kg-bookmark-container:hover, .community.community .kg-product-card-container { grid-template-columns: 1fr; }
  .community.community .kg-product-card-image { grid-column: 1; grid-row: auto; }
  .community.community .kg-product-card-container > :not(img) { grid-column: 1; }
  .community.community .kg-bookmark-content { gap: var(--space-3); }
}
.community.community .kg-product-card .kg-product-card-title { font: var(--weight-display) var(--text-h2)/1.1 var(--font-display); }
.community.community .kg-bookmark-description, .community.community .kg-product-card .kg-product-card-description { opacity: 1; }
.community.community .kg-bookmark-publisher::before { content: none; }
