/* site.css — the look of chee.party, ported from the astro site.
 * src/styles/*.css, then every component's de-scoped <style>. Post body
 * styles are in entry-content.css; the song player in song.css. */

/* ── preflight.css ── */
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
/*! modern-normalize v2.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */
/*! minireset.css v0.0.6 | MIT License | github.com/jgthms/minireset.css */

*,
::before,
::after {
	box-sizing: inherit;
	border-width: 0;
	border-style: solid;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001s !important;
		transition-duration: 0.001s !important;
		animation-iteration-count: 1 !important;
	}
}

html {
	box-sizing: border-box;
	line-height: 1.15;
	-webkit-text-size-adjust: 100%;
	-moz-tab-size: 4;
	tab-size: 4;
	font-family:
		system-ui,
		-apple-system,
		sans-serif;
}

html,
body {
	margin: 0;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-size: inherit;
	font-weight: inherit;
}

abbr[title] {
	text-decoration: underline dotted;
}

b,
strong {
	font-weight: bolder;
}

code,
kbd,
samp {
	font-family: ui-monospace, monospace;
	font-size: 1em;
}

small {
	font-size: 80%;
}

sub,
sup {
	font-size: 75%;
	line-height: 0;
	position: relative;
	vertical-align: baseline;
}

sub {
	bottom: -0.25em;
}

sup {
	top: -0.5em;
}

table {
	text-indent: 0;
	border-color: inherit;
	border-collapse: collapse;
	border-spacing: 0;
}

td,
th {
	padding: 0;

	&:not([align]) {
		text-align: inherit;
	}
}

button,
input,
optgroup,
select,
textarea {
	font-family: inherit;
	font-size: 100%;
	line-height: 1.15;
	margin: 0;
}

button,
select {
	text-transform: none;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
	-webkit-appearance: button;
	background: inherit;
	color: inherit;
	cursor: default;
}

::-moz-focus-inner {
	border-style: none;
	padding: 0;
}

:-moz-focusring {
	outline: 1px dotted ButtonText;
}

:-moz-ui-invalid {
	box-shadow: none;
}

legend {
	padding: 0;
}

progress {
	vertical-align: baseline;
}

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
	height: auto;
}

[type="search"] {
	-webkit-appearance: textfield;
	outline-offset: -2px;
}

::-webkit-search-decoration {
	-webkit-appearance: none;
}

::-webkit-file-upload-button {
	-webkit-appearance: button;
	font: inherit;
}

summary {
	display: list-item;
}

img,
video {
	height: auto;
	max-width: 100%;
}

iframe {
	border: 0;
}

a:active,
a:hover {
	outline-width: 0;
}

dialog {
	padding: 0;
}

[hidden] {
	display: none !important;
}

[contenteditable] {
	outline: 0;
}

/* ── font-face.css ── */
@font-face {
	font-family: "Jost*";
	font-style: normal italic;
	font-weight: 100 900;
	font-display: swap;
	src: url("/fonts/jost-vf.woff2") format("woff2");
}

@font-face {
	font-family: "Lifesender Mono";
	font-style: normal italic;
	font-weight: 100 900;
	font-display: swap;
	src: url("/fonts/lifesender-mono.woff2") format("woff2");
}

@font-face {
	font-family: "ITC Garamond STD Book Narrow";
	font-display: swap;
	src: url("/fonts/itc-garamond-std-book-narrow.woff2") format("woff2");
}

/* ── typography.css ── */
:root {
	--family-sans:
		system-ui, "Jost*", "Jost", system-ui, -apple-system, sans-serif;
	--family-mono: var(--mono-family);

	--font-size: 1rem;
	--font-size-1: calc(var(--font-size) * 3);
	--font-size-2: calc(var(--font-size) * 2.5);
	--font-size-3: calc(var(--font-size) * 2);
	--font-size-4: calc(var(--font-size) * 1.5);
	--font-size-5: calc(var(--font-size) * 1.24);
	--font-size-6: calc(var(--font-size) * 1);
	--font-size-7: calc(var(--font-size) * 0.76);
	--font-size-8: calc(var(--font-size) * 0.5);
}

