/* ==========================================================================
   SMART.POV Editorial — main stylesheet
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
	--accent: #B5532E;
	--bg: #F7F5F1;
	--surface: #FFFFFF;
	--surface-2: #EFEBE4;
	--ink: #16150F;
	--ink-2: #3D3A33;
	--muted: #6E695F;
	--line: #E3DED4;
	--line-strong: #CFC8BB;
	--glass: rgba(247, 245, 241, .82);
	--shadow-sm: 0 1px 2px rgba(22, 21, 15, .05), 0 1px 1px rgba(22, 21, 15, .03);
	--shadow: 0 10px 30px -12px rgba(22, 21, 15, .18), 0 2px 6px rgba(22, 21, 15, .05);
	--shadow-lg: 0 30px 80px -20px rgba(22, 21, 15, .35);
	--serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
	--sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--r-sm: 8px;
	--r: 14px;
	--r-lg: 22px;
	--wrap: 1240px;
	--narrow: 760px;
	--gutter: clamp(16px, 4vw, 32px);
	--header-h: 68px;
	--appbar-h: 64px;
	--ease: cubic-bezier(.2, .7, .2, 1);
	--safe-b: env(safe-area-inset-bottom, 0px);
	color-scheme: light;
}
:root[data-theme="dark"] {
	--bg: #121210;
	--surface: #1A1A17;
	--surface-2: #23221E;
	--ink: #EEEBE4;
	--ink-2: #CFCAC0;
	--muted: #9A958A;
	--line: #2D2B26;
	--line-strong: #3B3932;
	--glass: rgba(18, 18, 16, .78);
	--shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
	--shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .8);
	color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 20px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 400 16px/1.6 var(--sans);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
	position: fixed; top: 10px; left: 10px; z-index: 999; padding: 10px 16px;
	background: var(--ink); color: var(--bg); border-radius: 999px; transform: translateY(-150%);
	transition: transform .2s var(--ease);
}
.skip-link:focus { transform: none; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: calc(var(--narrow) + var(--gutter) * 2); }
.site-main { min-height: 60vh; outline: 0; }
.section { padding-block: clamp(36px, 6vw, 72px); }
.section--tight { padding-top: 12px; }
.stack { display: grid; gap: 4px; }

.eyebrow {
	font: 600 11px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase;
	color: var(--accent); margin: 0 0 12px;
}
.dot { color: var(--line-strong); margin-inline: 6px; }

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 46px; padding: 0 22px; border-radius: 999px;
	background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px; letter-spacing: .01em;
	transition: transform .2s var(--ease), background .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: scale(.98); }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.btn--ghost:hover { background: var(--surface); }
.btn.is-loading { opacity: .6; pointer-events: none; }
.icon-btn {
	display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 999px;
	color: var(--ink-2); position: relative; transition: background .2s, color .2s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.pill-btn, .bm-btn {
	display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px;
	border-radius: 999px; color: var(--ink-2); font-size: 13px; font-weight: 500;
	border: 1px solid var(--line); background: var(--surface); transition: all .2s var(--ease);
}
.pill-btn:hover, .bm-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.card .bm-btn { width: 34px; height: 34px; padding: 0; justify-content: center; border-color: transparent; background: transparent; }
.card .bm-btn:hover { background: var(--surface-2); }
.bm-btn[aria-pressed="true"] { color: var(--accent); }
.bm-btn[aria-pressed="true"] svg { fill: currentColor; }
.bm-btn.pop svg { animation: pop .35s var(--ease); }
@keyframes pop { 50% { transform: scale(1.35); } }
.badge {
	position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px;
	border-radius: 999px; background: var(--accent); color: #fff; font: 600 10px/16px var(--sans);
	text-align: center; font-style: normal;
}
.kbd {
	display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 5px;
	border-radius: 5px; border: 1px solid var(--line-strong); background: var(--surface);
	font: 500 11px/1 var(--sans); color: var(--muted);
}

/* ---------- Chips ---------- */
.chip {
	display: inline-block; font: 600 11px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase;
	color: var(--accent); margin-bottom: 10px;
}
.chip:hover { text-decoration: underline; text-underline-offset: 3px; }
.chip--accent { margin-bottom: 18px; }
.chip--pill {
	letter-spacing: .02em; text-transform: none; font: 500 14px/1 var(--sans); color: var(--ink-2);
	padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
	white-space: nowrap; margin: 0; transition: all .2s var(--ease);
}
.chip--pill:hover { text-decoration: none; border-color: var(--ink); color: var(--ink); }
.chips { display: flex; gap: 8px; list-style: none; }
.chips--wrap { flex-wrap: wrap; margin-top: 18px; }
.chips-rail { overflow: hidden; }
.chips-rail .chips {
	overflow-x: auto; scroll-snap-type: x proximity; padding-block: 4px 18px;
	scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
	mask-image: linear-gradient(90deg, #000 92%, transparent);
}
.chips-rail .chips::-webkit-scrollbar { display: none; }
.chips-rail li { scroll-snap-align: start; }

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

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 100; height: var(--header-h);
	background: var(--glass); -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px);
	border-bottom: 1px solid transparent; transition: transform .35s var(--ease), border-color .3s, box-shadow .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header.is-hidden { transform: translateY(-100%); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; flex-shrink: 0; position: relative; }
.brand-logo { height: 34px; width: auto; }
.brand-logo--dark { display: none; }
:root[data-theme="dark"] .brand-logo--dark { display: block; }
:root[data-theme="dark"] .brand:has(.brand-logo--dark) .brand-logo:not(.brand-logo--dark) { display: none; }
:root[data-theme="dark"] .brand:not(:has(.brand-logo--dark)) .brand-logo { filter: invert(1) hue-rotate(180deg); }
.brand-word { font: 600 24px/1 var(--serif); letter-spacing: -.02em; }
.brand-dot { color: var(--accent); }

.nav-primary { flex: 1; min-width: 0; }
.nav-primary .menu { display: flex; align-items: center; gap: 2px; list-style: none; justify-content: center; }
.nav-primary .menu > li { position: relative; }
.nav-primary .menu > li > a {
	display: block; padding: 10px 11px; font-size: 14px; font-weight: 500; color: var(--ink-2);
	border-radius: 999px; white-space: nowrap; transition: color .2s, background .2s;
}
.nav-primary .menu > li > a:hover, .nav-primary .current-menu-item > a, .nav-primary .current-menu-ancestor > a { color: var(--ink); background: var(--surface-2); }
.nav-primary .sub-menu {
	position: absolute; top: calc(100% + 8px); left: 0; min-width: 220px; list-style: none; padding: 8px;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
	opacity: 0; visibility: hidden; transform: translateY(6px); transition: all .2s var(--ease);
}
.nav-primary li:hover > .sub-menu, .nav-primary li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.nav-primary .sub-menu a { display: block; padding: 9px 12px; border-radius: 8px; font-size: 14px; }
.nav-primary .sub-menu a:hover { background: var(--surface-2); }

.header-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.search-trigger {
	display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px 0 14px; min-width: 190px;
	border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted);
	font-size: 14px; margin-right: 6px; transition: border-color .2s, box-shadow .2s;
}
.search-trigger:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.search-trigger .kbd { margin-left: auto; }
.when-dark { display: none; }
:root[data-theme="dark"] .when-dark { display: inline-flex; align-items: center; gap: 8px; }
:root[data-theme="dark"] .when-light { display: none; }
.when-light { display: inline-flex; align-items: center; gap: 8px; }

.show-md, .show-sm-inline { display: none !important; }

/* Desktop header: one fixed row — logo · menu · search · saved · theme. No height changes on scroll (prevents flicker). */
@media (min-width: 1025px) {
	:root { --header-h: 74px; }
	.header-inner { gap: 28px; }
	.nav-primary .menu { justify-content: flex-start; gap: 2px; }
	.nav-primary .menu > li > a { padding: 10px 13px; font-size: 14.5px; font-weight: 500; }
	.header-actions { margin-left: 0; flex: 0 1 auto; }
}
.nav-primary .menu-item-has-children > a { display: inline-flex !important; align-items: center; gap: 6px; }
.nav-primary .menu-item-has-children > a::after {
	content: ""; width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
	transform: translateY(-2px) rotate(45deg); opacity: .6; transition: transform .2s var(--ease);
}
.nav-primary .menu-item-has-children:hover > a::after { transform: translateY(1px) rotate(225deg); }
.nav-primary .sub-menu { padding: 8px; min-width: 230px; }
.nav-primary .sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }

