@font-face {
	font-family: "Commissioner";
	src: url("/fonts/CommissionerBoldFlair.woff2") format("woff2");
	font-weight: bold;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Commissioner";
	src: url("/fonts/CommissionerRegular.woff2") format("woff2");
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Commissioner";
	src: url("/fonts/CommissionerItalic.woff2") format("woff2");
	font-weight: normal;
	font-style: italic;
	font-display: swap;
}

@font-face {
	font-family: "PT Mono";
	src: url("/fonts/PTMonoRegular.woff2") format("woff2");
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

:root {
	--font-family: "Commissioner", -apple-system, system-ui, sans-serif;
	--font-family-monospace: "PT Mono", Consolas, Menlo, Monaco, monospace;
	--font-family-caption: "Commissioner", -apple-system, system-ui, sans-serif;
}

/* Theme colors */
:root,
[data-theme="light"] {
	--background-color: #fff9f1;

	--text-color: #450357;
	--text-color-header: #450357;
	--text-color-link: #d8320c;
	--text-color-link-active: #cc1496;
	--text-color-link-visited: #b24bab;
	--text-color-accent: #cc1496;
	--text-color-highlight: #450357;
	--background-color-highlight: color-mix(in srgb, #ffe300, transparent 50%);
	--spoiler-color: #bc90ca;
	--code-background: color-mix(in srgb, var(--text-color), transparent 95%);
	--scrollable-shadow-color: var(--text-color-header);

	--font-size-text: 1.125rem;
	--font-size-caption: 0.825rem;
	--syntax-tab-size: 2;
	--article-width: 48rem;
	--sidenote-margin: 3rem;
	--transparency-underline: 80%;
	--star-mark: "♥";
	--end-mark: "❦";
}

@media (prefers-color-scheme: dark) {
	:root,
	[data-theme="dark"] {
		--background-color: #19001f;

		--text-color: #d7cde7;
		--text-color-header: #f6f0ff;
		--text-color-link: #dc7f07;
		--text-color-link-active: #cc1496;
		--text-color-link-visited: #df5ad6;
		--text-color-accent: #cc1496;
		--text-color-highlight: #2a0035;
		--background-color-highlight: #ffea78;
		--transparency-underline: 40%;
	}
}

/* Global stylesheet */
* {
	box-sizing: border-box;
}

@view-transition {
	navigation: auto;
}

/* ССЫЛКИ */

html,
body {
	padding: 0;
	margin: 0 auto;
	font-family: var(--font-family);
	color: var(--text-color);
	background-color: var(--background-color);
}

html {
	overflow-y: scroll;
}
body {
	margin: 0 2% 0 2%;
	padding-left: 0;
}

nav {
	width: 100%;
}

h1 {
	font-size: 3rem;
	margin-top: 0em;
	margin-bottom: 1.5rem;
	line-height: 1;
	word-wrap: break-word;
	word-break: break-word;
}

@media (max-width: 30rem) {
	h1:not(.homepage-name) {
		font-size: 2rem;
		margin-top: 0.4rem;
		margin-bottom: 0.75rem;
	}
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
.post-metadata,
ul,
ol,
pre,
table {
	max-width: var(--article-width);
}

h2,
h3,
h4,
h5,
h6 {
	margin-bottom: 0.5rem;
	margin-top: 0;
	padding-top: 1.5rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	color: var(--text-color-header);
	text-wrap: balance;
	line-height: 1;
}

h3 {
	font-size: var(--font-size-text);
	margin-bottom: 0;
	margin-top: 0 !important;
	line-height: 1.45;
}

p,
ul,
ol {
	font-size: var(--font-size-text);
	line-height: 1.45;
	margin: 0;
	hyphens: manual;
	-webkit-hyphens: manual;
	-ms-hyphens: manual;
}

@media (min-width: 760px) {
	p,
	ul,
	ol {
		hyphens: none;
		-webkit-hyphens: none;
		-ms-hyphens: none;
	}
}

@media (max-width: 420px) {
	p,
	ul,
	ol,
	h3 {
		line-height: 1.35;
	}
}

p {
	margin-bottom: 1rem;
	text-wrap-style: pretty;
}

p strong,
p b,
p .bold {
	letter-spacing: 0;
}

/* https://www.a11yproject.com/posts/how-to-hide-content/ */
mjx-assistive-mml,
.visually-hidden {
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

img[width][height] {
	height: auto;
}
img[src$=".svg"] {
	width: 100%;
	height: auto;
	max-width: none;
}
video,
iframe {
	width: 100%;
	height: auto;
	margin-bottom: 1rem;
}
iframe {
	aspect-ratio: 16/9;
}

figure {
	margin: 0;
}

figure img,
picture img {
	margin-left: 0;
	margin-right: 0;
	max-width: 100%;
}

br + figure img,
br + picture img {
	margin-top: 0.4rem;
}

a[href] {
	color: var(--text-color-link);
}
a[href]:visited {
	color: var(--text-color-link-visited);
}
a[href]:hover,
a[href]:active {
	color: var(--text-color-link-active);
}

/* ССЫЛКИ */
a,
a u,
.underline::after,
.post-time,
.highlighted span {
	text-decoration: underline;
	text-decoration-thickness: 1px; /* Задаём толщину подчёркивания */
	text-underline-offset: 0.175em; /* Задаём сдвиг подчёркивания */
	text-decoration-color: color-mix(
		in srgb,
		currentColor,
		transparent var(--transparency-underline)
	);
	text-decoration-skip: none; /* Запрещаем подчёркиванию пропускать выносные элементы букв */
	text-decoration-skip-ink: none;
	transition:
		color 0.25s ease-in,
		text-decoration-color 0.25s ease-in;
}

a:has(u) {
	text-decoration: none;
}

a:hover,
a:hover u {
	text-decoration-color: currentColor;
	transition:
		color 0.05s ease-in,
		text-decoration-color 0.05s ease-in;
}

a:visited:hover,
a:visited:hover u {
	text-decoration-color: currentColor;
	transition:
		color 0.05s ease-in,
		text-decoration-color 0.05s ease-in;
}

main,
footer {
	padding: 0;
}

header {
	/* border-bottom: 1px solid
		color-mix(in srgb, var(--text-color), transparent var(--transparency-underline)); */
	margin-bottom: 4rem;
}

footer {
	margin-top: 5rem;
	padding-top: 1rem;
	/* border-top: 1px solid color-mix(in srgb, currentColor, transparent var(--transparency-underline)); */
}

table {
	margin: 1rem 0 2rem 0;
	border-spacing: 0;
}
table td,
table th {
	padding-right: 1em;
	text-align: left;
	vertical-align: text-top;
}

table td {
	padding-top: 0.2em;
	padding-bottom: 0.6em;
}

table th {
	padding-top: 0.5em;
	padding-bottom: 0.5em;
	border-bottom: 1px solid
		color-mix(in srgb, currentColor, transparent var(--transparency-underline));
}

table br {
	line-height: 1;
	margin: -0.13em 0; /* Adjust this value to get desired spacing */
	display: block;
	content: "";
}

mark {
	color: var(--text-color-highlight);
	background: var(--background-color-highlight);
}

hr {
	height: 1px;
	background: transparent;
	color: color-mix(
		in srgb,
		var(--text-color),
		transparent var(--transparency-underline)
	);
	margin-top: 2rem;
	margin-bottom: 3rem;
}

article li {
	margin-top: 0.5rem;
}

ol,
ul {
	margin-top: 0;
	margin-bottom: 1rem;
	padding-left: 2rem;
}

p:has(+ ul),
p:has(+ ol) {
	margin-bottom: 0;
}

ul li::marker {
	content: "·    ";
}

pre,
code {
	font-family: var(--font-family-monospace) !important;
	line-height: 1.2 !important;
	letter-spacing: -0.02rem;
}
pre:not([class*="language-"]) {
	margin: 0.5em 0 1em 0;
	-moz-tab-size: var(--syntax-tab-size);
	-o-tab-size: var(--syntax-tab-size);
	tab-size: var(--syntax-tab-size);
	-webkit-hyphens: none;
	-ms-hyphens: none;
	hyphens: none;
	direction: ltr;
	text-align: left;
	white-space: pre;
	word-spacing: normal;
	word-break: normal;
	overflow-x: auto;
	white-space: pre-wrap;
}
code {
	font-size: 105%;
}

blockquote p {
	font-size: 1.7rem;
	font-style: italic;
	line-height: 1.2;
}

p code,
ul code,
ol code {
	background: var(--code-background);
	padding: 0rem 0.35rem 0.05rem 0.35rem;
	border-radius: 3px;
}

article ul,
article ol {
	margin-bottom: 1rem;
}

/* Header */
header {
	display: flex;
	gap: 1em;
	flex-wrap: wrap;
	align-items: center;
	padding: 1em 0 1em 0;
}
.home-link {
	font-size: 1em; /* 16px /16 */
	font-weight: 700;
}
.home-link:link:not(:hover) {
	text-decoration: none;
}

.linklist {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	align-items: center;
	padding: 0;
	margin: 0;
	list-style: none;
	line-height: 1.5;
}

.linklist-item {
	position: relative;
	display: inline;
}

.linklist-item:has(a) {
	color: var(--text-color-link);
}

.unvisitable a:visited {
	color: var(--text-color-link);
	text-decoration-color: currentColor;
}

.unvisitable a:hover {
	color: var(--text-color-link-active);
	text-decoration-color: currentColor;
}

.linklist-item::after,
.post-tag::after {
	content: "     ";
}

.nav-content .linklist-item::after .post-metadata .linklist-item::after {
	content: "   ";
}

.linklist-item::after {
	white-space: nowrap;
	color: currentColor;
}

/* Hide the last connector */
.linklist .linklist-item:last-child::after {
	display: none;
}

.links-nextprev {
	display: flex;
	justify-content: space-between;
	list-style: "";
	border-top: 1px solid
		color-mix(in srgb, currentColor, transparent var(--transparency-underline));
	padding: 1em 0;
	margin-top: 2.5em;
}

.links-nextprev > * {
	flex-grow: 1;
	max-width: calc((100% - 2%) / 2);
}

.links-nextprev-next {
	text-align: left;
}
.links-nextprev li {
	line-height: 1.15;
}

.links-nextprev li::marker {
	content: "";
}

.highlighted-item,
.highlighted-item::after {
	color: var(--text-color-link);
	text-decoration-color: var(--text-color-link);
	font-weight: bold;
}

.current-item,
.current-item::after {
	font-weight: bold;
	text-decoration: none;
}

.linklist li:has(+ .current-item)::after {
	text-decoration: none;
}

.spoiler {
	background-color: var(--spoiler-color);
	color: transparent;
	border-radius: 3px;
	transition: color ease-in 0.01s ease-out 0.55s;
	cursor: help;
}

.spoiler:not(:hover) * {
	background-color: inherit;
	color: inherit;
}

.spoiler:hover,
.spoiler:focus {
	background-color: transparent;
	color: var(--text-color);
}

i {
	display: inline-block;
	font-size: 1.1em;
	width: 1.1em;
	height: 1.1em;
	background-color: currentColor;
	mask-size: 1.3em !important;
	mask-position: center !important;
	mask-repeat: no-repeat !important;
	margin-bottom: -3px;
}

.ha-placeholder {
	font-weight: normal;
}

.post-metadata,
.links-nextprev,
.sidenote,
figcaption,
.footer-built,
.postslist-container a,
.postslist-container p {
	font-size: var(--font-size-caption);
	line-height: 1.2;
	font-family: var(--font-family-caption);
}

.sidenote::after {
	content: " ↓";
	font-style: normal;
}

@media (min-width: calc(50rem + 150px)) {
	.sidenote {
		position: absolute;
		left: calc(2% + var(--article-width));
		margin-left: var(--sidenote-margin);
		margin-top: 0.4em;
		max-width: 200px;
	}
	button.sidenote {
		margin-top: 0.4em;
	}
	.sidenote::after {
		content: "";
	}
}

.image-grid:has(.image-item) {
	display: flex;
	gap: 2px 2px;
	margin: 1rem 0;
	width: fit-content;
	max-width: inherit;
}

.unvisitable a.post-url-anchor,
.unvisitable a.post-url-anchor:visited {
	text-decoration-color: currentColor;
	color: color-mix(
		in srgb,
		currentColor,
		transparent var(--transparency-underline)
	) !important;
}

figcaption {
	margin-bottom: 1.3rem;
}

.linklist-item {
	white-space: collapse;
}

.nav-container {
	display: flex;
	gap: 0.7em;
	margin-top: 1em;
	/* margin-bottom: 5em; */
	max-width: 100% !important;
}

.nav-cards {
	display: flex;
	flex-wrap: nowrap;
	gap: 1rem;
}

.nav-card {
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
}

.nav-title {
	font-size: 12px;
	margin-bottom: 0.6em;
	text-wrap: balance;
	line-height: 1.1;
}

.nav-title.bold {
	color: var(--text-color-header);
}

.nav-card .linklist {
	margin-top: -2px;
	line-height: 1;
}

.comma {
	font-size: 12px;
	margin-bottom: 0;
	line-height: 1.2;
}

.comma a:hover {
	color: var(--text-color-link-active);
}

.comma::after {
	content: ", ";
}

.disabled {
	color: var(--text-color-disabled);
}

nav .unvisitable a[href]:visited,
nav a[href] {
	text-decoration: none !important;
}

.nav-image {
	height: 65px;
	background-image: url("/assets/navsprite.webp");
	background-repeat: no-repeat;
	background-size: auto 65px;
	filter: grayscale(100%);
	transition: filter 0.35s ease-out;
	z-index: 1;
	flex-shrink: 0;
}

a:hover .nav-image:not(.accent) {
	filter: grayscale(0%);
	transition: filter 0.05s ease-in;
}

.tint {
	position: relative;
	display: inline-block;
	height: 65px;
	width: fit-content;
}

.tint::after {
	content: "";
	position: absolute;
	inset: 0;
	background-color: var(--text-color);
	opacity: 0.4;
	pointer-events: none;
	mix-blend-mode: color;
	transition: opacity 0.35s ease-out;
}

@media (prefers-color-scheme: dark) {
	.tint::after {
		mix-blend-mode: darken;
	}
}

.tint.accent::after {
	display: none;
}

a:hover .tint::after {
	opacity: 0;
	transition: opacity 0.05s ease-in;
}

article > p:last-of-type::after,
.short p::after {
	content: var(--end-mark) !important;
	margin-left: 0.1rem;
}

article {
	font-size: var(--font-size-text);
}

.scrollable {
	max-width: 100%;
	position: relative;
	background-color: var(--background-color);
}

.scrollable__in {
	height: 100%;
	overflow: auto;
	scrollbar-width: none;

	box-sizing: border-box;
}

.scrollable::before,
.scrollable::after {
	content: "";
	width: 15px;
	position: absolute;
	top: 0;
	bottom: 0;
	pointer-events: none;
	opacity: 0;
	transition: 0.15s linear;
	z-index: 1;
	margin: -5px 0;
}

.scrollable::before {
	left: 0;
	background: linear-gradient(to right, var(--background-color), transparent);
}

.shadow::before {
	background: radial-gradient(
		at 0%,
		color-mix(in srgb, var(--scrollable-shadow-color), transparent 80%),
		transparent 75%
	);
}

.bordered::before {
	border-left: 1px solid var(--scrollable-shadow-color);
}

.scrollable::after {
	right: 0;
	background: linear-gradient(to left, var(--background-color), transparent);
}

.shadow::after {
	background: radial-gradient(
		at 100%,
		color-mix(in srgb, var(--scrollable-shadow-color), transparent 80%),
		transparent 75%
	);
}

.bordered::after {
	border-right: 1px solid var(--scrollable-shadow-color);
}
.scrollable.scrollable__verified.is__scrolled::before,
.scrollable.scrollable__verified:not(.is__end)::after {
	opacity: 1;
}

picture + :is(h1, h2, h3, h4, h5, h6),
figure + :is(h1, h2, h3, h4, h5, h6) {
	padding-top: 0;
	margin-top: -0.5rem;
}

footer {
	display: flex;
	align-items: last baseline;
	justify-content: space-between;
	flex-wrap: wrap;
}
.footer-text {
	margin-bottom: 2rem;
}
.footer-built {
	margin-bottom: 2rem;
	opacity: 0.7;
}
.footer-built a {
	color: var(--text-color) !important;
}

#typo-popup {
	position: fixed;
	top: 2%;
	right: 2%;
	padding: 10px 16px;
	border-radius: 8px;
	font-size: var(--font-size-text);
	color: var(--background-color);
	background-color: var(--text-color-accent);
	pointer-events: none;
	z-index: 2;
}

#typo-popup {
	display: none;
	opacity: 0;
	transition: opacity 0.4s ease;
}
#typo-popup.show {
	display: block;
	opacity: 1;
}

/* CUSTOM CLASSES */

@media screen and (min-width: 30rem) {
	.window {
		border-radius: 5.5px;
		outline: 1.5px solid #c4c4e3;
		outline-offset: -1.3px;
	}
}

.giant .possum {
	font-size: inherit;
	margin-bottom: -0.41rem;
}

.possum {
	mask: url(/assets/possum.svg);
}

.giant {
	font-size: 7rem;
	color: var(--text-color-accent);
	margin-bottom: 0.2rem;
	line-height: 0.9;
	letter-spacing: -0.2rem;
}

@media (max-width: 30rem) {
	.giant {
		font-size: 4rem;
	}
}

.bold {
	font-weight: bold;
}

.accent,
.accent * {
	color: var(--text-color-accent) !important;
	filter: none;
}

.transparent {
	color: transparent;
}

.flex {
	display: flex;
	flex-wrap: wrap;
	gap: 2%;
	margin-bottom: 1rem;
}

.flex * {
	min-width: 220px;
}

.birka {
	font-size: var(--font-size-caption);
	font-family: var(--font-family-caption);
	margin-bottom: -0.5rem;
}

.full-width,
h1:has(.full-width),
figure:has(.full-width),
picture:has(.full-width) {
	width: 100%;
	max-width: 100%;
}

.bigger {
	font-size: 2rem;
}

.italic {
	font-style: italic;
}