/* ── spacing.css ── */
:root {
	--space: 0.25rem;
	--space-05: calc(var(--space) * 0.5);
	--space-1: calc(var(--space) * 1);
	--space-105: calc(var(--space) * 1.5);
	--space-2: calc(var(--space) * 2);
	--space-3: calc(var(--space) * 3);
	--space-4: calc(var(--space) * 4);
	--space-5: calc(var(--space) * 5);
	--space-6: calc(var(--space) * 6);
	--space-7: calc(var(--space) * 7);
	--space-8: calc(var(--space) * 8);
	--space-9: calc(var(--space) * 9);
	--space-10: calc(var(--space) * 10);
	--space-11: calc(var(--space) * 11);
	--space-12: calc(var(--space) * 12);
	--space-13: calc(var(--space) * 13);
	--space-14: calc(var(--space) * 14);
	--space-15: calc(var(--space) * 15);
}

/* ── palette.css ── */
:root {
	--f-blue: #2269ff;
	--lemon: #ff8;
	--mynt: oklch(0.88 0.17 167.51 / 1);
	--sunglow: oklch(0.86 0.16 87.44 / 1);
	--blue-crayola: oklch(0.52 0.2689 263.27);
	--viridian: #417b5a;

	--text: oklch(0 0 0 / 1);
	--page: oklch(1 0 0 / 1);
}

/* ── global.css ── */
@keyframes pulse {
	0% {
		transform: scale(1);
	}

	50% {
		transform: scale(5);
	}

	100% {
		transform: scale(1);
	}
}

:root {
	--page-fill: yellow;
	--page-line: black;
	--shaded-fill: color-mix(in srgb, var(--page-fill) 90%, var(--page-line));
	--shaded-line: var(--page-line);

	--link-line: var(--f-blue);
	--offset: color-mix(in srgb, var(--page-fill) 90%, var(--link-line));

	--entry-fill: var(--page-fill);
	--entry-line: var(--page-line);

	--li-1: rgba(255, 255, 245);
	--li-2: rgba(255, 250, 255);
	--li-3: rgba(230, 255, 240);
	--li-4: rgba(240, 255, 255);
	--li-5: rgba(255, 230, 240);
	--li-6: rgba(240, 240, 255);

	--text-family: "Jost*", sans-serif;
	--mono-family: monaco, Consolas, Lucida Console, "Lifesender Mono", monospace;

	--tag-family: var(--mono-family);
	--entry-family: var(--text-family);
	--heading-weight: 600;

	--quote-fill: var(--offset);
	--quote-line: var(--page-line);
	--quote-left-border-line: var(--link-line);
	--quote-family: var(--text-family);

	--reading-width: 72ex;

	--code-comment: #a2b2d4;
	--code-number: #2d83f9;
	--code-name: #20c99b;
	--code-constant: #aa3565;
	--code-function: #7633cf;
	--code-keyword: #1b999f;
	--code-string: #363;
	--code-string-fill: #acffcc33;
	--code-regex-fill: #ff000011;
	--code-regex: black;

	--code-fill: var(--offset);
	--inline-code-fill: var(--code-fill);
	--code-line: var(--page-line);
	--inline-code-line: var(--code-line);
	--code-border-line: var(--code-line);

	--canvas-fill: var(--shaded-fill);
	--scrollbar-front: var(--shaded-line);
	--scrollbar-back: var(--shaded-fill);

	--tag-fill: var(--lemon);
	--tag-line: black;
}

* {
	scrollbar-color: var(--scrollbar-front) var(--scrollbar-back);
	/* image-rendering: pixelated; */
	overscroll-behavior-y: none;
}

::selection {
	background: #36f9c099;
}

html {
	height: 100%;
	font-size: 1.2em;
}

body {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	margin: 0;
	padding-bottom: var(--extra-bottom);
	font-family: var(--text-family);
	color: var(--page-line);
}

main {
	flex: 1;
}

code {
	font-family: var(--mono-family);
}

[hidden] {
	display: none;
}

img,
video {
	max-width: 100%;
}

a {
	text-decoration-skip-ink: auto;
	color: var(--link-line);
}