/* ---------- Cards ---------- */
.card { position: relative; display: grid; gap: 16px; align-content: start; }
.card-media {
	display: block; position: relative; overflow: hidden; border-radius: var(--r);
	background: var(--surface-2); aspect-ratio: 16 / 10;
}
.card-img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.card-img--empty { display: block; background: linear-gradient(135deg, var(--surface-2), var(--line)); }
.card:hover .card-img { transform: scale(1.04); }
.card-title { font: 500 clamp(19px, 1.6vw, 22px)/1.25 var(--serif); letter-spacing: -.012em; color: var(--ink); }
.card-title a { background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .4s var(--ease); }
.card:hover .card-title a { background-size: 100% 1px; }
.card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card .chip, .card .bm-btn, .card .meta-author { position: relative; z-index: 2; }
.card-excerpt { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 10px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.meta { display: inline-flex; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.meta-author { color: var(--ink-2); font-weight: 500; }
.meta-author:hover { color: var(--accent); }

.card--hero .card-media { aspect-ratio: 16 / 10; border-radius: var(--r-lg); }
.card--hero .card-title { font-size: clamp(28px, 3.4vw, 44px); line-height: 1.08; letter-spacing: -.025em; }
.card--hero .card-excerpt { font-size: 17px; -webkit-line-clamp: 3; max-width: 60ch; }

.card--list { grid-template-columns: minmax(0, 1fr) 120px; gap: 18px; padding-block: 18px; border-bottom: 1px solid var(--line); }
.card--list:last-child { border-bottom: 0; }
.card--list .card-media { order: 2; aspect-ratio: 1; border-radius: var(--r-sm); }
.card--list .card-title { font-size: 19px; }
.card--list .card-excerpt { -webkit-line-clamp: 2; font-size: 14px; }

.card--rank, .card--mini { grid-template-columns: 34px minmax(0, 1fr) 76px; gap: 14px; align-items: center; }
.card--rank .card-media, .card--mini .card-media { order: 3; aspect-ratio: 1; border-radius: var(--r-sm); }
.card--rank .card-title { font-size: 17px; line-height: 1.3; }
.card--rank .card-foot { margin-top: 6px; }
.card--rank .chip { margin-bottom: 6px; }
.card-rank { font: 500 30px/1 var(--serif); color: var(--line-strong); font-variant-numeric: tabular-nums; }

/* ---------- Grids ---------- */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 3vw, 40px) clamp(20px, 2.4vw, 32px); }
.grid > .card--hero { grid-column: 1 / -1; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: center; gap: clamp(20px, 4vw, 48px); }
.grid > .card--hero .card-media { aspect-ratio: 16 / 10; }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.more-wrap { display: flex; justify-content: center; margin-top: 48px; }
.grid .card.is-new { animation: rise .6s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 28px; padding-bottom: 14px; border-bottom: 1px solid var(--ink); }
.section-title { font: 500 clamp(24px, 2.6vw, 34px)/1.1 var(--serif); letter-spacing: -.02em; display: inline-flex; align-items: center; gap: 10px; }
.section-title svg { color: var(--accent); }
.section-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.section-link:hover { color: var(--accent); }
.section-link svg { transition: transform .2s var(--ease); }
.section-link:hover svg { transform: translateX(3px); }

/* ---------- Homepage ---------- */
.intro { padding-top: clamp(28px, 6vw, 64px); padding-bottom: 20px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px 48px; align-items: end; }
.intro-title { font: 400 clamp(36px, 6vw, 76px)/.98 var(--serif); letter-spacing: -.035em; font-variation-settings: "opsz" 144; }
.intro-text { color: var(--muted); font-size: clamp(16px, 1.4vw, 18px); max-width: 46ch; margin: 0; }
.lead { padding-top: 16px; }
.lead-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); }
.lead-side { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.lead-side .card--list:first-child { padding-top: 18px; }

.trending { padding-bottom: 24px; }
.rail { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 40px; }
.rail .card { padding-block: 16px; border-bottom: 1px solid var(--line); }
.rail-nav { display: none; }

.cat-section--alt { background: var(--surface); }
.cat-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); }
.cat-main .card-title { font-size: clamp(24px, 2.4vw, 32px); line-height: 1.12; }
.cat-list { display: flex; flex-direction: column; }
.cat-list .card--list:first-child { padding-top: 0; }

/* Newsletter */
.newsletter {
	margin-block: clamp(24px, 5vw, 56px); border-radius: var(--r-lg); overflow: hidden; position: relative;
	background: var(--ink); color: var(--bg);
}
.newsletter::before {
	content: ""; position: absolute; inset: 0; opacity: .5;
	background: radial-gradient(800px 300px at 90% -20%, color-mix(in srgb, var(--accent) 70%, transparent), transparent 60%);
}
.newsletter-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px 48px; align-items: center; padding: clamp(28px, 5vw, 56px); }
.newsletter-title { font: 400 clamp(26px, 3.2vw, 40px)/1.08 var(--serif); letter-spacing: -.02em; margin-bottom: 12px; }
.newsletter p { opacity: .75; margin: 0; max-width: 48ch; }
.newsletter .eyebrow { color: color-mix(in srgb, var(--accent) 60%, #fff); opacity: 1; margin-bottom: 12px; }
.newsletter .btn { background: var(--bg); color: var(--ink); justify-self: start; }
.newsletter-form { display: flex; gap: 8px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); padding: 6px; border-radius: 999px; }
.newsletter-form input { flex: 1; min-width: 0; background: transparent; border: 0; padding: 0 16px; color: inherit; outline: 0; }
.newsletter-form input::placeholder { color: inherit; opacity: .55; }

.banner { margin-block: 24px; text-align: center; }
.banner img { margin-inline: auto; border-radius: var(--r); }

/* ---------- Breadcrumbs ---------- */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; font-size: 13px; color: var(--muted); margin-bottom: 22px; }
.crumbs li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.crumbs li + li::before { content: "/"; color: var(--line-strong); }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current] { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }

