/*
Theme Name: Sinaps
Theme URI: https://anksiyete.net/
Author: anksiyete.net
Description: Editorial theme for anksiyete.net: research notes on psychology, neurology and the brain. Bone-paper reading surface, violet signal accents, generative neuron artwork for posts without images, random Popular topics, and a Header widget area for analytics / ad code.
Version: 1.0.0
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sinaps
Tags: blog, news, two-columns, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, wide-blocks
*/

/* ---------------------------------------------------------------
   1. Tokens
---------------------------------------------------------------- */
:root {
	--paper: #f2efe7;
	--paper-2: #e9e5d9;
	--surface: #fbfaf6;
	--ink: #17171c;
	--ink-2: #4a4a55;
	--ink-3: #6b6a74;
	--line: #d7d2c4;
	--accent: #4b32c3;
	--accent-ink: #ffffff;
	--accent-soft: #dfd9fb;
	--sage: #8fb5a0;
	--sage-soft: #d5e5da;
	--coral: #e8623a;
	--coral-soft: #f6d4c6;

	--f-display: "Fraunces", "Iowan Old Style", Georgia, serif;
	--f-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

	--wrap: 1240px;
	--gutter: clamp(16px, 4vw, 40px);
	--r-sm: 6px;
	--r-md: 14px;
	--r-lg: 22px;
	--ease: cubic-bezier(.2, .7, .2, 1);
	--shadow: 0 1px 0 rgba(23, 23, 28, .04), 0 12px 32px -18px rgba(23, 23, 28, .28);

	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--paper: #121218;
		--paper-2: #191921;
		--surface: #1c1c25;
		--ink: #edeae2;
		--ink-2: #b4b2bd;
		--ink-3: #8d8b97;
		--line: #2d2d3a;
		--accent: #a797ff;
		--accent-ink: #121218;
		--accent-soft: #2b2652;
		--sage: #7ea892;
		--sage-soft: #1f3129;
		--coral: #f0805e;
		--coral-soft: #3a2219;
		--shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 16px 36px -20px rgba(0, 0, 0, .8);
		color-scheme: dark;
	}
}

:root[data-theme="dark"] {
	--paper: #121218;
	--paper-2: #191921;
	--surface: #1c1c25;
	--ink: #edeae2;
	--ink-2: #b4b2bd;
	--ink-3: #8d8b97;
	--line: #2d2d3a;
	--accent: #a797ff;
	--accent-ink: #121218;
	--accent-soft: #2b2652;
	--sage: #7ea892;
	--sage-soft: #1f3129;
	--coral: #f0805e;
	--coral-soft: #3a2219;
	--shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 16px 36px -20px rgba(0, 0, 0, .8);
	color-scheme: dark;
}

/* ---------------------------------------------------------------
   2. Base
---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--f-body);
	font-size: 1.0625rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}

/* Fine paper grain */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: -1;
	background-image: radial-gradient(rgba(23, 23, 28, .05) 1px, transparent 1px);
	background-size: 4px 4px;
	opacity: .5;
}

img, svg, video, iframe { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent-soft); color: var(--ink); }

h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 560; line-height: 1.12; letter-spacing: -.012em; margin: 0; font-variation-settings: "opsz" 96; text-wrap: balance; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--r-sm); text-decoration: none; transition: top .2s var(--ease); }
.skip-link:focus { top: 12px; }

.eyebrow {
	font-family: var(--f-mono);
	font-size: .75rem;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--ink-3);
	margin: 0 0 14px;
	display: inline-flex;
	align-items: center;
	gap: 10px;
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 4px var(--coral-soft); }

.button, button.button, input[type="submit"] {
	appearance: none;
	border: 0;
	background: var(--ink);
	color: var(--paper);
	font: 600 .9375rem/1 var(--f-body);
	padding: 14px 22px;
	min-height: 46px;
	border-radius: 999px;
	cursor: pointer;
	transition: background .2s var(--ease), transform .2s var(--ease);
}
.button:hover, input[type="submit"]:hover { background: var(--accent); color: var(--accent-ink); }
.button:active { transform: translateY(1px); }

input[type="text"], input[type="email"], input[type="url"], input[type="search"], textarea {
	width: 100%;
	font: inherit;
	color: var(--ink);
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r-sm);
	padding: 12px 14px;
	min-height: 46px;
	transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Pulse signature */
