/* Self-hosted Inter Variable — Latin subsets, weight axis 100–900 */

/* inter-latin-ext-wght-normal */
@font-face {
	font-family: 'Inter Variable';
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url('/assets/fonts/inter/files/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* inter-latin-wght-normal */
@font-face {
	font-family: 'Inter Variable';
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url('/assets/fonts/inter/files/inter-latin-wght-normal.woff2') format('woff2-variations');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* inter-latin-ext-wght-italic */
@font-face {
	font-family: 'Inter Variable';
	font-style: italic;
	font-display: swap;
	font-weight: 100 900;
	src: url('/assets/fonts/inter/files/inter-latin-ext-wght-italic.woff2') format('woff2-variations');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* inter-latin-wght-italic */
@font-face {
	font-family: 'Inter Variable';
	font-style: italic;
	font-display: swap;
	font-weight: 100 900;
	src: url('/assets/fonts/inter/files/inter-latin-wght-italic.woff2') format('woff2-variations');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Custom properties */
:root {
	--font-family-heading: 'Inter Variable', var(--pico-font-family-sans-serif);
	--content-max-width: 90%;
	--navbar-bg: rgb(255 255 255 / 85%);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--navbar-bg: rgb(19 23 31 / 85%);
	}
}

[data-theme="dark"] {
	--navbar-bg: rgb(19 23 31 / 85%);
}

/* Anchor scroll offset for sticky header */
html {
	scroll-padding-top: 4rem;
}

/* Headings and UI elements use the self-hosted variable font */
h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--font-family-heading);
}

/* SVG icons/logos need explicit sizing — the global img rules would shrink them */
img[src$=".svg"] {
	width: 100%;
	height: auto;
	max-width: none;
}

video,
iframe {
	width: 100%;
	height: auto;
}

iframe {
	aspect-ratio: 16/9;
}

a[href]:not(:has(img), .heading-anchor):is(:hover, :focus-visible) {
	background-color: var(--pico-primary-focus);
	border-radius: var(--pico-border-radius);
	box-decoration-break: clone;
}

.visually-hidden:not(:focus, :active) {
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

#skip-link {
	text-decoration: none;
	background: var(--pico-background-color);
	color: var(--pico-color);
	padding: 0.5rem 1rem;
	border: 1px solid var(--pico-color);
	border-radius: var(--pico-border-radius);
}

#skip-link.visually-hidden:focus {
	position: absolute;
	top: 1rem;
	left: 1rem;
	z-index: 999;
}

/* ===== Header ===== */

body > header {
	position: sticky;
	top: 0;
	z-index: 100;
	background-color: var(--navbar-bg);
	backdrop-filter: blur(8px);
	border-bottom: 1px dashed var(--pico-muted-border-color);
	padding: 0;
}

.header-inner {
	display: flex;
	gap: 1em;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	padding: 1em 1rem;
	max-width: var(--content-max-width);
	margin-inline: auto;
	font-size: clamp(1rem, 1.25vw, 1.5rem);
}

.home-link {
	font-family: var(--font-family-heading);
	font-size: 1em;
	font-weight: 700;
}

.home-link:link:not(:hover) {
	text-decoration: none;
}

.home-link .home-link__logo {
	display: block;
	width: auto;
	height: 1.5em;
	max-width: none;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .home-link__logo {
		filter: invert(1);
	}
}

[data-theme="dark"] .home-link__logo {
	filter: invert(1);
}

.nav {
	display: flex;
	gap: 0.5em 1em;
	padding: 0;
	margin: 0;
	list-style: none;
}

.nav-item {
	display: inline-block;
}

.nav-item a[href]:not(:hover) {
	text-decoration: none;
}

.nav a[href][aria-current="page"] {
	text-decoration: underline;
}

.menu-link {
	font-family: var(--font-family-heading);
	font-weight: 700;
}

.menu-link:link:not(:hover) {
	text-decoration: none;
}

/* ===== Heading anchors ===== */

.heading-anchor {
	margin-inline-start: 0.4em;
	font-size: 0.75em;
	font-weight: 400;
	color: var(--pico-muted-color);
	text-decoration: none;
	opacity: 0;
	transition: opacity 0.15s;
}

:is(h1, h2, h3, h4, h5, h6):hover .heading-anchor,
.heading-anchor:focus {
	opacity: 1;
}

/* ===== Main content ===== */

body > main {
	max-width: var(--content-max-width);
	margin-inline: auto;
}

body > main :first-child {
	margin-top: 0;
}

/* ===== Post navigation ===== */

.links-nextprev {
	display: flex;
	justify-content: space-between;
	gap: 0.5em 1em;
	list-style: none;
	border-top: 1px dashed var(--pico-muted-border-color);
	padding: 1em 0;
}

.links-nextprev > * {
	flex-grow: 1;
}

.links-nextprev-next {
	text-align: right;
}

/* ===== Post list ===== */

.postlist {
	counter-reset: start-from var(--postlist-index);
	list-style: none;
	padding: 0;
	padding-left: 1.5rem;
}

.postlist-item {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	counter-increment: start-from -1;
	margin-bottom: 1em;
}

.postlist-item::before {
	display: inline-block;
	pointer-events: none;
	content: "" counter(start-from, decimal-leading-zero) ". ";
	line-height: 100%;
	text-align: right;
	margin-left: -1.5rem;
}

.postlist--plain {
	padding-left: 0;
}

.postlist--plain .postlist-item {
	counter-increment: none;
}

.postlist--plain .postlist-item::before {
	content: none;
}

.postlist--plain .postlist-link {
	flex-basis: auto;
	padding-left: 0;
}

.postlist-date,
.postlist-item::before {
	font-size: 0.8125em;
	color: var(--pico-color);
}

.postlist-date {
	word-spacing: -0.5px;
}

.postlist-link {
	font-size: 1.1875em;
	font-weight: 700;
	flex-basis: calc(100% - 1.5rem);
	padding-left: 0.25em;
	padding-right: 0.5em;
	text-underline-position: from-font;
	text-underline-offset: 0;
	text-decoration-thickness: 1px;
}

.postlist-item-active .postlist-link {
	font-weight: bold;
}

/* ===== Tags ===== */

.post-tag {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-style: italic;
}

.postlist-item > .post-tag {
	align-self: center;
}

.tag-cloud {
	display: block;
	list-style: none;
	padding: 0;
	margin: 0;
	line-height: 1.2;
}

.tag-cloud li {
	display: inline;
	padding: 0;
	margin: 0;
}

.tag-cloud li + li::before {
	content: " ";
}

.tag-cloud__link {
	display: inline-block;
	line-height: 1;
	vertical-align: top;
	white-space: nowrap;
}

.tag-cloud__link--level-1 {
	font-size: 0.875em;
}

.tag-cloud__link--level-2 {
	font-size: 1em;
}

.tag-cloud__link--level-3 {
	font-size: 1.125em;
}

.tag-cloud__link--level-4 {
	font-size: 1.25em;
}

.tag-cloud__link--level-5 {
	font-size: 1.375em;
}

.post-metadata {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0.5em;
	list-style: none;
	padding: 0;
	margin: 0;
}

.post-metadata li {
	display: inline-flex;
	align-items: baseline;
	padding: 0;
	margin: 0;
}

.post-metadata time {
	margin-right: 1em;
}

/* ===== Blog roll ===== */

.blogroll {
	display: flex;
	flex-direction: column;
}

.blogroll-item {
	border-bottom: 1px dashed var(--pico-muted-border-color);
	padding-bottom: 1.5rem;
	margin-bottom: 1.5rem;
}

.blogroll-item:last-child {
	border-bottom: none;
}

.blogroll-text h2 {
	margin: 0 0 0.25rem;
	font-size: 1.1875em;
}

.blogroll-text h2 a[href]:not(:hover) {
	text-decoration: none;
}

.blogroll-meta {
	font-size: 0.8125em;
	color: var(--pico-muted-color);
	margin-bottom: 0.5rem;
}

.blogroll-excerpt {
	margin: 0.5rem 0 0;
	line-height: 1.5;
}

.blogroll-image {
	padding-bottom: 0;
	border-bottom: none;
	margin-left: -1rem;
	margin-right: -1rem;
	margin-bottom: 0;
}

.blogroll-image a {
	display: block;
}

.blogroll-image img {
	display: block;
	width: 100%;
	height: auto;
}

.blogroll-image .blogroll-meta {
	padding: 0.5rem 1rem 1.5rem;
	border-bottom: 1px dashed var(--pico-muted-border-color);
	margin-bottom: 1.5rem;
}

/* ===== Footer navigation ===== */

body > footer {
	padding: 0;
	background-color: var(--pico-background-color);
	color: var(--pico-color);
}

#site-nav {
	border-top: 1px dashed var(--pico-muted-border-color);
	margin-top: 2rem;
	min-height: 100dvh;
	font-size: clamp(1rem, 1.25vw, 1.5rem);
}