/* ---------- Article ---------- */
.article-head { padding-top: clamp(24px, 5vw, 56px); text-align: left; }
.article-title {
	font: 400 clamp(34px, 5.2vw, 62px)/1.04 var(--serif); letter-spacing: -.03em;
	font-variation-settings: "opsz" 144; text-wrap: balance;
}
.article-title a:hover { color: var(--accent); }
.article-dek { font-size: clamp(18px, 1.8vw, 21px); line-height: 1.5; color: var(--ink-2); margin: 20px 0 0; max-width: 62ch; }
.article-byline { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px; margin-top: 28px; padding-block: 18px; border-block: 1px solid var(--line); }
.byline-author { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.byline-author img { border-radius: 999px; width: 40px; height: 40px; }
.byline-by { color: var(--muted); font-weight: 400; }
.byline-meta { display: inline-flex; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.byline-meta svg { display: inline; vertical-align: -2px; }
.byline-actions { display: flex; gap: 8px; margin-left: auto; }

.article-hero { margin: 32px auto 0; }
.article-hero-img { width: 100%; max-height: 78vh; object-fit: cover; border-radius: var(--r-lg); }
.article-hero figcaption, .prose figcaption, .prose .wp-element-caption { font-size: 13px; color: var(--muted); margin-top: 10px; text-align: center; }

.article-layout { display: grid; gap: 48px; padding-top: clamp(28px, 5vw, 56px); justify-content: center; }
.article-layout.has-toc.has-rail { grid-template-columns: 220px minmax(0, var(--narrow)) 260px; }
.article-layout.has-toc.no-rail { grid-template-columns: 240px minmax(0, var(--narrow)) 240px; }
.article-layout.has-toc.no-rail::after { content: ""; }
.article-layout.no-toc.has-rail { grid-template-columns: minmax(0, var(--narrow)) 280px; }
.article-layout.no-toc.no-rail { grid-template-columns: minmax(0, var(--narrow)); }
.article-main { min-width: 0; }
.toc-aside, .rail-sticky { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; max-height: calc(100vh - var(--header-h) - 48px); overflow: auto; scrollbar-width: thin; }
.article-rail { align-self: stretch; }
.rail-sticky { position: sticky; }
.toc-title { display: flex; align-items: center; gap: 8px; font: 600 11px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.toc-list { list-style: none; border-left: 1px solid var(--line); }
.toc-list a {
	display: block; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 2px solid transparent;
	font-size: 13.5px; line-height: 1.4; color: var(--muted); transition: color .2s, border-color .2s;
}
.toc-list .toc-l3 a { padding-left: 30px; font-size: 13px; }
.toc-list a:hover { color: var(--ink); }
.toc-list a.is-active { color: var(--ink); border-left-color: var(--accent); font-weight: 500; }
.toc-inline { display: none; margin-bottom: 28px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.toc-inline summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 18px; font-weight: 600; font-size: 14px; cursor: pointer; }
.toc-inline summary::-webkit-details-marker { display: none; }
.toc-inline summary::after { content: "+"; margin-left: auto; font-size: 20px; font-weight: 400; color: var(--muted); }
.toc-inline[open] summary::after { content: "–"; }
.toc-inline .toc-list { margin: 0 18px 16px; }
.toc-count { font-size: 12px; color: var(--muted); font-weight: 500; background: var(--surface-2); padding: 2px 8px; border-radius: 999px; }

/* Prose */
.prose { font-size: clamp(17px, 1.25vw, 18.5px); line-height: 1.75; color: var(--ink-2); overflow-wrap: break-word; }
.prose > * { margin-block: 0 1.25em; }
.prose h2 { font: 500 clamp(26px, 2.6vw, 34px)/1.18 var(--serif); letter-spacing: -.02em; color: var(--ink); margin: 2.2em 0 .7em; }
.prose h3 { font: 600 clamp(20px, 1.8vw, 23px)/1.3 var(--sans); letter-spacing: -.01em; color: var(--ink); margin: 1.8em 0 .6em; }
.prose h4 { font: 600 18px/1.35 var(--sans); color: var(--ink); margin: 1.6em 0 .5em; }
.prose h2 strong, .prose h3 strong { font-weight: inherit; }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; transition: text-decoration-color .2s; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--accent); }
.prose img { border-radius: var(--r); margin-inline: auto; }
.prose figure { margin-inline: 0; }
.prose .alignwide { margin-inline: calc(-1 * min(8vw, 120px)); max-width: none; }
.prose .alignfull { margin-inline: calc(50% - 50vw); max-width: 100vw; }
.prose .alignfull img { border-radius: 0; }
.prose blockquote, .prose .wp-block-quote {
	margin-inline: 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--accent);
	font: italic 400 clamp(21px, 2vw, 25px)/1.45 var(--serif); color: var(--ink);
}
.prose blockquote cite { display: block; margin-top: 10px; font: 500 13px var(--sans); font-style: normal; color: var(--muted); }
.prose .wp-block-pullquote { border-block: 1px solid var(--line); padding: 28px 0; text-align: center; }
.prose hr { border: 0; height: 1px; background: var(--line); margin-block: 2.6em; }
.prose code { font-size: .88em; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; }
.prose pre { overflow-x: auto; background: var(--surface-2); padding: 18px; border-radius: var(--r); font-size: 14px; }
.prose em { color: inherit; }
.prose p > em:only-child { display: block; font-size: 13px; color: var(--muted); text-align: center; margin-top: -.6em; }
.prose .lead, .prose p.lead { font-size: 1.18em; color: var(--ink); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); margin-block: 1.6em; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.prose tr:last-child td { border-bottom: 0; }
.prose iframe { width: 100%; border-radius: var(--r); }
.prose .wp-block-embed__wrapper { position: relative; }
.prose .wp-block-buttons .wp-block-button__link { border-radius: 999px; background: var(--ink); color: var(--bg); text-decoration: none; }

.article-foot { margin-top: 48px; display: grid; gap: 28px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.tags a { display: inline-block; padding: 7px 13px; border-radius: 999px; background: var(--surface-2); font-size: 13px; color: var(--ink-2); }
.tags a:hover { background: var(--ink); color: var(--bg); }
.share-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding-block: 20px; border-block: 1px solid var(--line); }
.share-label { margin: 0; font-weight: 600; font-size: 14px; }
.share { display: flex; align-items: center; gap: 6px; }
.share-link { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); transition: all .2s var(--ease); }
.share-link:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.share-native { display: none; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px; }
.author-box { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 20px; padding: 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.author-box img { border-radius: 999px; width: 72px; height: 72px; }
.author-name { font: 500 21px/1.2 var(--serif); margin-bottom: 6px; }
.author-bio { color: var(--muted); font-size: 15px; margin-bottom: 10px; }
.page-links { font-weight: 600; }

.related { padding-block: clamp(48px, 7vw, 80px) 24px; }

/* Article stream / next */
.article--next { border-top: 1px solid var(--line); margin-top: clamp(40px, 6vw, 72px); animation: rise .7s var(--ease) both; }
.next-divider { display: flex; justify-content: center; margin-top: -13px; }
.next-divider span { background: var(--bg); padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line); font: 600 11px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.next-sentinel { padding-block: 40px 80px; }
.next-loader { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 14px; padding: 24px; }
.spinner { width: 18px; height: 18px; border-radius: 999px; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.next-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 16px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); transition: border-color .2s, box-shadow .2s; }
.next-card:hover { border-color: var(--ink); box-shadow: var(--shadow); }
.next-card .eyebrow { grid-column: 1; margin: 0; }
.next-card-title { grid-column: 1; font: 500 21px/1.25 var(--serif); }
.next-card svg { grid-column: 2; grid-row: 1 / 3; }
.is-streaming .next-card { display: none; }

.toc-fab {
	position: fixed; z-index: 90; left: 50%; bottom: calc(var(--appbar-h) + var(--safe-b) + 14px);
	transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
	display: none; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 14px; border-radius: 999px;
	background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg);
	transition: opacity .3s var(--ease), transform .3s var(--ease); max-width: calc(100vw - 40px);
}
.toc-fab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.toc-fab.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

/* ---------- Comments ---------- */
.comments { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); }
.comments .section-title { margin-bottom: 24px; }
.comment-list { list-style: none; display: grid; gap: 20px; margin-bottom: 32px; }
.comment-list .children { list-style: none; padding-left: 28px; margin-top: 20px; display: grid; gap: 20px; }
.comment-body { padding: 18px 20px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); font-size: 15px; }
.comment-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.comment-author { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; }
.comment-author img { border-radius: 999px; }
.comment-author .says { display: none; }
.comment-reply-title { font: 500 22px var(--serif); margin-bottom: 12px; }
.comment-form { display: grid; gap: 14px; }
.comment-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea,
.search-form input[type="search"] {
	width: 100%; padding: 13px 16px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface);
	outline: 0; transition: border-color .2s, box-shadow .2s;
}
.comment-form input:focus, .comment-form textarea:focus, .search-form input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 8%, transparent); }
.comment-form-cookies-consent { display: flex; gap: 8px; align-items: start; font-size: 13px; }
.comment-form-cookies-consent label { font-weight: 400; }

