/* Ekom - minimal blog theme.
   Tokens first; everything else reads from them, so dark mode is only a
   token swap. --accent is set from the Customizer (inline style). */

:root {
	--bg: #fafaf8;
	--fg: #111111;
	--muted: #6b6b6b;
	--line: #e4e4e0;
	--soft: #f1f1ed;
	--accent: #c8f031;
	--on-accent: #111111;
	--sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	--mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	--gutter: clamp(16px, 4vw, 40px);
	--max: 1180px;
	--read: 680px;
	--date-col: 150px;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #111110;
		--fg: #ededea;
		--muted: #9a9a94;
		--line: #2a2a27;
		--soft: #1a1a19;
		color-scheme: dark;
	}
}

:root[data-theme="dark"] {
	--bg: #111110;
	--fg: #ededea;
	--muted: #9a9a94;
	--line: #2a2a27;
	--soft: #1a1a19;
	color-scheme: dark;
}

/* --- Base --- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	overflow-x: clip; /* full-width blocks are 100vw, which includes any scrollbar */
	background: var(--bg);
	color: var(--fg);
	font: 400 16px/1.6 var(--sans);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
::selection { background: var(--accent); color: var(--on-accent); }

.mono, .label, .kbd, .tag, .btn { font-family: var(--mono); }
.muted { color: var(--muted); }
.label { margin: 0 0 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sq { font-size: 8px; margin-inline-end: 10px; vertical-align: 2px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { width: 100%; max-width: calc(var(--read) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.section { margin-block: clamp(40px, 7vw, 88px); }
.section__title { margin: 0 0 18px; font-size: clamp(22px, 3vw, 32px); font-weight: 500; letter-spacing: -.03em; }
.more { margin-top: 20px; }
.empty { padding: 24px 0; }

.screen-reader-text, .hp {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
/* Hidden above the page, not far to the side: a side offset widens RTL pages. */
.skip { position: absolute; top: -100px; inset-inline-start: 16px; z-index: 10; padding: 8px 12px; background: var(--accent); color: var(--on-accent); }
.skip:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

/* --- Buttons & tags --- */

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 10px 18px; border: 1px solid var(--fg); border-radius: 0;
	background: transparent; color: var(--fg); font-size: 13px; text-decoration: none;
	cursor: pointer; transition: background .15s, color .15s;
}
.btn:hover { background: var(--fg); color: var(--bg); }
.btn--accent { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn--accent:hover { background: var(--fg); color: var(--bg); }
.btn--wide { width: 100%; max-width: 820px; }

.tag {
	display: inline-block; padding: 2px 8px; border: 1px solid var(--line);
	font-size: 11px; letter-spacing: .04em; text-transform: uppercase; text-decoration: none;
	transition: background .15s, border-color .15s;
}
.tag:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tag:hover .muted { color: inherit; }

/* --- Header --- */

.site-header {
	display: flex; align-items: center; gap: 20px;
	padding-block: 18px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.brand__mark { font-size: 14px; }
.brand__logo { width: 28px; height: 28px; object-fit: contain; }
.nav { flex: 1; }
.nav__list { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav__list a {
	display: block; padding: 4px 8px; font: 12px var(--mono); text-transform: uppercase; letter-spacing: .04em;
	text-decoration: none; border-radius: 3px;
}
.nav__list a:hover, .nav__list .current-menu-item > a { background: var(--soft); }
.kbd { color: var(--muted); }

/* Topics dropdown */
.nav__drop { position: relative; display: flex; }
.nav__drop-btn {
	display: flex; align-items: center; gap: 4px; padding: 4px 8px; border: 0; border-radius: 3px; line-height: normal; background: transparent;
	color: inherit; font: 12px var(--mono); text-transform: uppercase; letter-spacing: .04em; cursor: pointer;
}
.nav__drop-btn:hover, .nav__drop.is-open .nav__drop-btn { background: var(--soft); }
.nav__caret { font-size: .8em; line-height: 1; transition: transform .15s; }
.nav__drop.is-open .nav__caret { transform: rotate(180deg); }
.nav__sub {
	display: none; position: absolute; top: 100%; left: 0; z-index: 30; min-width: 260px; margin: 6px 0 0; padding: 6px 0;
	list-style: none; background: var(--bg); border: 1px solid var(--fg); box-shadow: 4px 4px 0 var(--accent);
}
.nav__drop.is-open .nav__sub { display: block; }
.nav__sub a { display: flex; justify-content: space-between; gap: 16px; padding: 8px 14px; white-space: nowrap; }
.nav__sub a:hover, .nav__sub a:focus-visible { background: var(--soft); }
.nav__sub .muted { font-family: var(--mono); font-size: 12px; }
.header-tools { display: flex; gap: 4px; margin-inline-start: auto; }
.icon-btn {
	min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 0;
	background: transparent; color: var(--fg); font: 12px var(--mono); cursor: pointer;
}
.icon-btn:hover { border-color: var(--fg); }

/* Menu button: phones only. Three bars that turn into an × when open. */
.menu-toggle { display: none; align-items: center; justify-content: center; }
.menu-toggle__bars, .menu-toggle__bars::before, .menu-toggle__bars::after {
	display: block; width: 16px; height: 2px; background: currentColor; transition: transform .2s, opacity .2s;
}
.menu-toggle__bars { position: relative; }
.menu-toggle__bars::before, .menu-toggle__bars::after { content: ""; position: absolute; inset-inline-start: 0; }
.menu-toggle__bars::before { top: -5px; }
.menu-toggle__bars::after { top: 5px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::before { transform: translateY(5px) rotate(45deg); background: var(--fg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::after { transform: translateY(-5px) rotate(-45deg); background: var(--fg); }

/* --- Hero --- */

.hero { padding-block: clamp(36px, 8vw, 96px) clamp(20px, 4vw, 40px); }
.hero__title {
	margin: 0; font-size: clamp(46px, 12.5vw, 176px); font-weight: 500; overflow-wrap: anywhere;
	line-height: .92; letter-spacing: -.055em;
}
.hero--list .hero__title { font-size: clamp(44px, 9vw, 128px); }
.count { margin-inline-start: .2em; font-size: 14px; font-weight: 400; letter-spacing: 0; vertical-align: top; position: relative; top: .6em; }
.hero__intro { max-width: 620px; margin: 22px 0 0; font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); }
.hero__intro p { margin: 0; }
.crumbs { margin: 0 0 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--fg); }

/* Home heading: a sentence, not a poster. Still the page's one h1. */
.hero--home { padding-block: clamp(48px, 9vw, 112px) clamp(20px, 4vw, 36px); }
.hero__hello { margin: 0; max-width: 900px; font-size: clamp(32px, 5.2vw, 64px); font-weight: 500; line-height: 1.1; letter-spacing: -.04em; }
.hero__hi, .hero__line { display: block; }
.hero__line { color: var(--muted); }
.typer { padding: 0 .1em; background: var(--accent); color: var(--on-accent); white-space: nowrap; }
.typer:empty { padding: 0; }
.hero__hello .cursor { width: .06em; height: .9em; margin-inline-start: .08em; background: var(--fg); vertical-align: -.1em; }

.hero .hero-search { display: flex; gap: 0; max-width: 640px; margin-top: clamp(24px, 4vw, 36px); }
.hero .hero-search input[type="search"] {
	flex: 1; min-width: 0; height: 54px; padding: 0 18px;
	border: 1px solid var(--fg); border-inline-end: 0; border-radius: 0;
	background: var(--bg); color: var(--fg); font: 17px var(--sans);
}
.hero .hero-search input[type="search"]:focus { border-color: var(--fg); outline: 2px solid var(--accent); outline-offset: -3px; }
.hero .hero-search .btn { height: 54px; padding: 0 26px; border: 1px solid var(--fg); }
.search-results:empty { display: none; }
.hero-search + .search-results, .hero-search ~ .search-results { max-width: 640px; margin-top: 0; border: 1px solid var(--line); border-top: 0; }
.hero--home .hero__intro { margin-top: 18px; font-size: 17px; }

.cursor {
	display: inline-block; width: .09em; height: .78em; margin-inline-start: .04em;
	background: var(--accent); vertical-align: -.04em;
	animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.now { margin: 18px 0 0; font-size: 13px; line-height: 1.6; }
.pulse { position: relative; display: inline-block; margin-inline-end: 10px; vertical-align: 1px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.pulse::after {
	content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent);
	animation: ping 2s ease-out infinite;
}
@keyframes ping { to { transform: scale(3); opacity: 0; } }

.topics { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.topics .label { margin: 0 8px 0 0; }

/* --- Post rows (stripe.dev style) --- */

.rows__head {
	display: grid; grid-template-columns: var(--date-col) 1fr;
	padding-bottom: 8px; border-bottom: 1px solid var(--fg);
	font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}

.row { border-bottom: 1px solid var(--line); }
.row summary {
	display: grid; grid-template-columns: var(--date-col) 1fr 28px; align-items: baseline;
	padding: 14px 0; cursor: pointer; list-style: none;
	transition: background .12s;
}
.row summary::-webkit-details-marker { display: none; }
.row summary:hover { background: var(--accent); color: var(--on-accent); box-shadow: -10px 0 0 var(--accent), 10px 0 0 var(--accent); }
.row summary:hover .row__date { color: inherit; }
.row__date { font-size: 12px; color: var(--muted); white-space: nowrap; }
.row__title { font-size: clamp(18px, 2.1vw, 26px); font-weight: 450; line-height: 1.25; letter-spacing: -.025em; text-decoration: none; }
.row__toggle { position: relative; justify-self: end; width: 12px; height: 12px; align-self: center; }
.row__toggle::before, .row__toggle::after { content: ""; position: absolute; left: 0; top: 50%; width: 12px; height: 1px; background: currentColor; }
.row__toggle::after { transform: rotate(90deg); transition: transform .2s; }
.row[open] .row__toggle::after { transform: rotate(0deg); }

.row__body {
	display: grid; grid-template-columns: var(--date-col) 1fr; gap: 12px 0;
	padding: 6px 0 22px;
}
.row__k { margin: 3px 0 0; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.row__summary { margin: 0; max-width: 620px; font-size: 17px; }
.row__topics { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; font-size: 12px; }
.row__body .btn--wide { grid-column: 1 / -1; margin-top: 8px; }
.row[open] .row__body { animation: rowOpen .2s ease-out; }
@keyframes rowOpen { from { opacity: 0; transform: translateY(-4px); } }

.dl-row {
	display: grid; grid-template-columns: var(--date-col) 1fr auto; align-items: center; gap: 16px;
	padding: 14px 0; border-bottom: 1px solid var(--line);
}
.dl-row__main { display: flex; flex-direction: column; gap: 2px; }
.dl-row__main .row__title:hover { text-decoration: underline; }
.dl-row__main .muted { font-size: 15px; }

/* --- Single post --- */

.post__head { padding-top: clamp(32px, 6vw, 72px); }
/* Header, body and footer share one grid so their text edges line up. */
.post__head, .post__foot, .post__comments { max-width: calc(var(--read) + 2 * var(--gutter)); }
.post__grid, .post__head, .post__foot, .post__comments { --rail-l: 200px; --rail-r: 200px; }
.post__title, .row__title, .hero__title, .hero__hello, .section__title { overflow-wrap: anywhere; }
.post__title { margin: 0; font-size: clamp(34px, 5vw, 56px); font-weight: 500; line-height: 1.05; letter-spacing: -.04em; }
.post__meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 20px 0 0; padding-bottom: 18px; border-bottom: 1px solid var(--line); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.post__hero { margin-block: 28px 0; }
.post__hero img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 6px; }

.post__grid { display: grid; grid-template-columns: minmax(0, var(--read)); justify-content: center; gap: 48px; margin-top: 32px; }
.post__left, .post__right { display: none; }

@media (min-width: 1100px) {
	.post__grid, .post__head, .post__foot, .post__comments {
		display: grid; grid-template-columns: var(--rail-l) minmax(0, var(--read)) var(--rail-r);
		justify-content: center; column-gap: 48px;
		max-width: calc(var(--rail-l) + var(--read) + var(--rail-r) + 96px + 2 * var(--gutter));
	}
	.post__head > *, .post__foot > *, .post__comments > * { grid-column: 2; }
	.post__left { display: block; }
	.post__right { display: block; }
}
/* Equal rails keep the text column centred in the window, which wide and
   full-width blocks rely on to break out evenly. 300px fits a 300×600 ad. */
@media (min-width: 1240px) {
	.post__grid, .post__head, .post__foot, .post__comments { --rail-l: 300px; --rail-r: 300px; }
}

.toc { position: sticky; top: 24px; font-size: 13px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; border-top: 1px solid var(--line); }
.toc a { display: block; padding: 7px 0; color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc a::before { content: counter(toc, decimal-leading-zero) "  "; font: 11px var(--mono); }
.toc a:hover, .toc a.is-active { color: var(--fg); }

.post__foot { margin-top: 48px; }

/* --- Prose (post body) --- */

.prose { font-size: 18px; line-height: 1.75; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose table, .prose figure { margin: 0 0 1.25em; }
.prose h2 { margin: 2.2em 0 .6em; font-size: 28px; font-weight: 550; line-height: 1.2; letter-spacing: -.025em; scroll-margin-top: 24px; }
.prose h3 { margin: 1.8em 0 .5em; font-size: 21px; font-weight: 550; line-height: 1.3; letter-spacing: -.015em; scroll-margin-top: 24px; }
.prose a { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.prose a:hover { background: var(--accent); color: var(--on-accent); }
.prose li { margin-bottom: .4em; }
.prose blockquote { padding-inline-start: 20px; border-inline-start: 3px solid var(--accent); color: var(--muted); font-style: italic; }
.prose img { border-radius: 6px; }
.prose figcaption { margin-top: 8px; font: 12px var(--mono); color: var(--muted); }
.prose code { padding: 2px 5px; background: var(--soft); border-radius: 4px; font: .85em var(--mono); }
.prose pre { padding: 16px; overflow-x: auto; background: var(--soft); border-radius: 6px; font: 14px/1.6 var(--mono); }
.prose pre code { padding: 0; background: none; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th { text-align: start; font: 11px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--fg); padding: 8px 12px 8px 0; }
.prose td { border-bottom: 1px solid var(--line); padding-block: 10px; padding-inline: 0 12px; vertical-align: top; }

/* Sections the posting tool writes (ids come from inc/content.php). */
.prose #key-takeaways { margin-top: 0; font-size: 12px; font-family: var(--mono); font-weight: 400; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.prose #key-takeaways + ul { padding-block: 18px; padding-inline: 38px 20px; background: var(--soft); border-inline-start: 3px solid var(--accent); }
.prose #faq ~ h3 { padding-top: 1em; border-top: 1px solid var(--line); }
.prose #related-reading { font-size: 12px; font-family: var(--mono); font-weight: 400; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.prose #related-reading + ul { list-style: none; padding: 0; border-top: 1px solid var(--fg); }
.prose #related-reading + ul li { margin: 0; border-bottom: 1px solid var(--line); }
.prose #related-reading + ul a { display: block; padding: 10px 0; text-decoration: none; font-weight: 450; }
.prose #related-reading + ul a::after { content: " →"; color: var(--muted); }

/* --- Author + prev/next --- */

.author { display: flex; gap: 18px; padding: 24px 0; border-block: 1px solid var(--line); }
.author__photo { width: 64px; height: 64px; border-radius: 50%; flex: none; }
.author__name { margin: 0 0 4px; font-weight: 600; }
.author p.muted { margin: 0 0 8px; font-size: 15px; }
.author a.mono { font-size: 12px; }
.prevnext { display: flex; justify-content: space-between; gap: 20px; margin-top: 18px; font-size: 13px; }
.prevnext a { text-decoration: none; color: var(--muted); }
.prevnext a:hover { color: var(--fg); }

/* --- Ads: space is always reserved, so nothing jumps (CLS). --- */

.ad { position: relative; min-height: var(--ad-h, 250px); margin: 36px 0; text-align: center; }
.ad__label { display: block; margin-bottom: 6px; font: 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ad--header { max-width: 970px; margin: 12px auto 0; padding-inline: var(--gutter); }
.ad--sidebar { position: sticky; top: 24px; margin: 0; }
.ad--list { margin: 0; padding: 16px 0; border-bottom: 1px solid var(--line); }
.ad--placeholder {
	display: flex; align-items: center; justify-content: center;
	border: 1px dashed var(--muted); border-radius: 6px;
	background: repeating-linear-gradient(-45deg, transparent 0 8px, var(--soft) 8px 16px);
}
.ad--placeholder .ad__label { margin: 0; }

/* --- Downloads --- */

.dl-card {
	display: flex; align-items: center; justify-content: space-between; gap: 20px;
	margin: 2em 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft);
}
.dl-card p { margin: 0; }
.dl-card__title { font-weight: 600; font-size: 18px; letter-spacing: -.01em; }
.dl-card .muted { font-size: 15px; }
.prose .dl-card { font-size: 16px; line-height: 1.5; }

.dl-dialog, .search-dialog {
	width: min(460px, calc(100vw - 32px)); padding: 28px; border: 1px solid var(--line); border-radius: 16px;
	background: var(--bg); color: var(--fg); box-shadow: 0 30px 80px rgba(0, 0, 0, .25);
}
.search-dialog { width: min(620px, calc(100vw - 32px)); margin-top: 12vh; }
.dl-dialog::backdrop, .search-dialog::backdrop { background: rgba(10, 10, 10, .45); backdrop-filter: blur(3px); }
.dl-dialog h2 { margin: 0 0 8px; font-size: 26px; font-weight: 550; letter-spacing: -.03em; line-height: 1.15; }
.dl-dialog > .muted { margin: 0 0 20px; }
.dl-dialog__close {
	position: absolute; top: 12px; inset-inline-end: 12px; width: 32px; height: 32px; border: 0; border-radius: 0;
	background: var(--soft); color: var(--fg); font-size: 18px; line-height: 1; cursor: pointer;
}
.dl-dialog[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.dl-form__row, .search-form { display: flex; gap: 8px; }
.dl-form input[type="email"], .newsletter__form input[type="email"], .search-form input[type="search"] {
	flex: 1; min-width: 0; padding: 11px 16px; border: 1px solid var(--line); border-radius: 0;
	background: var(--bg); color: var(--fg); font: 15px var(--sans);
}
.dl-form input:focus, .newsletter__form input:focus, .search-form input:focus { outline: none; border-color: var(--fg); }
.dl-form__opt { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: 13px; color: var(--muted); }
.hero .search-form { max-width: 560px; margin-top: 24px; }
.lede { font-size: 20px; color: var(--muted); }
.dl-inline { margin: 24px 0 40px; padding: 24px; border: 1px solid var(--line); border-radius: 12px; }

/* --- Footer, pagination, comments --- */

.site-footer {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
	margin-top: clamp(48px, 8vw, 120px); padding-block: 28px; border-top: 1px solid var(--line); font-size: 12px;
}
.site-footer p { margin: 0; }
.site-footer a { text-decoration: none; color: var(--muted); }
.site-footer a:hover { color: var(--fg); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 18px; list-style: none; margin: 0; padding: 0; font-family: var(--mono); text-transform: uppercase; letter-spacing: .04em; }

.pagination { margin-top: 28px; font: 13px var(--mono); }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pagination .page-numbers { padding: 6px 10px; border: 1px solid var(--line); border-radius: 0; text-decoration: none; }
.pagination .current { background: var(--fg); color: var(--bg); border-color: var(--fg); }

.comment-list { list-style: none; padding: 0; }
.comment-body { padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment-form textarea, .comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"] {
	width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); font: inherit;
}

/* --- Reading progress --- */

.progress { position: fixed; inset: 0 0 auto; z-index: 20; height: 3px; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }

/* --- Badges, series, changelog --- */

.badge { padding: 0 6px; border-radius: 3px; background: var(--accent); color: var(--on-accent); }

.series, .changelog { margin-top: 18px; border: 1px solid var(--line); border-radius: 10px; }
.series summary, .changelog summary {
	display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
	padding: 12px 16px; cursor: pointer; list-style: none; font-size: 14px;
}
.series summary::-webkit-details-marker, .changelog summary::-webkit-details-marker { display: none; }
.series summary .label, .changelog summary .label { margin: 0; }
.series summary::after, .changelog summary::after { content: "+"; margin-inline-start: auto; font-family: var(--mono); }
.series[open] summary::after, .changelog[open] summary::after { content: "−"; }
.series__name { font-weight: 600; }
.series ol { margin: 0; padding-block: 0 6px; padding-inline: 40px 16px; font-size: 15px; }
.series li { padding: 4px 0; color: var(--muted); }
.series li a { text-decoration: none; color: var(--fg); }
.series li a:hover { text-decoration: underline; }
.series li.is-current { color: var(--fg); font-weight: 600; }
.series > a.mono { display: inline-block; margin: 0 16px 14px; font-size: 12px; }
.changelog ul { margin: 0; padding-block: 0 14px; padding-inline: 34px 16px; font-size: 14px; color: var(--muted); }

.series-next { display: block; margin-bottom: 28px; padding: 18px 20px; border: 1px solid var(--fg); border-radius: 10px; text-decoration: none; transition: background .15s; }
.series-next:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.series-next:hover .label { color: inherit; }
.series-next__title { display: block; font-size: 20px; font-weight: 500; letter-spacing: -.02em; }

/* --- Heading copy links --- */

.prose h2, .prose h3 { position: relative; }
.anchor {
	position: absolute; inset-inline-start: -34px; top: 50%; transform: translateY(-50%);
	width: 28px; height: 28px; padding: 0; border: 0; border-radius: 0; background: transparent;
	color: var(--muted); font: 14px var(--mono); cursor: pointer; opacity: 0; transition: opacity .15s;
}
.prose h2:hover .anchor, .prose h3:hover .anchor, .anchor:focus-visible { opacity: 1; }
.anchor { display: inline-flex; align-items: center; justify-content: center; }
.anchor:hover { background: var(--soft); color: var(--fg); }
.anchor svg { display: block; }
.anchor__tip {
	position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); display: none;
	padding: 3px 7px; background: var(--fg); color: var(--bg); font: 600 10px/1.2 var(--mono); letter-spacing: .04em; white-space: nowrap;
}
.anchor.is-copied { opacity: 1; color: var(--fg); }
.anchor.is-copied .anchor__tip { display: block; }
@media (max-width: 820px) { .anchor { display: none; } }

/* --- Tickable checklists ("[ ] item" in a post) --- */

.prose li.task { list-style: none; margin-inline-start: -1.25em; }
.prose li.task label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.task__box {
	appearance: none; -webkit-appearance: none; flex: none; width: 18px; height: 18px; margin: .2em 0 0;
	border: 2px solid var(--fg); border-radius: 0; background: transparent; cursor: pointer; display: grid; place-content: center;
}
.task__box::before { content: ""; width: 10px; height: 10px; transform: scale(0); transition: transform .12s; background: var(--accent); box-shadow: inset 0 0 0 2px var(--fg); }
.task__box:checked { background: var(--accent); }
.task__box:checked::before { transform: scale(1); background: var(--fg); clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%); box-shadow: none; }
.task__box:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.task__box:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }

/* --- Newsletter --- */

.newsletter {
	display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); align-items: center; gap: 20px 40px;
	margin-block: clamp(32px, 6vw, 72px); padding: clamp(22px, 4vw, 36px); border: 1px solid var(--line); border-radius: 14px; background: var(--soft);
}
.post__foot .newsletter { grid-template-columns: 1fr; margin-block: 28px; }
.newsletter__title { margin: 0; font-size: clamp(22px, 2.6vw, 30px); font-weight: 500; letter-spacing: -.03em; line-height: 1.15; }
.newsletter__text .muted { margin: 6px 0 0; }
.newsletter__done { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--mono); font-size: 13px; }
.form-error { margin: 8px 0 0; font-size: 13px; color: #b42318; }
:root[data-theme="dark"] .form-error { color: #ff8a80; }

/* --- Start here --- */

.step { display: inline-block; margin-inline-end: 6px; padding: 2px 6px; border-radius: 3px; background: var(--accent); color: var(--on-accent); font-size: 13px; vertical-align: 6px; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.topic-card { display: flex; flex-direction: column; gap: 6px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; }
.topic-card__name { font-size: 24px; font-weight: 500; letter-spacing: -.025em; text-decoration: none; }
.topic-card__name:hover { text-decoration: underline; }
.topic-card__name sup { font-size: 12px; font-weight: 400; color: var(--muted); }
.topic-card p { margin: 0; font-size: 15px; }
.topic-card__subs { display: flex; flex-wrap: wrap; gap: 6px; }
.topic-card__pillar { margin-top: auto; padding-top: 8px; font-size: 12px; text-decoration: none; }
.topic-card__pillar:hover { color: var(--fg); text-decoration: underline; }

/* --- Tools --- */

.disclosure { margin: 0 0 28px; padding: 14px 16px; border-radius: 10px; background: var(--soft); font-size: 14px; color: var(--muted); }
.disclosure .label { display: inline; margin-inline-end: 6px; }
.filters { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 28px; font-size: 13px; }
.filters__item { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 0; color: var(--fg); text-decoration: none; }
.filters__item:hover { border-color: var(--fg); }
.filters__item[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.filters__count { font-size: 11px; color: var(--muted); }
.filters__item[aria-current] .filters__count { color: inherit; }
.tool-group[hidden] { display: none; }
.tool-group { display: grid; grid-template-columns: var(--date-col) 1fr; margin-bottom: 28px; border-top: 1px solid var(--fg); }
.tool-group__name { margin: 0; padding-top: 16px; font-size: 12px; font-weight: 400; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tool { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.tool__logo { width: 44px; height: 44px; border-radius: 10px; object-fit: contain; background: var(--soft); }
.tool__logo--letter { display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 18px; }
.tool__main p { margin: 0; }
.tool__name { font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
.tool__main .muted { font-size: 15px; }
.tool__price { margin-top: 2px !important; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tool--card { margin: 1.5em 0 .4em; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; font-size: 16px; line-height: 1.5; }
.tool__note { margin: 0 0 1.5em !important; font-size: 11px !important; color: var(--muted); }
.prose .tool a.btn { text-decoration: none; }
.prose .tool a.btn:hover { background: var(--fg); color: var(--bg); }

/* --- Glossary --- */

.gloss { position: relative; text-decoration: underline dotted var(--muted) !important; text-decoration-thickness: 1px !important; }
.prose a.gloss:hover { background: none; color: inherit; }
.gloss::after {
	content: attr(data-def); position: absolute; inset-inline-start: 0; bottom: calc(100% + 8px); z-index: 5;
	width: max-content; max-width: min(280px, 80vw); padding: 10px 12px; border-radius: 8px;
	background: var(--fg); color: var(--bg); font: 13px/1.45 var(--sans); font-style: normal;
	/* display:none, not just opacity: a hidden tooltip must not widen the page. */
	display: none; pointer-events: none;
}
.gloss[data-def=""]::after { display: none !important; }
.gloss:hover::after, .gloss:focus-visible::after { display: block; animation: glossIn .15s ease-out; }
@keyframes glossIn { from { opacity: 0; transform: translateY(4px); } }

.letters { display: flex; flex-wrap: wrap; gap: 4px; position: sticky; top: 0; z-index: 4; padding-block: 10px; background: var(--bg); font-size: 13px; }
.letters a { min-width: 32px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 0; text-align: center; text-decoration: none; }
.letters a:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.gloss-group { display: grid; grid-template-columns: var(--date-col) 1fr; border-top: 1px solid var(--fg); margin-bottom: 20px; scroll-margin-top: 60px; }
.gloss-group__letter { margin: 0; padding-top: 10px; font-size: 32px; font-weight: 500; letter-spacing: -.03em; }
.gloss-row { display: grid; grid-template-columns: minmax(160px, 260px) 1fr; gap: 6px 20px; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.gloss-row:hover { background: var(--accent); color: var(--on-accent); box-shadow: -10px 0 0 var(--accent), 10px 0 0 var(--accent); }
.gloss-row:hover .muted { color: inherit; }
.gloss-row__term { font-size: 20px; font-weight: 500; letter-spacing: -.02em; }

/* --- Case study patterns --- */

.ecr-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 1.5em 0; }
.ecr-metric { padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.ecr-metric p { margin: 0 !important; }
.ecr-metric__label { font: 11px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ecr-metric__value { margin-top: 6px !important; font-size: 26px; font-weight: 600; line-height: 1.15; letter-spacing: -.03em; }
.ecr-metric__note { margin-top: 4px !important; font-size: 13px; color: var(--muted); }
.ecr-timeline { list-style: none; padding-block: 0 !important; padding-inline: 22px 0 !important; border-inline-start: 2px solid var(--line); }
.ecr-timeline li { position: relative; margin-bottom: 1em; }
.ecr-timeline li::before { content: ""; position: absolute; inset-inline-start: -29px; top: .55em; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.ecr-timeline strong { display: block; font: 12px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* --- Instant search results --- */

.search-results { list-style: none; margin: 14px 0 0; padding: 0; max-height: 50vh; overflow-y: auto; }
.search-results li a { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline; padding: 10px 8px; border-bottom: 1px solid var(--line); border-radius: 0; text-decoration: none; }
.search-results li a:hover, .search-results li a:focus-visible { background: var(--accent); color: var(--on-accent); }
.search-results .mono { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.search-results li a:hover .mono { color: inherit; }
.search-results .search-empty { padding: 10px 8px; font-size: 14px; color: var(--muted); }

/* --- WordPress core output: alignments, captions, galleries, comments --- */

/* Symmetric breakouts: the same in left-to-right and right-to-left. */
.prose .alignwide { --wide: min(1080px, calc(100vw - 2 * var(--gutter))); width: var(--wide); max-width: none; margin-inline: calc(50% - var(--wide) / 2); }
.prose .alignfull { width: 100vw; max-width: none; margin-inline: calc(50% - 50vw); }
.prose .alignfull img, .prose .alignwide img { width: 100%; border-radius: 0; }
.prose .alignleft { float: left; margin: .4em 1.5em 1em 0; max-width: 50%; }
.prose .alignright { float: right; margin: .4em 0 1em 1.5em; max-width: 50%; }
.prose img.aligncenter { display: block; margin-inline: auto; }
.prose .wp-caption.aligncenter, .prose figure.aligncenter { margin-inline: auto; }
.prose::after { content: ""; display: table; clear: both; }
@media (max-width: 720px) { .prose .alignleft, .prose .alignright { float: none; max-width: 100%; margin: 1em 0; } }

.wp-caption { max-width: 100%; }
.wp-caption-text, .gallery-caption, .wp-element-caption { margin-top: 8px; font: 12px var(--mono); color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 8px; margin: 1.5em 0; }
.gallery-columns-1 { --cols: 1; } .gallery-columns-2 { --cols: 2; } .gallery-columns-4 { --cols: 4; } .gallery-columns-5 { --cols: 5; }
.gallery-item { margin: 0; }
.gallery-item img { width: 100%; height: auto; }
.bypostauthor > .comment-body .fn::after { content: " · author"; font: 11px var(--mono); color: var(--muted); }
.sticky .row__title::after { content: "Pinned"; margin-inline-start: 10px; padding: 1px 6px; vertical-align: 4px; background: var(--accent); color: var(--on-accent); font: 10px var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.post-password-form { padding: 20px; border: 1px solid var(--line); }
.post-password-form input[type="password"] { padding: 10px 12px; border: 1px solid var(--line); border-radius: 0; background: var(--bg); color: var(--fg); }
.post-password-form input[type="submit"] { padding: 10px 18px; border: 1px solid var(--fg); border-radius: 0; background: var(--accent); color: var(--on-accent); font: 13px var(--mono); cursor: pointer; }
.page-links { margin: 2em 0; font: 13px var(--mono); }
.page-links a, .page-links > span:not(.page-links-title) { padding: 4px 10px; border: 1px solid var(--line); }

.post__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2.5em 0 0; font-size: 12px; }
.post__tags .label { margin: 0 6px 0 0; }
.post__tags a { padding: 2px 8px; border: 1px solid var(--line); font: 11px var(--mono); text-transform: uppercase; letter-spacing: .04em; text-decoration: none; }
.post__tags a:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.comments__title { margin: 0 0 16px; font-size: 24px; font-weight: 500; letter-spacing: -.02em; }
.comment-list, .comment-list .children { list-style: none; margin: 0; padding: 0; }
.comment-list .children { margin-inline-start: clamp(16px, 4vw, 40px); }
.comment-body { padding: 18px 0; border-bottom: 1px solid var(--line); }
.comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 14px; }
.comment-author { display: flex; align-items: center; gap: 10px; }
.comment-author .avatar { border-radius: 50%; }
.comment-author .says { display: none; }
.comment-metadata { font: 12px var(--mono); color: var(--muted); }
.comment-metadata a { text-decoration: none; }
.comment-content { margin-top: 8px; }
.reply a { font: 12px var(--mono); text-transform: uppercase; letter-spacing: .04em; }
.comment-awaiting-moderation { font: 12px var(--mono); color: var(--muted); }
.comment-respond { margin-top: 32px; }
.comment-form label { display: block; margin-bottom: 4px; font: 12px var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.comment-form p { margin: 0 0 14px; }
.comment-form textarea, .comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"] { border-radius: 0; }
.comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; }
.comment-form-cookies-consent label { margin: 0; text-transform: none; letter-spacing: 0; font: 13px var(--sans); }
.comments-navigation, .comment-navigation { display: flex; justify-content: space-between; margin: 12px 0; font: 13px var(--mono); }

/* --- More prose basics --- */

.prose h4 { margin: 1.6em 0 .4em; font-size: 18px; font-weight: 600; }
.prose h5, .prose h6 { margin: 1.4em 0 .4em; font: 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.prose h1 { font-size: 32px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; }
.prose dt { font-weight: 600; }
.prose dd { margin: 0 0 .8em 1.2em; }
.prose mark { background: var(--accent); color: var(--on-accent); padding: 0 .15em; }
.prose kbd { padding: 1px 5px; border: 1px solid var(--line); border-bottom-width: 2px; font: .85em var(--mono); }
.prose abbr[title] { text-decoration: underline dotted; }
.prose sub, .prose sup { font-size: .75em; line-height: 0; }
.prose ul ul, .prose ol ol, .prose ul ol, .prose ol ul { margin: .4em 0; }
.prose--comment { font-size: 16px; line-height: 1.65; }
.prose--comment h1, .prose--comment h2 { font-size: 20px; margin: 1.2em 0 .4em; }
.prose--comment h3 { font-size: 17px; }

/* --- Block styles + widgets --- */

.is-style-ecr-label { font: 12px var(--mono) !important; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.is-style-ecr-label::before { content: "/ "; }
.is-style-ecr-panel { padding: clamp(16px, 3vw, 28px); border: 1px solid var(--line); background: var(--soft); }
.is-style-ecr-panel > :last-child { margin-bottom: 0; }
.prose .is-style-ecr-accent, .is-style-ecr-accent { padding-block: 4px; padding-inline: 20px 0; border-inline-start: 4px solid var(--accent); font-style: normal; color: var(--fg); font-size: 1.15em; }
.wp-block-button__link, .wp-element-button { border-radius: 0; font-family: var(--mono); font-size: 13px; }
.wp-block-search__input { border-radius: 0; }

.footer-widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px 40px; margin-top: clamp(48px, 8vw, 96px); padding-block: 32px 8px; border-top: 1px solid var(--line); }
.footer-widgets + .site-footer { margin-top: 0; }
.widget { font-size: 15px; }
.widget__title { margin: 0 0 10px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 4px 0; }
.widget a { text-decoration: none; }
.widget a:hover { text-decoration: underline; }

/* --- Small screens --- */

@media (max-width: 720px) {
	:root { --date-col: 0px; }
	.site-header { flex-wrap: wrap; }
	.nav { order: 3; flex-basis: 100%; }
	/* With JS the nav folds behind the menu button; without JS it stays a wrapped row. */
	.menu-toggle { display: inline-flex; }
	.ecr-js .nav { display: none; }
	.ecr-js .site-header.is-menu-open .nav { display: block; }
	.ecr-js .nav__list { flex-direction: column; gap: 0; border-top: 1px solid var(--line); }
	.ecr-js .nav__list a { padding: 14px 2px; font-size: 13px; border-bottom: 1px solid var(--line); border-radius: 0; }
	.ecr-js .nav__list a:hover, .ecr-js .nav__list .current-menu-item > a { background: transparent; color: var(--fg); }
	.ecr-js .nav__list a:hover { padding-inline-start: 8px; box-shadow: inset 3px 0 0 var(--accent); }
	.ecr-js .nav__drop-btn { width: 100%; padding: 14px 2px; font-size: 13px; border-bottom: 1px solid var(--line); }
	/* Topics opens downwards, full width, under its button (not beside it). */
	.ecr-js .nav__drop { flex-direction: column; }
	.ecr-js .nav__drop-btn, .ecr-js .nav__drop.is-open .nav__drop-btn { background: transparent; border-radius: 0; }
	.ecr-js .nav__sub { position: static; width: 100%; min-width: 0; margin: 0; padding: 0 0 0 14px; box-sizing: border-box; border: 0; border-inline-start: 2px solid var(--accent); box-shadow: none; }
	.ecr-js .nav__sub a { justify-content: space-between; white-space: normal; }
	.rows__head { display: none; }
	.row summary { grid-template-columns: 1fr 24px; row-gap: 2px; }
	.row__date { grid-column: 1 / -1; }
	.row__body { grid-template-columns: 1fr; }
	.row__k { display: none; }
	.dl-row { grid-template-columns: 1fr; gap: 8px; }
	.dl-row .btn { justify-self: start; }
	.dl-card { flex-direction: column; align-items: flex-start; }
	.dl-form__row { flex-direction: column; }
	.prose { font-size: 17px; }
	.prose h2 { font-size: 24px; }
	.newsletter { grid-template-columns: 1fr; }
	.tool-group, .gloss-group { grid-template-columns: 1fr; }
	.tool { grid-template-columns: 40px 1fr; }
	.tool .btn { grid-column: 2; justify-self: start; }
	.gloss-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
	.site-header, .site-footer, .ad, .post__left, .post__right, .related, .prevnext { display: none !important; }
}