.pulse { width: 100%; height: 24px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.pulse path { vector-effect: non-scaling-stroke; }

/* ---------------------------------------------------------------
   3. Header
---------------------------------------------------------------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; pointer-events: none; }
.progress-bar { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--accent), var(--coral)); }

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: color-mix(in srgb, var(--paper) 86%, transparent);
	-webkit-backdrop-filter: saturate(1.2) blur(12px);
	backdrop-filter: saturate(1.2) blur(12px);
	border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 20px; min-height: 72px; }
.brand-wrap { margin-right: auto; }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand .mark { width: 40px; height: 40px; flex: none; transition: transform .5s var(--ease); }
.brand:hover .mark { transform: rotate(-12deg); }
.brand-word { font-family: var(--f-display); font-size: 1.6rem; font-weight: 600; letter-spacing: -.02em; line-height: 1; font-variation-settings: "opsz" 144, "SOFT" 100; }
.custom-logo-link img { max-height: 48px; width: auto; }

.mark-ring { stroke: var(--ink); }
.mark-wave { stroke: var(--accent); }
.mark-dot { fill: var(--coral); }

.header-nav { display: flex; gap: 4px; }
.nav-link {
	font-family: var(--f-mono);
	font-size: .8125rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--ink-2);
	padding: 10px 14px;
	border-radius: 999px;
	transition: background .2s var(--ease), color .2s var(--ease);
}
.nav-link:hover, .nav-link.is-current { background: var(--paper-2); color: var(--ink); }

.header-tools { display: flex; gap: 6px; }
.icon-btn {
	width: 44px; height: 44px;
	display: inline-grid; place-items: center;
	border: 1px solid var(--line);
	border-radius: 50%;
	background: transparent;
	color: var(--ink);
	cursor: pointer;
	transition: background .2s var(--ease), border-color .2s var(--ease);
}
.icon-btn:hover { background: var(--paper-2); border-color: var(--ink-3); }
.icon-btn svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .i-sun { display: block; }
	:root:not([data-theme="light"]) .i-moon { display: none; }
}

.search-panel { border-top: 1px solid var(--line); padding: 18px 0; animation: drop .25s var(--ease); }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }

.search-form { display: flex; gap: 10px; max-width: 720px; }
.search-form .search-input { border-radius: 999px; padding-inline: 20px; }

/* Header widget area (analytics/ad code): never take layout space unless an ad renders */
.site-header + .textwidget, .site-header + .custom-html-widget { display: contents; }

/* ---------------------------------------------------------------
   4. Home
---------------------------------------------------------------- */
.intro { padding-top: clamp(40px, 7vw, 88px); padding-bottom: 28px; }
.intro-title { font-size: clamp(2.4rem, 6.4vw, 5.25rem); font-weight: 420; max-width: 15ch; letter-spacing: -.03em; font-variation-settings: "opsz" 144, "SOFT" 50; }
.intro-title em { font-style: italic; color: var(--accent); font-weight: 380; }
.intro-pulse { margin-top: 28px; max-width: 520px; }

.lead {
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
	gap: clamp(20px, 4vw, 56px);
	align-items: center;
	padding-top: 24px;
	padding-bottom: clamp(40px, 6vw, 72px);
}
.lead-media { display: block; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 16 / 10; background: var(--paper-2); box-shadow: var(--shadow); }
.lead-media img, .lead-media svg { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.lead:hover .lead-media img, .lead:hover .lead-media svg { transform: scale(1.03); }
.lead-title { font-size: clamp(1.8rem, 3.4vw, 2.9rem); margin: 14px 0 16px; }
.lead-link { text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat; transition: background-size .4s var(--ease); }
.lead-link:hover { background-size: 100% 2px; }
.lead-excerpt { color: var(--ink-2); font-size: 1.125rem; max-width: 48ch; }

.badge { font-family: var(--f-mono); font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; background: var(--coral); color: #fff; padding: 5px 9px; border-radius: 999px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-top: 1px solid var(--ink); padding-top: 18px; margin-bottom: 28px; }
.section-title { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.section-count { font-family: var(--f-mono); font-size: .75rem; color: var(--ink-3); letter-spacing: .1em; text-transform: uppercase; }

/* ---------------------------------------------------------------
   5. Cards
---------------------------------------------------------------- */
.feed { padding-bottom: 32px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: clamp(20px, 2.6vw, 36px) clamp(18px, 2.2vw, 28px); }

.card { display: flex; flex-direction: column; min-width: 0; }
.card-media { display: block; border-radius: var(--r-md); overflow: hidden; aspect-ratio: 16 / 10; background: var(--paper-2); margin-bottom: 16px; }
.card-media img, .card-media svg { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card:hover .card-media img, .card:hover .card-media svg { transform: scale(1.04); }
.card-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.card-index { font-family: var(--f-mono); font-size: .75rem; color: var(--accent); font-weight: 500; }
.card-title { font-size: 1.3rem; font-weight: 560; line-height: 1.22; margin-bottom: 8px; }
.card-link { text-decoration: none; }
.card-link:hover { color: var(--accent); }
.card-excerpt { color: var(--ink-2); font-size: .9688rem; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.chip {
	font-family: var(--f-mono);
	font-size: .6875rem;
	letter-spacing: .1em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--ink-2);
	border: 1px solid var(--line);
	padding: 4px 9px;
	border-radius: 999px;
	transition: border-color .2s var(--ease), color .2s var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

.meta { font-family: var(--f-mono); font-size: .75rem; color: var(--ink-3); display: inline-flex; gap: 8px; align-items: center; margin-top: auto; }
.meta-sep { opacity: .5; }

/* Generative art */
.art { width: 100%; height: 100%; }
.art-bg { fill: var(--art-bg); }
.art-ring { fill: none; stroke: var(--art-line); stroke-width: 1; opacity: .5; }
.art-axon { fill: none; stroke: var(--art-ink); stroke-width: 1.6; stroke-linecap: round; opacity: .75; }
.art-dendrite { stroke: var(--art-ink); stroke-width: 1.1; stroke-linecap: round; opacity: .55; }
.art-soma { fill: var(--art-ink); }
.art-spark { fill: var(--coral); }
.art--violet { --art-bg: var(--accent-soft); --art-ink: var(--accent); --art-line: var(--accent); }
.art--sage { --art-bg: var(--sage-soft); --art-ink: #2f5a45; --art-line: var(--sage); }
.art--coral { --art-bg: var(--coral-soft); --art-ink: #8a3318; --art-line: var(--coral); }
.art--ink { --art-bg: #1f1f27; --art-ink: #cfc8ff; --art-line: #4b4a5c; }
:root[data-theme="dark"] .art--sage { --art-ink: #a9d3bd; }
:root[data-theme="dark"] .art--coral { --art-ink: #ffb79f; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .art--sage { --art-ink: #a9d3bd; }
	:root:not([data-theme="light"]) .art--coral { --art-ink: #ffb79f; }
}

/* ---------------------------------------------------------------
   6. Popular topics
---------------------------------------------------------------- */
.popular {
	margin: clamp(40px, 6vw, 80px) 0;
	padding: clamp(24px, 4vw, 48px);
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	position: relative;
	overflow: hidden;
}
.popular::after {
	content: "";
	position: absolute;
	right: -120px; top: -120px;
	width: 320px; height: 320px;
	border-radius: 50%;
	background: radial-gradient(circle, var(--accent-soft), transparent 70%);
	pointer-events: none;
}
.popular-head { display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 28px; margin-bottom: 28px; position: relative; z-index: 1; }
.popular-head .eyebrow { grid-column: 1 / -1; }
.popular-title { font-size: clamp(1.75rem, 3.4vw, 2.6rem); font-weight: 460; font-style: italic; }
.popular-pulse { height: 28px; align-self: center; }

.popular-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 18px;
	counter-reset: pop;
	position: relative;
	z-index: 1;
}
/* fewer cards: shrink columns instead of leaving blank slots */
.popular--n1 .popular-grid { grid-template-columns: minmax(0, 1fr); max-width: 360px; }
.popular--n2 .popular-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.popular--n3 .popular-grid, .popular--n6 .popular-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.popular--n5 .popular-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.popular--n5 .pop-card { grid-column: span 2; }
.popular--n5 .pop-card:nth-child(n+4) { grid-column: span 3; }
.popular--n7 .popular-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.popular--n7 .pop-card { grid-column: span 3; }
.popular--n7 .pop-card:nth-child(-n+3) { grid-column: span 4; }

.pop-card {
	display: flex;
	flex-direction: column;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	overflow: hidden;
	min-width: 0;
	transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.pop-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.pop-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--paper-2); }
.pop-media img, .pop-media svg { width: 100%; height: 100%; object-fit: cover; }
.pop-body { padding: 14px 16px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; flex: 1; align-content: flex-start; }
.pop-index { font-family: var(--f-mono); font-size: .75rem; font-weight: 500; color: var(--accent); }
.pop-title { flex-basis: 100%; font-size: 1.0625rem; font-weight: 560; line-height: 1.3; font-variation-settings: "opsz" 24; }
.pop-link { text-decoration: none; }
.pop-link:hover { color: var(--accent); }
.pop-link::after { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.pop-card { position: relative; }
.pop-card .chip { position: relative; z-index: 2; }

/* ---------------------------------------------------------------
   7. Article
---------------------------------------------------------------- */
.article-head { padding-top: clamp(32px, 6vw, 72px); padding-bottom: 28px; max-width: 980px; }
.crumbs { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; font-family: var(--f-mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }
.crumb { text-decoration: none; color: var(--ink-3); }
.crumb:hover { color: var(--accent); }
.crumb-sep { color: var(--ink-3); }
.article-title { font-size: clamp(2.1rem, 5.2vw, 4rem); font-weight: 480; letter-spacing: -.025em; font-variation-settings: "opsz" 144; }
.article-deck { font-size: clamp(1.125rem, 1.8vw, 1.35rem); color: var(--ink-2); margin: 20px 0 0; max-width: 58ch; font-family: var(--f-display); font-style: italic; font-weight: 380; }
.article-meta { margin-top: 22px; }

.article-media { margin-top: 0; margin-bottom: clamp(28px, 4vw, 48px); }
.article-media img, .article-media > svg { width: 100%; border-radius: var(--r-lg); aspect-ratio: 21 / 10; object-fit: cover; }
.article-media figcaption { font-size: .8125rem; color: var(--ink-3); margin-top: 10px; }

.article-layout { display: grid; grid-template-columns: 200px minmax(0, 720px); gap: clamp(24px, 5vw, 80px); justify-content: center; }
.article-layout--solo { grid-template-columns: minmax(0, 720px); }
.article-rail { position: sticky; top: 100px; align-self: start; display: grid; gap: 20px; border-top: 1px solid var(--ink); padding-top: 16px; }
.rail-block { display: grid; gap: 4px; font-size: .9375rem; }
.rail-label { font-family: var(--f-mono); font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.rail-share { justify-self: start; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; min-height: 40px; color: var(--ink); font: inherit; font-size: .875rem; cursor: pointer; }
.rail-share:hover { border-color: var(--accent); color: var(--accent); }

.prose { font-size: 1.1563rem; line-height: 1.75; min-width: 0; }
.prose > * + * { margin-top: 1.15em; }
.prose p { margin: 0; }
.prose > p:first-of-type::first-letter { font-family: var(--f-display); float: left; font-size: 4.1em; line-height: .82; padding: .06em .1em 0 0; color: var(--accent); font-weight: 500; }
.prose h2 { font-size: 1.85rem; margin-top: 1.9em; }
.prose h3 { font-size: 1.4rem; margin-top: 1.6em; }
.prose a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.prose a:hover { text-decoration-color: currentColor; }
.prose blockquote { margin-inline: 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--coral); font-family: var(--f-display); font-style: italic; font-size: 1.3rem; line-height: 1.5; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--accent); }
.prose img, .prose figure { border-radius: var(--r-md); }
.prose figure { margin-inline: 0; }
.prose figcaption, .wp-element-caption { font-size: .8125rem; color: var(--ink-3); margin-top: 8px; }
.prose pre { background: var(--ink); color: var(--paper); padding: 18px; border-radius: var(--r-sm); overflow-x: auto; font-size: .875rem; }
.prose code { font-family: var(--f-mono); font-size: .9em; }
.prose table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2.4em 0; }
.alignwide { margin-inline: calc(-1 * min(120px, 6vw)); }
.alignfull { margin-inline: calc(50% - 50vw); max-width: 100vw; }
.aligncenter { margin-inline: auto; }

.tag-list { list-style: none; padding: 0; margin: 2.4em 0 0 !important; display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-family: var(--f-mono); font-size: .8125rem; text-decoration: none !important; color: var(--ink-2) !important; background: var(--paper-2); padding: 6px 12px; border-radius: 999px; }
.tag:hover { background: var(--accent-soft); color: var(--accent) !important; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: clamp(40px, 6vw, 72px); }
.post-nav-item { display: grid; gap: 8px; padding: 20px 0; border-top: 1px solid var(--ink); }
.post-nav-item a { font-family: var(--f-display); font-size: 1.2rem; font-weight: 520; line-height: 1.3; text-decoration: none; }
.post-nav-item a:hover { color: var(--accent); }
.post-nav-next { text-align: right; grid-column: 2; }

/* ---------------------------------------------------------------
   8. Lists, search, 404
---------------------------------------------------------------- */
.list-head { padding-top: clamp(36px, 6vw, 72px); padding-bottom: 32px; }
.list-title { font-size: clamp(2rem, 5vw, 3.6rem); font-weight: 460; max-width: 22ch; }
.list-desc { color: var(--ink-2); max-width: 60ch; margin-top: 14px; }
.list-head .pulse { max-width: 360px; margin-top: 22px; }
.list-search { margin-top: 24px; }
.empty { color: var(--ink-2); padding: 24px 0 48px; }
.notfound { padding-top: clamp(48px, 8vw, 110px); }
.notfound .intro-pulse { margin: 24px 0; }

.navigation.pagination { margin-top: 48px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.page-numbers { white-space: nowrap; min-width: 44px; height: 44px; padding: 0 14px; display: inline-grid; place-items: center; border-radius: 999px; text-decoration: none; font-family: var(--f-mono); font-size: .875rem; border: 1px solid var(--line); }
.page-numbers.current { background: var(--ink); color: var(--paper); border-color: var(--ink); }
a.page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.page-numbers.dots { border: 0; }

/* ---------------------------------------------------------------
   9. Comments
---------------------------------------------------------------- */
.comments { padding-bottom: 40px; }
.comments-inner { max-width: 720px; margin-inline: auto; }
.comment-list, .comment-list .children { list-style: none; padding: 0; margin: 24px 0; }
.comment-list .children { padding-left: clamp(16px, 4vw, 40px); }
.comment-card { padding: 20px 0; border-bottom: 1px solid var(--line); }
.comment-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.comment-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-family: var(--f-display); font-weight: 600; }
.comment-author { font-weight: 600; }
.comment-date { margin-left: auto; font-family: var(--f-mono); font-size: .75rem; color: var(--ink-3); text-decoration: none; }
.comment-reply a, .cancel-reply, #cancel-comment-reply-link { font-family: var(--f-mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); text-decoration: none; }
.comment-respond { margin-top: 32px; padding: clamp(20px, 4vw, 36px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.comment-reply-title { font-size: 1.6rem; margin-bottom: 16px; }
.comment-form { display: grid; gap: 14px; }
.comment-form label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 6px; }
.comment-form-cookies-consent { display: flex; gap: 10px; align-items: start; font-size: .875rem; }
.comment-form-cookies-consent label { font-weight: 400; }

/* ---------------------------------------------------------------
   10. Footer
---------------------------------------------------------------- */
.site-footer { margin-top: clamp(48px, 8vw, 96px); background: var(--ink); color: var(--paper); padding-top: clamp(40px, 6vw, 72px); }
.site-footer .brand, .site-footer .brand-word { color: var(--paper); }
.site-footer .mark-ring { stroke: var(--paper); }
.site-footer .mark-wave { stroke: #a797ff; }
:root[data-theme="dark"] .site-footer, :root[data-theme="dark"] .site-footer .brand { color: var(--ink); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: clamp(28px, 5vw, 64px); padding-bottom: 40px; }
.footer-about { color: color-mix(in srgb, var(--paper) 72%, transparent); margin-top: 16px; max-width: 38ch; font-size: .9688rem; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.footer-links .menu-link { color: var(--paper); text-decoration: none; font-size: .9688rem; display: inline-block; padding: 6px 0; opacity: .85; }
.footer-links .menu-link:hover { opacity: 1; text-decoration: underline; }
.footer-note p { font-size: .8125rem; color: color-mix(in srgb, var(--paper) 62%, transparent); margin-top: 14px; }
.footer-note .pulse { stroke: #a797ff; max-width: 220px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 22px; border-top: 1px solid color-mix(in srgb, var(--paper) 16%, transparent); font-family: var(--f-mono); font-size: .75rem; letter-spacing: .06em; }
.footer-bottom p { margin: 0; color: color-mix(in srgb, var(--paper) 70%, transparent); }
.footer-home, .to-top { color: var(--paper); text-decoration: none; }
.to-top:hover, .footer-home:hover { text-decoration: underline; }

/* Dark mode: footer becomes a raised panel instead of inverted */
:root[data-theme="dark"] .site-footer { background: var(--paper-2); color: var(--ink); border-top: 1px solid var(--line); }
:root[data-theme="dark"] .site-footer .brand-word, :root[data-theme="dark"] .footer-links .menu-link, :root[data-theme="dark"] .footer-home, :root[data-theme="dark"] .to-top { color: var(--ink); }
:root[data-theme="dark"] .site-footer .mark-ring { stroke: var(--ink); }
:root[data-theme="dark"] .footer-about, :root[data-theme="dark"] .footer-note p, :root[data-theme="dark"] .footer-bottom p { color: var(--ink-2); }
:root[data-theme="dark"] .footer-bottom { border-color: var(--line); }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .site-footer { background: var(--paper-2); color: var(--ink); border-top: 1px solid var(--line); }
	:root:not([data-theme="light"]) .site-footer .brand-word, :root:not([data-theme="light"]) .footer-links .menu-link, :root:not([data-theme="light"]) .footer-home, :root:not([data-theme="light"]) .to-top { color: var(--ink); }
	:root:not([data-theme="light"]) .site-footer .mark-ring { stroke: var(--ink); }
	:root:not([data-theme="light"]) .footer-about, :root:not([data-theme="light"]) .footer-note p, :root:not([data-theme="light"]) .footer-bottom p { color: var(--ink-2); }
	:root:not([data-theme="light"]) .footer-bottom { border-color: var(--line); }
}

/* ---------------------------------------------------------------
   11. Responsive
---------------------------------------------------------------- */
@media (max-width: 1100px) {
	.popular-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
	.popular .pop-card { grid-column: auto !important; }
	.popular--n1 .popular-grid { grid-template-columns: minmax(0, 1fr) !important; }
	.popular--n3 .pop-card:last-child, .popular--n5 .pop-card:last-child, .popular--n7 .pop-card:last-child { grid-column: 1 / -1 !important; }
}

@media (max-width: 900px) {
	.lead { grid-template-columns: 1fr; }
	.article-layout { grid-template-columns: minmax(0, 1fr); }
	.article-rail { position: static; grid-template-columns: repeat(3, auto); justify-content: start; gap: 24px; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.footer-brand { grid-column: 1 / -1; }
	.alignwide { margin-inline: 0; }
}

@media (max-width: 620px) {
	body { font-size: 1rem; }
	.header-row { min-height: 64px; gap: 8px; }
	.brand-word { font-size: 1.35rem; }
	.brand .mark { width: 34px; height: 34px; }
	.header-nav .nav-link { padding: 10px 10px; }
	.header-nav .nav-link:first-child { display: none; }
	.popular { padding: 20px 16px; border-radius: var(--r-md); }
	.popular-head { grid-template-columns: 1fr; }
	.popular-pulse { display: none; }
	.popular-grid { gap: 12px; }
	.pop-body { padding: 10px 12px 14px; }
	.pop-title { font-size: .9688rem; }
	.pop-body .chip { display: none; }
	.article-rail { grid-template-columns: 1fr 1fr; }
	.article-media img, .article-media > svg { aspect-ratio: 16 / 10; border-radius: var(--r-md); }
	.prose { font-size: 1.0625rem; }
	.post-nav { grid-template-columns: 1fr; }
	.post-nav-next { grid-column: auto; text-align: left; }
	.footer-grid { grid-template-columns: 1fr; }
	.footer-bottom { flex-direction: column; align-items: flex-start; }
	.search-form { flex-direction: column; }
}

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

@media print {
	.site-header, .site-footer, .popular, .article-rail, .post-nav, .comments, .progress { display: none !important; }
	body { background: #fff; color: #000; }
}