/* ---------- Archive / search ---------- */
.archive-head { padding-top: clamp(28px, 5vw, 56px); padding-bottom: 28px; }
.archive-title { font: 400 clamp(36px, 5.6vw, 68px)/1 var(--serif); letter-spacing: -.035em; font-variation-settings: "opsz" 144; }
.archive-desc { color: var(--ink-2); font-size: 18px; max-width: 62ch; margin-top: 16px; }
.archive-count { color: var(--muted); font-size: 14px; margin: 14px 0 0; }
.archive-author img { border-radius: 999px; margin-bottom: 18px; }
.search-inline { margin-top: 22px; max-width: 620px; }
.search-form { display: flex; align-items: center; gap: 8px; position: relative; }
.search-form > svg { position: absolute; left: 16px; color: var(--muted); pointer-events: none; }
.search-form input[type="search"] { padding-left: 44px; border-radius: 999px; height: 50px; }
.search-form .btn { height: 50px; }
.empty { padding: 48px 0; color: var(--muted); }
.empty h2 { font: 500 28px var(--serif); color: var(--ink); margin-bottom: 8px; }
.pager { margin-top: 48px; }
[data-load-more] ~ .pager, .has-js .more-wrap + .pager { display: none; }
.pager .nav-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.pager .page-numbers { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.pager .page-numbers.current { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.notfound { padding-top: 64px; text-align: left; }
.notfound-code { font: 300 clamp(90px, 18vw, 180px)/.9 var(--serif); color: var(--accent); letter-spacing: -.05em; margin-bottom: 16px; }
.page-head { padding-top: clamp(28px, 5vw, 56px); margin-bottom: 32px; }
.page-title { font: 400 clamp(36px, 5.4vw, 64px)/1.02 var(--serif); letter-spacing: -.03em; }
.page-article .entry-content { padding-bottom: 64px; }

/* ---------- Widgets ---------- */
.widget { margin-bottom: 32px; font-size: 15px; }
.widget-title { font: 600 11px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.widget ul { list-style: none; }
.widget li { padding-block: 8px; border-bottom: 1px solid var(--line); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: color-mix(in srgb, var(--bg) 72%, transparent); margin-top: clamp(48px, 8vw, 96px); padding-top: clamp(48px, 7vw, 80px); }
:root[data-theme="dark"] .site-footer { background: #0B0B0A; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 40px; padding-bottom: 48px; }
.site-footer .brand-word { color: #fff; }
.site-footer .brand-logo { filter: brightness(0) invert(1); }
.site-footer .brand-logo--dark { display: none !important; }
.footer-about p { margin: 18px 0 22px; max-width: 40ch; font-size: 15px; }
.footer-title { font: 600 11px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #fff; margin-bottom: 18px; }
.footer-col ul { list-style: none; display: grid; gap: 10px; font-size: 15px; }
.footer-col a:hover, .footer-about a:hover { color: #fff; }
.footer-cta p { font-size: 15px; }
.footer-cta .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .25); }
.socials { display: flex; gap: 6px; list-style: none; }
.socials a { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; border: 1px solid currentColor; opacity: .7; transition: opacity .2s, background .2s; }
.socials a:hover { opacity: 1; }
.site-footer .socials a { border-color: rgba(255, 255, 255, .2); }
.footer-base { display: flex; align-items: center; justify-content: space-between; padding-block: 22px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13px; }
.footer-base p { margin: 0; }
.to-top { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .2); color: #fff; }

/* ---------- Quick search ---------- */
.qs { position: fixed; inset: 0; z-index: 300; display: grid; justify-items: center; align-items: start; padding: min(12vh, 110px) 16px 16px; }
.qs-backdrop { position: absolute; inset: 0; background: rgba(12, 12, 10, .42); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .2s ease both; }
.qs-panel {
	position: relative; width: 100%; max-width: 680px; max-height: min(640px, 76vh); display: flex; flex-direction: column;
	background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--line);
	overflow: hidden; animation: drop .25s var(--ease) both;
}
@keyframes fade { from { opacity: 0; } }
@keyframes drop { from { opacity: 0; transform: translateY(-10px) scale(.985); } }
.qs-form { display: flex; align-items: center; gap: 12px; padding: 0 16px 0 20px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.qs-form > svg { color: var(--muted); flex-shrink: 0; }
.qs-form input { flex: 1; min-width: 0; height: 62px; border: 0; background: transparent; outline: 0; font-size: 18px; }
.qs-form input::-webkit-search-cancel-button { -webkit-appearance: none; }
.qs-esc { font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 9px; border-radius: 6px; border: 1px solid var(--line-strong); }
.qs-body { overflow-y: auto; overscroll-behavior: contain; padding: 12px; }
.qs-label { display: flex; align-items: center; gap: 6px; font: 600 11px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 8px; margin: 0; }
.qs-list { list-style: none; }
.qs-item { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 12px; transition: background .15s; }
.qs-item:hover, .qs-item.is-active { background: var(--surface-2); }
.qs-thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--surface-2); }
.qs-text { display: grid; min-width: 0; gap: 3px; }
.qs-title { font-weight: 500; font-size: 15px; line-height: 1.35; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qs-title mark { background: color-mix(in srgb, var(--accent) 18%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.qs-meta { font-size: 12px; color: var(--muted); }
.qs-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px 8px; }
.qs-chips button, .qs-cat { padding: 7px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; color: var(--ink-2); }
.qs-chips button:hover, .qs-cat:hover { background: var(--ink); color: var(--bg); }
.qs-cats { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px 10px; }
.qs-all { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 10px 4px; padding: 12px; border-radius: 12px; border: 1px dashed var(--line-strong); font-weight: 600; font-size: 14px; }
.qs-all:hover, .qs-all.is-active { border-style: solid; border-color: var(--ink); }
.qs-empty { padding: 28px 10px; text-align: center; color: var(--muted); }
.qs-skel { height: 72px; border-radius: 12px; margin-bottom: 6px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.1s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.qs-foot { display: flex; gap: 18px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); flex-shrink: 0; }
.qs-foot span { display: inline-flex; align-items: center; gap: 4px; }
body.is-locked { overflow: hidden; }

/* ---------- Sheets (mobile) ---------- */
.sheet { position: fixed; inset: 0; z-index: 250; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(12, 12, 10, .4); animation: fade .25s ease both; }
.sheet-panel {
	position: absolute; left: 0; right: 0; bottom: 0; max-height: 86vh; overflow-y: auto; overscroll-behavior: contain;
	background: var(--surface); border-radius: 26px 26px 0 0; padding: 8px 20px calc(24px + var(--safe-b));
	box-shadow: var(--shadow-lg); animation: up .38s var(--ease) both; touch-action: pan-y;
}
@keyframes up { from { transform: translateY(100%); } }
.sheet.is-closing .sheet-panel { transform: translateY(100%); transition: transform .25s var(--ease); }
.sheet.is-closing .sheet-backdrop { opacity: 0; transition: opacity .25s; }
.sheet-grip { width: 40px; height: 5px; border-radius: 99px; background: var(--line-strong); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.sheet-title { margin: 0; font: 500 24px var(--serif); }
.sheet-menu { list-style: none; }
.sheet-menu > li > a { display: flex; align-items: center; justify-content: space-between; padding: 15px 4px; font: 500 20px/1.2 var(--serif); border-bottom: 1px solid var(--line); }
.sheet-menu > li > a::after { content: "→"; font-family: var(--sans); color: var(--muted); font-size: 16px; }
.sheet-menu .sub-menu { list-style: none; padding: 6px 0 10px 14px; }
.sheet-menu .sub-menu a { display: block; padding: 8px 4px; color: var(--muted); }
.sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 20px; }
.explore-grid { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 6px; }
.explore-grid a { display: grid; gap: 4px; padding: 16px; border-radius: 16px; background: var(--surface-2); min-height: 84px; align-content: end; transition: background .2s; }
.explore-grid a:active { transform: scale(.98); }
.explore-grid span { font: 500 17px/1.2 var(--serif); }
.explore-grid small { color: var(--muted); font-size: 12px; }
.toc--sheet .toc-list { border-left: 0; }
.toc--sheet .toc-list a { padding: 12px 4px; border-left: 0; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--ink-2); }
.toc--sheet .toc-list .toc-l3 a { padding-left: 18px; font-size: 14px; }
.toc--sheet .toc-list a.is-active { color: var(--accent); }

/* ---------- App bar (mobile) ---------- */
.appbar { display: none; }

/* ---------- Toast ---------- */
.toast {
	position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); z-index: 400; transform: translate(-50%, 30px); opacity: 0;
	background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 500;
	box-shadow: var(--shadow-lg); pointer-events: none; transition: all .3s var(--ease); white-space: nowrap;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1240px) {
	.article-layout.has-toc.has-rail { grid-template-columns: 220px minmax(0, var(--narrow)); }
	.article-layout.has-toc.has-rail .article-rail { display: none; }
	.article-layout.has-toc.no-rail { grid-template-columns: 220px minmax(0, var(--narrow)); }
}
@media (max-width: 1100px) {
	.search-trigger { min-width: 0; }
	.search-trigger-text, .search-trigger .kbd { display: none; }
	.search-trigger { width: 42px; height: 42px; padding: 0; justify-content: center; margin: 0; border-color: transparent; background: transparent; color: var(--ink-2); }
}
@media (max-width: 1024px) {
	.nav-primary { display: none; }
	.show-md { display: inline-grid !important; }
	.article-layout.has-toc.has-rail, .article-layout.has-toc.no-rail, .article-layout.no-toc.has-rail { grid-template-columns: minmax(0, var(--narrow)); }
	.toc-aside, .article-rail { display: none; }
	.toc-inline { display: block; }
	.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.footer-about { grid-column: 1 / -1; }
	.intro { grid-template-columns: 1fr; }
}

/* ---- Phone: app mode ---- */
@media (max-width: 768px) {
	:root { --header-h: 58px; }
	body { font-size: 16px; padding-bottom: calc(var(--appbar-h) + var(--safe-b)); }
	.hide-sm { display: none !important; }
	.show-sm-inline { display: inline !important; }
	.show-md { display: none !important; }

	.site-header { padding-top: env(safe-area-inset-top, 0px); height: calc(var(--header-h) + env(safe-area-inset-top, 0px)); }
	.header-inner { gap: 8px; }
	.brand-logo { height: 28px; }
	.brand-word { font-size: 21px; }
	.header-actions .search-trigger { display: none; }

	/* App bar */
	.appbar {
		position: fixed; left: 10px; right: 10px; bottom: calc(10px + var(--safe-b)); z-index: 110;
		display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; height: var(--appbar-h);
		background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
		border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
		transition: transform .35s var(--ease);
	}
	.appbar > a, .appbar > button {
		position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; height: 100%;
		color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
		-webkit-tap-highlight-color: transparent;
	}
	.appbar > .is-active { color: var(--ink); }
	.appbar > .is-active::before { content: ""; position: absolute; top: 6px; width: 4px; height: 4px; border-radius: 99px; background: var(--accent); }
	.appbar > *:active { transform: scale(.94); }
	.appbar .appbar-search { width: 50px; height: 50px; margin: auto; border-radius: 18px; background: var(--ink); color: var(--bg); }
	.appbar .badge { top: 6px; right: calc(50% - 20px); }
	body.is-reading-down .appbar { transform: translateY(calc(100% + 20px)); }
	.toc-fab { display: inline-flex; }
	body.is-reading-down .toc-fab { bottom: calc(14px + var(--safe-b)); }
	.toast { bottom: calc(var(--appbar-h) + var(--safe-b) + 24px); }

	/* Layout */
	.section { padding-block: 40px; }
	.section-head { margin-bottom: 18px; padding-bottom: 12px; }
	.intro { padding-top: 22px; gap: 10px; padding-bottom: 14px; }
	.intro-title { font-size: clamp(34px, 10vw, 44px); }
	.intro-text { font-size: 15px; }
	.chips-rail .chips { padding-bottom: 14px; }
	.chip--pill { padding: 9px 14px; font-size: 13.5px; }

	.lead-grid { grid-template-columns: 1fr; gap: 8px; }
	.card--hero .card-media { border-radius: 18px; margin-inline: calc(-1 * var(--gutter) + 8px); }
	.card--hero .card-title { font-size: 30px; }
	.card--hero .card-excerpt { font-size: 15.5px; }

	.grid, .grid--3 { grid-template-columns: 1fr; gap: 6px; }
	.grid > .card--grid { grid-template-columns: minmax(0, 1fr) 112px; gap: 14px; padding-block: 16px; border-bottom: 1px solid var(--line); }
	.grid > .card--grid .card-media { order: 2; aspect-ratio: 1; border-radius: 12px; }
	.grid > .card--grid .card-title { font-size: 18px; line-height: 1.28; }
	.grid > .card--grid .card-excerpt { display: none; }
	.grid > .card--grid .card-foot { margin-top: 8px; }
	.grid > .card--grid .meta-author, .grid > .card--grid .meta-author + .dot { display: none; }
	.grid > .card--hero { grid-template-columns: 1fr; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
	.related .grid > .card--grid:first-child, .latest .grid > .card--grid:first-child { padding-top: 0; }

	.card--list { grid-template-columns: minmax(0, 1fr) 96px; gap: 14px; padding-block: 16px; }
	.card--list .card-title { font-size: 17.5px; }
	.card--list .card-excerpt { display: none; }

	.rail {
		display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 84%;
		grid-template-rows: repeat(2, auto); gap: 0 16px;
		overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter);
		scrollbar-width: none;
	}
	.rail::-webkit-scrollbar { display: none; }
	.rail .card { scroll-snap-align: start; }
	.card--rank { grid-template-columns: 30px minmax(0, 1fr) 68px; }
	.card-rank { font-size: 24px; }

	.cat-grid { grid-template-columns: 1fr; gap: 0; }
	.cat-main { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
	.cat-main .card { grid-template-columns: 1fr; }
	.cat-main .card-media { order: 0; aspect-ratio: 16 / 10; }
	.cat-list .card--list:first-child { padding-top: 16px; }

	.newsletter { border-radius: 20px; }
	.newsletter-inner { grid-template-columns: 1fr; padding: 28px 22px; }
	.newsletter-form { flex-direction: column; border-radius: 18px; padding: 8px; }
	.newsletter-form input { height: 46px; }

	/* Article */
	.crumbs ol { margin-bottom: 16px; font-size: 12.5px; flex-wrap: nowrap; overflow: hidden; }
	.crumbs li:last-child { display: none; }
	.article-title { font-size: clamp(30px, 8.6vw, 40px); line-height: 1.08; }
	.article-dek { font-size: 17px; margin-top: 14px; }
	.article-byline { gap: 12px; margin-top: 20px; padding-block: 14px; }
	.byline-actions { margin-left: 0; width: 100%; }
	.byline-actions > * { flex: 1; justify-content: center; height: 42px; }
	.article-hero { padding-inline: 0; margin-top: 20px; }
	.article-hero-img { border-radius: 0; max-height: 62vh; }
	.article-hero figcaption { padding-inline: var(--gutter); }
	.article-layout { padding-top: 24px; }
	.prose { font-size: 17.5px; line-height: 1.72; }
	.prose h2 { font-size: 26px; margin-top: 1.8em; }
	.prose h3 { font-size: 19.5px; }
	.prose img, .prose figure.wp-block-image { margin-inline: calc(-1 * var(--gutter)); max-width: calc(100% + var(--gutter) * 2); width: calc(100% + var(--gutter) * 2); border-radius: 0; }
	.prose .alignwide { margin-inline: calc(-1 * var(--gutter)); }
	.share-native { display: inline-flex; }
	.share-row { flex-direction: column; align-items: stretch; }
	.share { flex-wrap: wrap; }
	.share-native { flex: 1 0 100%; justify-content: center; height: 46px; }
	.author-box { grid-template-columns: 56px minmax(0, 1fr); padding: 18px; gap: 14px; }
	.author-box img { width: 56px; height: 56px; }

	/* Search overlay → full-screen sheet */
	.qs { padding: 0; align-items: stretch; }
	.qs-panel { max-width: none; max-height: none; height: 100%; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top, 0px); }
	.qs-form { padding: 0 12px 0 16px; }
	.qs-form input { height: 58px; font-size: 17px; }
	.qs-esc { border: 0; font-size: 15px; color: var(--accent); }
	.qs-body { padding: 8px 8px calc(16px + var(--safe-b)); }

	.footer-grid { grid-template-columns: 1fr 1fr; gap: 32px 20px; }
	.footer-cta { grid-column: 1 / -1; }
	.site-footer { margin-top: 48px; }

	.archive-title { font-size: clamp(34px, 10vw, 46px); }
	.archive-head { padding-bottom: 12px; }
	.search-form .btn { display: none; }
}

@media (max-width: 380px) {
	.grid > .card--grid { grid-template-columns: minmax(0, 1fr) 92px; }
	.card--list { grid-template-columns: minmax(0, 1fr) 84px; }
}

/* Installed app (standalone) polish */
@media (display-mode: standalone) {
	.footer-cta { display: none; }
}

@media (hover: none) {
	.card:hover .card-img { transform: none; }
}

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

@media print {
	.site-header, .appbar, .site-footer, .toc-aside, .toc-inline, .article-rail, .share-row, .next-sentinel, .related, .comments, .progress, .byline-actions { display: none !important; }
	body { background: #fff; color: #000; padding: 0; }
	.article-layout { display: block; }
}

/* ==========================================================================
   v1.1 — brand logo, preloader, hero search, topics, newsletter, sidebar,
   forms, contact & contribute, footer fixes
   ========================================================================== */

/* Sticky-safe horizontal clipping (overflow:hidden on html/body breaks sticky). */
html, body { overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip !important; overflow-y: visible !important; } }

/* ---------- Brand logo ---------- */
.brand { color: var(--ink); line-height: 0; }
.spv-logo { display: block; height: 42px; width: auto; overflow: visible; }
.spv-logo .l-door { transform-box: fill-box; transform-origin: 0% 50%; transition: transform .6s cubic-bezier(.3, 1.4, .5, 1); }
.brand:hover .spv-logo .l-door { transform: scaleX(.78); }
.site-header .header-inner > .brand { display: flex; align-items: center; }
.site-footer .brand { color: #fff; }
.site-footer .spv-logo { height: 64px; }
.sheet-head .spv-logo { height: 34px; }
.brand-logo { height: 44px; }
.site-footer .brand-logo { height: 60px; }

/* ---------- Header search wider ---------- */
@media (min-width: 1101px) {
	.site-header .wrap { max-width: 1400px; }
	.search-trigger { width: clamp(220px, 26vw, 400px); min-width: 0; height: 46px; padding-left: 16px; margin-right: 4px; flex-shrink: 0; }
}
@media (min-width: 1101px) and (max-width: 1199px) {
	.search-trigger { width: 220px; }
	.nav-primary .menu > li > a { padding: 9px 9px; font-size: 14px; }
	.header-inner { gap: 18px; }
}
.nav-primary { min-width: 0; }
.nav-primary .menu { flex-wrap: nowrap; }
.nav-primary .menu > li > a { white-space: nowrap; }

/* ---------- Footer (always dark; readable in both themes) ---------- */
.site-footer, :root[data-theme="dark"] .site-footer { background: #0E0E0C; color: rgba(255, 255, 255, .66); }
:root[data-theme="dark"] .site-footer { border-top: 1px solid #23221E; }
.site-footer a { color: rgba(255, 255, 255, .74); transition: color .2s; }
.site-footer a:hover { color: #fff; }
.site-footer .footer-title { color: #fff; }
.site-footer .footer-about p { color: rgba(255, 255, 255, .62); }
.site-footer .socials a { color: rgba(255, 255, 255, .8); border-color: rgba(255, 255, 255, .18); opacity: 1; }
.site-footer .socials a:hover { background: #fff; color: #0E0E0C; border-color: #fff; }
.footer-base { color: rgba(255, 255, 255, .5); }
.footer-made { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.footer-cta .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .25); }

/* ---------- Back to top (small circle) ---------- */
.spv-top {
	position: fixed; right: 22px; bottom: 22px; z-index: 95; width: 40px; height: 40px; border-radius: 50%;
	display: grid; place-items: center; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong);
	box-shadow: var(--shadow); opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none;
	transition: opacity .3s var(--ease), transform .3s var(--ease), background .2s, color .2s;
}
.spv-top.is-on { opacity: 1; transform: none; pointer-events: auto; }
.spv-top:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
/* Hide scroll-to-top buttons injected by old plugins (ThemeREX etc.). */
.trx_addons_scroll_to_top, a.trx_addons_scroll_to_top, #trx_addons_scroll_to_top, .scroll_to_top, #scroll_to_top, #toTop, .elementor-scroll-to-top { display: none !important; }

/* ---------- Homepage hero search ---------- */
.intro { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: end; padding-bottom: 36px; }
.intro-text { margin-top: 18px; }
.hero-search {
	display: flex; align-items: center; gap: 14px; width: 100%; height: 64px; padding: 0 12px 0 22px;
	border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--muted);
	font-size: 17px; text-align: left; box-shadow: var(--shadow-sm); transition: box-shadow .25s var(--ease), border-color .2s, transform .25s var(--ease);
}
.hero-search:hover { border-color: var(--ink); box-shadow: var(--shadow); transform: translateY(-1px); }
.hero-search svg { color: var(--ink); flex-shrink: 0; }
.hero-search-ph { flex: 1; }
.hero-search .kbd { height: 28px; min-width: 44px; font-size: 12px; }
.popular { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 16px 4px 0; font-size: 14px; color: var(--muted); }
.popular span { font-weight: 600; color: var(--ink-2); }
.popular a { color: var(--ink-2); border-bottom: 1px solid var(--line-strong); padding-bottom: 1px; transition: color .2s, border-color .2s; }
.popular a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Explore by topic ---------- */
.section-sub { margin: 0; color: var(--muted); font-size: 15px; }
.topic-grid { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 200px; gap: 14px; }
.topic--lg { grid-column: span 2; grid-row: span 2; }
.topic a {
	position: relative; display: flex; align-items: flex-end; height: 100%; padding: 20px; overflow: hidden;
	border-radius: var(--r-lg); background: #2A2824; color: #fff; isolation: isolate;
}
.topic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 1s var(--ease); }
.topic a::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10, 10, 8, 0) 30%, rgba(10, 10, 8, .82) 100%); transition: background .3s; }
.topic a:hover img { transform: scale(1.06); }
.topic-body { display: grid; gap: 4px; max-width: 90%; }
.topic-count { font: 600 11px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .78); }
.topic-name { font: 500 22px/1.15 var(--serif); letter-spacing: -.01em; color: #fff; }
.topic--lg .topic-name { font-size: clamp(28px, 3vw, 40px); }
.topic-desc { color: rgba(255, 255, 255, .8); font-size: 14.5px; margin-top: 4px; }
.topic-go {
	position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
	background: rgba(255, 255, 255, .16); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff;
	transform: rotate(-45deg); transition: transform .35s var(--ease), background .2s;
}
.topic a:hover .topic-go { transform: rotate(0); background: var(--accent); }

/* ---------- Newsletter (new) ---------- */
.nl {
	position: relative; overflow: hidden; isolation: isolate; margin-block: clamp(32px, 6vw, 72px);
	display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 32px; align-items: center;
	padding: clamp(28px, 5vw, 64px); border-radius: 28px; background: #171613; color: #F4F1EA;
}
:root[data-theme="dark"] .nl { background: #1D1C18; border: 1px solid #2E2C27; }
.nl::before {
	content: ""; position: absolute; z-index: -1; right: -10%; top: -40%; width: 70%; height: 180%;
	background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%); opacity: .55;
}
.nl::after { /* door-frame motif */
	content: ""; position: absolute; z-index: -1; right: 6%; top: 50%; width: 220px; height: 280px; transform: translateY(-50%);
	border: 1.5px solid rgba(255, 255, 255, .07); border-radius: 4px;
}
.nl-eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; padding: 7px 14px; border-radius: 999px; background: rgba(255, 255, 255, .07); font: 600 12px/1 var(--sans); letter-spacing: .06em; color: rgba(255, 255, 255, .85); }
.nl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 0%, transparent); } }
.nl-title { font: 400 clamp(30px, 3.8vw, 50px)/1.04 var(--serif); letter-spacing: -.025em; color: #fff; margin: 0 0 14px; max-width: 16ch; }
.nl-text { color: rgba(255, 255, 255, .68); max-width: 46ch; margin: 0 0 26px; font-size: 16px; }
.nl-form { display: flex; gap: 6px; max-width: 480px; padding: 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); transition: border-color .2s, background .2s; }
.nl-form:focus-within { border-color: rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .11); }
.nl-form input { flex: 1; min-width: 0; height: 48px; padding: 0 18px; border: 0; background: transparent; color: #fff; outline: 0; font-size: 15.5px; }
.nl-form input::placeholder { color: rgba(255, 255, 255, .5); }
.nl-btn { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 999px; background: #fff; color: #111; font-weight: 600; font-size: 15px; transition: background .2s, color .2s, transform .2s; }
.nl-btn:hover { background: var(--accent); color: #fff; }
.nl-btn.is-loading { opacity: .6; pointer-events: none; }
.nl-fine { margin: 14px 0 0 6px; font-size: 13px; color: rgba(255, 255, 255, .5); }
.nl-fine.is-ok { color: #9BE3B3; }
.nl-fine.is-err { color: #FFB4A1; }
.nl-preview { position: relative; display: flex; justify-content: center; perspective: 1200px; }
.nl-mail {
	width: min(100%, 360px); padding: 22px; border-radius: 18px; background: #FBFAF7; color: #16150F;
	box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6); transform: rotateY(-14deg) rotateX(6deg) rotate(2deg);
	transition: transform .6s var(--ease);
}
.nl:hover .nl-mail { transform: rotateY(-4deg) rotateX(2deg) rotate(0); }
.nl-mail-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid #E6E1D7; }
.nl-mail-logo .spv-logo { height: 26px; color: #16150F; }
.nl-mail-date { font-size: 12px; color: #7B766B; }
.nl-mail-sub { font: 500 17px/1.3 var(--serif); margin: 14px 0 10px; }
.nl-mail-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #EFEBE3; font-size: 13.5px; line-height: 1.35; font-weight: 500; }
.nl-mail-item img, .nl-mail-ph { width: 46px; height: 46px; border-radius: 9px; object-fit: cover; flex-shrink: 0; background: #ECE7DE; }
.nl-mail-k { display: block; font-size: 11px; font-weight: 600; color: var(--accent); letter-spacing: .08em; margin-bottom: 2px; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Article: left sidebar (sticky TOC + more in category) ---------- */
:root { --hdr: 74px; }
.article-layout.has-toc.has-rail { grid-template-columns: 250px minmax(0, var(--narrow)) 260px; }
.article-layout.has-toc.no-rail { grid-template-columns: 250px minmax(0, var(--narrow)) 1fr; }
.article-layout.has-toc.no-rail::after { content: none; }
.side-left { position: relative; }
.side-sticky { position: sticky; top: calc(var(--hdr) + 20px); display: flex; flex-direction: column; gap: 22px; max-height: calc(100vh - var(--hdr) - 36px); }
.toc { position: relative; }
.toc-title { justify-content: flex-start; }
.toc-pct { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--accent); letter-spacing: .04em; }
.toc { display: flex; flex-direction: column; min-height: 0; flex: 0 1 auto; }
.toc-scroll { min-height: 160px; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; -webkit-mask-image: linear-gradient(#000 88%, transparent); mask-image: linear-gradient(#000 88%, transparent); padding-bottom: 14px; }
.side-more { flex: 0 0 auto; padding-top: 18px; border-top: 1px solid var(--line); }
.side-more ul { list-style: none; display: grid; gap: 4px; }
.side-more li a { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px; margin-inline: -8px; border-radius: 12px; transition: background .2s; }
.side-more li a:hover { background: var(--surface); }
.side-more img, .side-ph { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--surface-2); }
.side-t { font-size: 13.5px; line-height: 1.35; font-weight: 500; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.side-more li a:hover .side-t { color: var(--ink); }
.side-all { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--accent); }

/* ---------- Buttons ---------- */
.btn--lg { min-height: 54px; padding: 0 28px; font-size: 15px; }

/* ---------- Designed pages (Contact / Contribute) ---------- */
.px-hero { padding-top: clamp(28px, 5vw, 56px); padding-bottom: clamp(28px, 4vw, 48px); }
.px-hero-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px 64px; align-items: end; }
.px-title { font: 400 clamp(40px, 6.4vw, 84px)/.98 var(--serif); letter-spacing: -.035em; font-variation-settings: "opsz" 144; text-wrap: balance; }
.px-lead { font-size: clamp(17px, 1.5vw, 20px); color: var(--ink-2); margin: 0; max-width: 48ch; }
.px-hero--contrib .px-lead { margin-top: 22px; }
.px-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.px-h2 { font: 500 clamp(24px, 2.4vw, 32px)/1.15 var(--serif); letter-spacing: -.02em; margin-bottom: 8px; }
.px-h2--lg { font-size: clamp(32px, 3.6vw, 48px); line-height: 1.04; }
.px-muted { color: var(--muted); font-size: 15px; }
.px-split { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(24px, 4vw, 56px); align-items: start; padding-bottom: 56px; }
.px-side { display: grid; gap: 22px; position: sticky; top: calc(var(--hdr) + 20px); }
.reach { list-style: none; display: grid; gap: 10px; }
.reach-card { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, transform .2s var(--ease), box-shadow .2s; }
.reach-card:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow); }
.reach-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); flex-shrink: 0; }
.reach-k { display: block; font: 600 11px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.reach-v { display: block; font-weight: 600; font-size: 16px; color: var(--ink); word-break: break-word; }
.px-follow .socials a { color: var(--ink-2); border-color: var(--line-strong); }
.px-follow .socials a:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); opacity: 1; }
.px-cta-card { display: grid; gap: 10px; padding: 24px; border-radius: 20px; background: #171613; color: #fff; position: relative; overflow: hidden; }
:root[data-theme="dark"] .px-cta-card { background: #1D1C18; border: 1px solid #2E2C27; }
.px-cta-card::after { content: ""; position: absolute; right: -30px; bottom: -40px; width: 130px; height: 160px; border: 1.5px solid rgba(255, 255, 255, .1); transform: perspective(300px) rotateY(-30deg); }
.px-cta-card .eyebrow { margin: 0; color: color-mix(in srgb, var(--accent) 60%, #fff); }
.px-cta-title { font: 500 21px/1.25 var(--serif); }
.px-cta-card .section-link { color: #fff; }
.px-form-card { padding: clamp(22px, 3.4vw, 40px); border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.px-faq { padding-bottom: 24px; }
.faq { display: grid; gap: 10px; margin-top: 16px; max-width: 860px; }
.faq details { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 22px; font-weight: 600; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; font-size: 22px; line-height: 1; color: var(--muted); transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 22px 18px; margin: 0; color: var(--ink-2); }

.stats { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
.stats li { background: var(--surface); padding: clamp(18px, 2.4vw, 28px); display: grid; gap: 6px; }
.stat-n { font: 400 clamp(34px, 4vw, 52px)/1 var(--serif); letter-spacing: -.03em; color: var(--ink); }
.stat-l { font-size: 14px; color: var(--muted); }
.px-section { padding-block: clamp(40px, 6vw, 72px); }
.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.feature { padding: 26px 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); transition: transform .25s var(--ease), box-shadow .25s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature-ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); margin-bottom: 18px; }
.feature h3, .steps h3, .guide h3 { font: 500 21px/1.2 var(--serif); letter-spacing: -.01em; margin-bottom: 8px; }
.feature p, .steps p, .guide p { color: var(--muted); font-size: 15px; margin: 0; }
.px-note { margin-top: 18px; font-size: 14px; color: var(--muted); }
.px-band { background: var(--surface); border-block: 1px solid var(--line); padding-block: clamp(40px, 6vw, 72px); }
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; counter-reset: s; }
.steps li { position: relative; padding-top: 22px; border-top: 2px solid var(--ink); }
.step-n { display: block; font: 400 15px/1 var(--serif); color: var(--accent); margin-bottom: 14px; }
.guide-grid { display: grid; grid-template-columns: 1fr 1fr .9fr; gap: 14px; }
.guide { padding: 28px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); }
.guide--note { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); display: grid; gap: 12px; align-content: start; }
.ticks { list-style: none; display: grid; gap: 10px; margin-top: 12px; }
.ticks li { position: relative; padding-left: 28px; font-size: 15px; color: var(--ink-2); }
.ticks li::before { content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 14%, transparent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B5532E' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 11px no-repeat; }
.ticks--sm li { font-size: 14px; }
.px-form-wrap { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
.px-form-intro { position: sticky; top: calc(var(--hdr) + 20px); }
.px-form-intro .px-muted { margin-top: 12px; }

/* ---------- Forms ---------- */
.spv-form { margin-top: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.field--wide { grid-column: 1 / -1; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.req { color: var(--accent); }
.spv-form input[type="text"], .spv-form input[type="email"], .spv-form input[type="tel"], .spv-form input[type="url"], .spv-form textarea {
	width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--bg);
	color: var(--ink); font-size: 16px; outline: 0; transition: border-color .2s, box-shadow .2s, background .2s;
}
.spv-form textarea { resize: vertical; min-height: 140px; line-height: 1.55; }
.spv-form input:focus, .spv-form textarea:focus { border-color: var(--ink); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 8%, transparent); }
.field.has-error input, .field.has-error textarea { border-color: #C0392B; box-shadow: 0 0 0 4px rgba(192, 57, 43, .1); }
.field-error { display: none; margin: 6px 0 0; font-size: 13px; color: #C0392B; }
:root[data-theme="dark"] .field-error { color: #FF9C8A; }
.field.has-error .field-error { display: block; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 14px; font-weight: 500; color: var(--ink-2); background: var(--bg); transition: all .2s var(--ease); }
.choice input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; position: relative; }
.check input { position: absolute; opacity: 0; width: 22px; height: 22px; }
.check-box { flex-shrink: 0; width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-strong); background: var(--bg); display: grid; place-items: center; transition: all .2s; margin-top: 1px; }
.check input:checked + .check-box { background: var(--ink); border-color: var(--ink); }
.check input:checked + .check-box::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--bg); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.check input:focus-visible + .check-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.field.has-error .check-box { border-color: #C0392B; }
.captcha { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.captcha-img { width: 220px; height: 72px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-strong); background: #F3EFE8; flex-shrink: 0; position: relative; }
.captcha-img img { width: 100%; height: 100%; display: block; }
.captcha-img.is-loading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent); animation: shimmer 1s infinite; background-size: 200% 100%; }
.captcha-refresh { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); color: var(--ink-2); transition: transform .4s var(--ease), background .2s; }
.captcha-refresh:hover { background: var(--surface-2); transform: rotate(180deg); }
.spv-form .captcha-input { flex: 1; min-width: 150px; height: 56px; font: 600 20px/1 var(--sans); letter-spacing: .3em; text-transform: uppercase; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 20px; margin-top: 26px; }
.form-note { margin: 0; font-size: 13px; color: var(--muted); }
.form-status { padding: 16px 18px; border-radius: 14px; margin-bottom: 18px; font-weight: 500; font-size: 15px; background: color-mix(in srgb, #C0392B 10%, var(--surface)); color: var(--ink); border: 1px solid color-mix(in srgb, #C0392B 30%, transparent); }
.form-status.is-ok { background: color-mix(in srgb, #2E8B57 12%, var(--surface)); border-color: color-mix(in srgb, #2E8B57 35%, transparent); }
.spv-form.is-done .form-grid, .spv-form.is-done .form-actions { display: none; }
.spv-form.is-done .form-status { padding: 28px; font-size: 17px; }
[data-submit].is-loading { opacity: .6; pointer-events: none; }



/* ---------- Responsive v1.1 ---------- */
@media (max-width: 1240px) {
	.article-layout.has-toc.has-rail, .article-layout.has-toc.no-rail { grid-template-columns: 230px minmax(0, var(--narrow)); }
	.article-layout.has-toc.has-rail .article-rail { display: none; }
}
@media (max-width: 1100px) {
	.feature-grid { grid-template-columns: 1fr 1fr; }
	.steps { grid-template-columns: 1fr 1fr; }
	.guide-grid { grid-template-columns: 1fr 1fr; }
	.guide--note { grid-column: 1 / -1; }
}
@media (max-width: 1024px) {
	:root { --hdr: 68px; }
	.side-left { display: none; }
	.article-layout.has-toc.has-rail, .article-layout.has-toc.no-rail { grid-template-columns: minmax(0, var(--narrow)); }
	.spv-logo { height: 38px; }
	.topic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.topic--lg { grid-column: span 3; grid-row: span 1; }
	.px-split, .px-form-wrap { grid-template-columns: 1fr; }
	.px-side, .px-form-intro { position: static; }
	.nl { grid-template-columns: 1fr; }
	.nl-preview { display: none; }
}
@media (max-width: 768px) {
	:root { --hdr: 58px; }
	.spv-logo { height: 32px; }
	.site-header .header-inner > .brand { height: auto; }
	.site-footer .spv-logo { height: 52px; }
	.spv-top { display: none; }
	.intro { grid-template-columns: 1fr; gap: 18px; padding-bottom: 18px; }
	.hero-search { height: 54px; font-size: 15px; padding-left: 18px; }
	.hero-search .kbd { display: none; }
	.popular { font-size: 13px; gap: 6px 12px; margin-top: 12px; }
	.topic-grid { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 62%; grid-auto-rows: 240px; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scrollbar-width: none; gap: 10px; }
	.topic-grid::-webkit-scrollbar { display: none; }
	.topic, .topic--lg { grid-column: auto; grid-row: auto; scroll-snap-align: start; }
	.topic--lg .topic-name { font-size: 24px; }
	.topic-desc { display: none; }
	.nl { padding: 28px 22px; border-radius: 22px; }
	.nl-title { font-size: 32px; }
	.nl-form { flex-direction: column; border-radius: 20px; padding: 8px; }
	.nl-form input { height: 48px; }
	.nl-btn { justify-content: center; }
	.px-hero-grid { grid-template-columns: 1fr; }
	.px-title { font-size: clamp(38px, 11vw, 52px); }
	.form-grid { grid-template-columns: 1fr; }
	.px-form-card { padding: 20px 16px; border-radius: 20px; margin-inline: calc(-1 * var(--gutter) + 8px); }
	.feature-grid, .steps, .guide-grid { grid-template-columns: 1fr; }
	.steps { gap: 20px; }
	.captcha-img { width: 180px; height: 59px; }
	.spv-form .captcha-input { min-width: 0; flex-basis: 100%; }
	.form-actions .btn { width: 100%; }
	.stats { grid-template-columns: 1fr 1fr; }
}

/* ---------- v1.2 homepage intro: centred ---------- */
.intro { display: block; text-align: center; padding-top: clamp(40px, 7vw, 88px); padding-bottom: clamp(28px, 4vw, 48px); max-width: 980px; }
.intro-eyebrow { margin-bottom: 18px; }
.intro-title { font-size: clamp(40px, 7vw, 92px); line-height: .98; text-wrap: balance; margin-inline: auto; }
.intro-text { margin: 22px auto 0; max-width: 56ch; font-size: clamp(16px, 1.5vw, 19px); }
@media (max-width: 768px) {
	.intro { padding-top: 28px; padding-bottom: 20px; }
	.intro-title { font-size: clamp(36px, 10.5vw, 46px); }
	.intro-eyebrow { font-size: 10px; letter-spacing: .12em; }
}

.nav-primary li.is-open > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.sheet-menu .menu-more > a::after { content: none; }
.sheet-menu .menu-more > a { pointer-events: none; color: var(--muted); font-size: 13px; font-family: var(--sans); letter-spacing: .12em; text-transform: uppercase; border-bottom: 0; padding-bottom: 4px; }

/* ---------- v1.3 SMART.POV Menu + mega menu ---------- */
.nav-primary .menu > li.spv-nav-mega { position: static; }
.mega-toggle {
	display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px;
	font-size: 14.5px; font-weight: 500; color: var(--ink-2); transition: background .2s, color .2s;
}
.mega-toggle:hover, .spv-nav-mega.is-open .mega-toggle { background: var(--surface-2); color: var(--ink); }
.mega-caret { width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: .6; transition: transform .25s var(--ease); }
.spv-nav-mega.is-open .mega-caret { transform: translateY(1px) rotate(225deg); }
.mega {
	position: absolute; left: 0; right: 0; top: 100%; z-index: 99;
	background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
	box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .35);
	animation: megaIn .22s var(--ease) both;
}
@keyframes megaIn { from { opacity: 0; transform: translateY(-6px); } }
.mega-inner { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; padding-block: 32px 36px; max-width: 1400px; }
.mega-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 28px 32px; }
.mega-title { font: 600 11px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.mega-group ul { list-style: none; display: grid; gap: 2px; }
.mega-group a { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 10px; margin-inline: -10px; border-radius: 10px; font: 500 17px/1.25 var(--serif); color: var(--ink); transition: background .15s, color .15s; }
.mega-group a:hover, .mega-group a:focus-visible { background: var(--surface-2); color: var(--accent); }
.mega-group a[aria-current] { color: var(--accent); }
.mega-group small { font: 500 12px var(--sans); color: var(--muted); }
.mega-feature { display: grid; grid-template-rows: 170px auto; border-radius: 16px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); transition: transform .25s var(--ease), box-shadow .25s; }
.mega-feature:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.mega-feature img, .mega-feature-ph { width: 100%; height: 170px; object-fit: cover; display: block; background: var(--line); }
.mega-feature-body { padding: 16px 18px 18px; display: grid; gap: 6px; }
.mega-feature .mega-title { margin: 0; }
.mega-feature-t { font: 500 18px/1.3 var(--serif); color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mega-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(12, 12, 10, .18); animation: fade .2s both; }
@media (max-width: 1199px) { .mega-inner { grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; } }

/* Mobile sheet: grouped chips from the mega menu */
.sheet-group { padding: 16px 0 6px; }
.sheet-group-title { margin: 0 0 10px 4px; font: 600 11px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.sheet-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.sheet-chips a { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 999px; background: var(--surface-2); font-size: 15px; font-weight: 500; color: var(--ink-2); }
.sheet-chips a:active { background: var(--ink); color: var(--bg); }