.site-nav-inner {
	padding: 1em 1rem;
	max-width: var(--content-max-width);
	margin-inline: auto;
}

.footer-nav-back {
	display: inline-block;
	font-family: var(--font-family-heading);
	font-size: 1.125em;
	font-weight: 700;
	margin-bottom: 1.5rem;
}

.footer-nav-back:link:not(:hover) {
	text-decoration: none;
}

/* 1 col on small Android */
.footer-nav-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
	margin-bottom: 1.5rem;
}

/* 2 cols from iPhone-sized screens */
@media (width >= 390px) {
	.footer-nav-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* 3 cols from tablet (1440px) */
@media (width >= 1440px) {
	.footer-nav-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* 4 cols from laptop (2560px) */
@media (width >= 2560px) {
	.footer-nav-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* 5 cols from desktop (2880px) */
@media (width >= 2880px) {
	.footer-nav-grid {
		grid-template-columns: repeat(5, 1fr);
	}
}

/* 6 cols from ultrawide (3840px) */
@media (width >= 3840px) {
	.footer-nav-grid {
		grid-template-columns: repeat(6, 1fr);
	}
}

.footer-nav-section {
	margin-bottom: 0;
}

.footer-nav-section h2 {
	font-size: 0.8125em;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--pico-muted-color);
	margin: 0 0 0.5rem;
}

/* PicoCSS makes nav ul a flex row and adds ±0.5rem margins — restore vertical list layout */
.footer-nav-section ul {
	display: block;
	list-style: none;
	padding: 0;
	margin: 0;
}

.footer-nav-section ul:first-of-type,
.footer-nav-section ul:last-of-type {
	margin: 0;
}

.footer-nav-section li {
	display: block;
	padding: 0;
	margin-bottom: 0.25rem;
}

.footer-nav-section li a {
	display: inline;
	margin: 0;
	padding: 0;
}

.footer-webring-list {
	font-size: 0.8125em;
	line-height: 1.35;
}

.footer-nav-section .footer-webring {
	display: flex;
	align-items: baseline;
	gap: 0.35rem;
	margin-bottom: 0.15rem;
	white-space: nowrap;
}

.footer-webring a:first-child,
.footer-webring a:last-child {
	min-width: 1ch;
	text-align: center;
	text-decoration: none;
}

.footer-nav-section .tag-cloud li {
	display: inline;
	margin: 0;
	vertical-align: top;
}

.footer-nav-section .tag-cloud li + li::before {
	content: " ";
}

.footer-nav-section .social-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}

.footer-nav-section .social-links__item {
	display: block;
	margin: 0;
}

.footer-nav-section .social-links__link {
	display: inline-grid;
	place-items: center;
	width: 1rem;
	aspect-ratio: 1;
	border-radius: var(--pico-border-radius);
	color: var(--pico-color);
}

.footer-nav-section .social-links__link:is(:hover, :focus-visible) {
	background-color: var(--pico-primary-focus);
}

.social-links__icon {
	width: 0.5rem;
	height: 0.5rem;
	filter: invert(1);
	opacity: 0.9;
}

.footer-brand {
	margin: 0 0 0.5rem;
}

.footer-brand .footer-logo {
	display: block;
	width: auto;
	height: 2rem;
	max-width: 100%;
	margin-bottom: 0.25rem;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .footer-logo {
		filter: invert(1);
	}
}

[data-theme="dark"] .footer-logo {
	filter: invert(1);
}

.theme-switcher {
	display: inline-block;
	width: auto;
	margin: 0.25rem 0 0;
	padding: 0.35em 0.75em;
	font-size: 0.875em;
}

.footer-brand__name {
	display: block;
	font-size: 1.25em;
	font-weight: 700;
}

.footer-supporter-list {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.footer-supporter-logo {
	display: block;
	height: 8rem;
	width: auto;
	max-width: 100%;
}

.footer-copyright__legal {
	font-size: 0.8125em;
	color: var(--pico-muted-color);
	margin: 0;
}

.footer-built-with {
	font-size: 0.8125em;
	color: var(--pico-muted-color);
	margin: 1.5rem 0 0;
}

/* ===== Landing page ===== */

.landing-main {
	max-width: none;
	padding: 2rem 0 0;
}

/* Always align with the navbar/footer content column */
.landing {
	display: flex;
	flex-direction: column;
	gap: 0;
	max-width: var(--content-max-width);
	margin-inline: auto;
}

@media (width >= 768px) {
	.landing {
		padding-inline: 1rem;
		gap: 2rem;
	}
}

/* 2 columns from tablet (1440px) */
@media (width >= 1440px) {
	.landing {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
	}
}

/* 3 columns at desktop (2880px) */
@media (width >= 2880px) {
	.landing {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* 4 columns at ultrawide (3840px) */
@media (width >= 3840px) {
	.landing {
		grid-template-columns: repeat(4, 1fr);
	}
}

.landing__block {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	min-height: 20rem;
	overflow: hidden;
	padding: 2rem 1rem;
	border-radius: 0;
}

@media (width >= 768px) {
	.landing__block {
		padding: 2rem;
		border-radius: 1rem;
	}
}

.landing__block h2 {
	font-size: clamp(2rem, 4vw, 3.5rem);
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.2;
	margin-bottom: 0.75rem;
}

.landing__block p,
.landing__block li {
	font-size: clamp(1.125rem, 2.5vw, 1.75rem);
	line-height: 1.4;
}

.landing__block--hero {
	align-items: center;
	background-color: var(--pico-background-color);
	text-align: center;
	min-height: 0;
	padding: 5rem 2rem;
	grid-column: 1 / -1;
}

@media (width >= 768px) {
	.landing__block--hero {
		padding: 5rem 2vw;
	}
}

.landing__block--hero h1 {
	font-size: clamp(2.5rem, 5vw, 5rem);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.1;
	margin-bottom: 1rem;
}

.landing__hero-subtitle {
	font-size: clamp(1.5rem, 3vw, 2.5rem);
	font-weight: 500;
	margin: 0;
}

/* On mobile: break visual blocks out to full viewport width while keeping
   text content aligned with the navbar/footer content column. */
@media (width < 768px) {
	.landing__block--bg-image,
	.landing__block--bg-color {
		width: 100vw;
		margin-inline: calc(50% - 50vw);
		padding-inline: calc(50vw - 50% + 1rem);
	}
}

.landing__block--bg-image {
	background-image:
		linear-gradient(rgb(0 0 0 / 65%), rgb(0 0 0 / 65%)),
		var(--bg-image, none);
	background-size: cover;
	background-position: center;
	color: #fff;
}

.landing__block--bg-image h2,
.landing__block--bg-image h3,
.landing__block--bg-image p,
.landing__block--bg-image ol,
.landing__block--bg-image li,
.landing__block--bg-image a {
	color: #fff;
}

.landing__block--bg-color {
	--landing-bg-color-text: #181c25;

	background-color: var(--pico-primary-background);
	color: var(--landing-bg-color-text);
}

.landing__block--bg-color h2,
.landing__block--bg-color h3,
.landing__block--bg-color p,
.landing__block--bg-color ol,
.landing__block--bg-color li,
.landing__block--bg-color a {
	color: var(--landing-bg-color-text);
}

.landing__block--bg-color h3 {
	font-size: clamp(1.125rem, 2.5vw, 1.75rem);
	font-weight: 400;
	margin: 0.25rem 0;
}

.landing__block--card {
	border: 1px solid var(--pico-muted-border-color);
	box-shadow: var(--pico-card-box-shadow);
}

.landing__block--plain {
	min-height: 0;
}

.landing__block--plain h2 {
	font-size: clamp(2rem, 4vw, 4rem);
	font-weight: 700;
	letter-spacing: -0.02em;
}