.sr-only {
	border: 0;
	padding: 0;
	margin: 0;
	position: absolute !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.button {
	--fill: var(--page);
	--border-color: color-mix(in oklab, var(--page), var(--text) 80%);
	--text-color: color-mix(in oklab, var(--page), var(--text) 70%);
	background: var(--fill);
	color: var(--text-color);
	font-family: var(--text-family);
	font-size: 0.96rem;
	text-decoration: none;
	border: 1px solid var(--border-color);
	padding-inline: 0.5rem;
	padding-block: 0.25rem;
	box-shadow: 1px 1px 0px var(--border-color);
	position: relative;
	user-select: none;
	touch-action: manipulation;
	border-radius: 2px;
	white-space: nowrap;
	display: flex;
	min-height: 2rem;
	align-items: center;
	justify-content: center;
	transition:
		border-color 0.1s ease-out,
		color 0.1s ease-out,
		background-color 0.1s ease-out;
	&:hover {
		--border-color: var(--text);
		--text-color: var(--text);
		box-shadow:
			1px 1px 0px var(--border-color),
			2px 2px 0px var(--border-color);
		top: -1px;
		left: -1px;
	}
	&:active {
		box-shadow: 0px 0px 0px 0px;
		top: 2px;
		left: 2px;
		border-left-width: 2px;
		border-top-width: 2px;
	}
}

hr {
	position: relative;
	height: 2rem;
	&::after {
		content: "🥀";
		display: block;
		position: absolute;
		z-index: 2;
		top: 30%;
		left: 50%;
		box-shadow: 0 0 10px 15px white;
		background: white;
	}
	&.ok::after {
		content: "🆗";
	}
	&.hehe::after {
		content: "😋";
	}
	&.coolcoolcool::after {
		content: "🆒 🆒 🆒";
		margin-left: -1.25em;
	}
	&::before {
		content: "";
		width: 100%;
		height: 4px;
		background: black;
		position: absolute;
		left: 0;
		top: 50%;
	}
	&.none {
		border-bottom: 2px dashed;
		background: none;
		outline: none;
		margin: 1em 0;
		height: 0;
		&::before {
			display: none;
		}
		&::after {
			display: none;
		}
	}
}

.spin {
	animation: spin 4s linear infinite;
}

@keyframes spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

/* ── layouts/cherries-layout.astro ── */
.cherries {
	background: #fbf6ff;
	background: var(--page-fill);
	color: var(--page-line);
	--scrollbar-front: var(--page-line);
	--scrollbar-back: var(--page-fill);
}

/* ── components/mouse-trail.astro ── */
mouse-trail {
	pointer-events: none;
	position: absolute;
	top: 0px;
	left: 0px;
	font-size: 40px;
	height: 1em;
	width: 1em;
	scale: 0.1;
	transition:
		scale 0.2s linear,
		translate 0.2s linear,
		opacity 0.5s ease;
}

/* ── components/header/header.astro ── */
:root {
	font-family: var(--mono-family);
	--header-height: 2rem;
}

.site-header {
	margin: 0;
	background: black;
	box-shadow: 0 2px 8px rgba(var(--black), 5%);
	font-weight: 500;
	color: white;
	position: sticky;
	top: 0;
	z-index: 100;
	display: flex;
	place-items: center;
	place-content: space-between;
	line-height: 1.2;
	padding: 0.5em;
}

.site-header > a {
	color: white;
	border-bottom: 4px solid transparent;
	text-decoration: none;
	display: flex;
	place-content: start;
	place-items: center;
	gap: 0.5ex;
	width: 6em;
	white-space: nowrap;
}

.site-header > a.active {
	text-decoration: none;
	border-bottom-color: var(--accent);
}

/* ── components/header/cherries.astro ── */
.cherries-logo {
	height: 1em;
	width: 1em;
}
.cherries-logo .stem {
	fill: var(--stem);
}
.cherries-logo .cherry {
	fill: var(--cherries);
}

/* ── components/header/clouds.astro ── */
.clouds-logo {
	height: 1em;
	width: 1em;
	border-radius: 100%;
	background: black;
	padding: 2px;
}

/* ── components/footer/footer.astro ── */
:root {
	--page-footer-top-margin: 2em;
}
.site-footer {
	margin-top: var(--page-footer-top-margin);
	background: black;
	--navigation-line: white;
	--navigation-hover-line: #ff4a90;
}

/* ── components/navigation/navigation.astro ── */
.site-nav {
	display: flex;
	place-content: space-between;
	place-items: center;
	cursor: default;
	font-family: system-ui, sans-serif;
	gap: 2em;
	padding: 0.24em 0;
}

.site-nav > a {
	display: flex;
	place-content: center;
	place-items: center;
	font-family: system-ui, sans-serif;
	transition:
		scale 0.2s,
		color 0.2s;
	color: var(--navigation-line, black);
	text-decoration: none;
	&:hover {
		scale: 1.1;
		color: var(--navigation-hover-line, #3874ff);
		svg path {
			fill: var(--navigation-hover-line, #3874ff);
		}
	}
}

.site-nav > a svg {
	height: 1em;
	width: 1em;
	path {
		fill: var(--navigation-line, black);
		transition: fill 0.2s;
	}
}

/* ── components/navigation/pagination.astro ── */
.nav-current {
	color: white;
	user-select: none;
}

/* ── layouts/entry-list-layout.astro ── */
.h-feed {
	--entry-shadow: #6093;
}

.listing-header {
	max-width: var(--reading-width);
	margin: auto;
	display: flex;
	place-items: top;
	background: white;
	width: 100%;
	padding: 1rem;
	text-align: center;
	border-radius: 8px;
	border: 8px double rgba(200, 0, 255, 0.2);
}

.listing-header h1 {
	font-weight: 350;
	width: 100%;
}

.listing-header .matching {
	font-weight: 444;
	background: #ffff0022;
	padding: 0 0.25em;
	border-radius: 4px;
	transform: skewX(-6deg);
	display: inline-block;
}

/* ── components/entry/entry.astro (the chrome; body styles are in
 * entry-content.css) ── */
@keyframes hue-cycle {
	0% {
		filter: hue-rotate(1deg);
	}
	50% {
		filter: hue-rotate(179deg);
	}
	100% {
		filter: hue-rotate(359deg);
	}
}

.h-entry {
	margin-top: 2rem;
	--li-1: rgba(255, 255, 245);
	--li-2: rgba(255, 250, 255);
	--li-3: rgba(230, 255, 240);
	--li-4: rgba(240, 255, 255);
	--li-5: rgba(255, 230, 240);
	--li-6: rgba(240, 240, 255);
}

.h-entry > .entry-footer {
	font-family: var(--mono-family);
	font-size: 14px;
	padding: 0.5rem;
	display: flex;
	justify-content: space-between;
	border-bottom-left-radius: var(--radius);
	border-bottom-right-radius: var(--radius);
}

.h-entry .eot {
	display: flex;
	justify-content: space-between;
	text-align: right;
	flex-direction: column;
}

.h-entry .date-link {
	color: inherit;
	text-decoration: none;
}

article.h-entry {
	--header-fill: white;
	--box-shadow-fill: oklch(from #ff0088 l c h);
	--box-shadow: 0 0 0 0 var(--box-shadow-fill), 0 0 10px 2px #66003322;
	--entry-fill: white;
	--entry-border-line: white;
	--radius: 0.5em;
	--padding-inline: 0.75em;
	border-radius: var(--radius);
	max-width: var(--reading-width);
	margin: auto;
	margin-top: 2rem;
	font-size: 1.0618033988em;
	border: 0px solid var(--entry-border-line);
	padding-top: 0px;
	box-shadow: var(--box-shadow);
	background: var(--entry-fill);
	position: relative;
}

.h-entry > .entry-header {
	--radius: 10px;
	border-top-left-radius: var(--radius);
	border-top-right-radius: var(--radius);
	padding-inline: var(--padding-inline);
	padding-block: 0.5rem;
	font-size: 0.8rem;
	position: relative;
}

.h-entry > .entry-header h1 {
	font-size: 1em;
	text-align: center;
	padding: 1px 1ex;
	margin: 0 auto;
	font-weight: 600;
	z-index: 0;
	position: relative;
	display: inline-block;

	a {
		text-decoration: none;
		color: var(--entry-line);
	}
}

.h-entry > .song-wrapper {
	--song-fill: var(--header-fill);
}

.h-entry > .e-content {
	padding-inline: var(--padding-inline);
}

/* the <code><pre> wrapper of plain (.txt) posts */
.e-content.plain {
	font-size: 14.7px;
}
.e-content.plain > code > pre {
	white-space: pre;
	font-size: 15px;
}
.e-content.plain > code {
	font-size: 15px;
}

.h-entry .tags {
	--tag-fill: white;
	--tag-transform: none;
	--tag-padding: 0;
}

.h-entry .draft {
	background: deeppink;
	color: white;
	font-family: var(--mono-family);
	font-weight: 900;
	padding: 0 1em;
}

/* ── components/entry/tag.astro ── */
a[rel="tag"].p-category {
	display: inline-block;
	background: var(--tag-fill);
	font-size: 1em;
	color: var(--tag-line);
	font-family: var(--tag-family);
	text-align: center;
	transform: var(--tag-transform, skewX(-10deg));
	line-height: 1.4;
	padding: var(--tag-padding, 0.5em);
	border-radius: 0;
}
