@import "https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css";

/*
 * Bulma extensions
 */
.button.is-multiline {
	min-height: 2.25em;
	white-space: unset;
	height: auto;
	flex-direction: column;
}

.button.is-multiline .icon {
	margin: 0! important;
}

/*
 * Global CSS
 */
:root {
	--bg-color: white;
	--fg-color: black;
	--dark-mode-bg-color: #0e0e1c;
	--dark-mode-fg-color: white;
}

body {
	display: flex;
	width: 100%;
	height: 100%;
	flex-direction: column;
	color: var(--fg-color);
	background-color: var(--bg-color);
	font-family: monospace;
}

main {
	clear: both;
}

/*
 * Header
 */
header {
	width: 100vw;
}

header a {
	text-decoration: none;
}

/*
 * Header: Logo
 */
#logo {
	display: block;
	width: 35%;
	margin-top: 3vw;
	margin-left: 3vw;
}

/*
 * Header: Top Bar
 */
#top-bar {
	width: 100vw;
	color: white;
	background-color: black;
	padding-top: 1rem;
	padding-bottom: 4rem;
	clip-path: polygon(0 0, 100% 0, 100% 100%, 0 30%);
}

#top-bar nav a {
	padding: 0.25em 0.5em;
	font-size: 2em;
	color: white;
	text-decoration: none;
	text-transform: uppercase;
}

#top-bar nav a:hover {
	color: black;
	background-color: white;
}

/*
 * Dark Mode Toggle
 */
button#dark-mode-toggle {
	background: none;
	cursor: pointer;
	border: none;
}

button#dark-mode-toggle svg {
	width: 2em;
	height: 2em;
}

button#dark-mode-toggle svg#dark-mode-sun {
	display: inline;
}

button#dark-mode-toggle svg#dark-mode-moon {
	display: none;
}

/*
 * Front page: key points
 */
#key-points > div.key-point {
	padding: 4em 0;
}

#key-points > div.key-point > section {
}

#key-points > div.key-point:nth-child(odd) {
	color: white;
	background-color: black;
	clip-path: polygon(0 30%, 100% 0, 100% 100%, 0 70%);
	padding-top: 10rem;
	padding-bottom: 10rem;
}

#key-points > div.key-point:nth-child(2n+1) {
	clip-path: polygon(0 20%, 100% 0, 100% 100%, 0 80%);
}

#key-points > div.key-point:nth-child(odd) a,
#key-points > div.key-point:nth-child(odd) h1 {
	color: white;
}

#key-points > div.key-point:nth-child(odd) pre {
	border: 2px solid white;
}

.chevron-down {
	margin-top: 2em;
	margin-bottom: 2em;
	width: 100vw;
	height: 5em;
	background-color: #eee;
	clip-path: polygon(0 0, 50% 95%, 100% 0, 100% 5%, 50% 100%, 0 5%);
}

/*
 * Front Page: social media links
 */
.social-media-link {
	padding: 2em;
}

.social-media-link > a {
	width: 100%;
}

.social-media-link svg {
	width: 90%;
	height: 90%;
}

/*
 * Page
 */
.page-links {
	float: right;
	display: inline;
}

/*
 * Content
 */
.content h1,
.content h2,
.content h3,
.content h4 {
	margin-top: 0;
	margin-bottom: 0.5em;
}

.content h1:first-of-type {
	margin-top: 0;
	margin-bottom: 0.25em;
	padding-top: 0.25em;
	padding-bottom: 0.25em;
}

.content a {
	color: var(--fg-color);
	font-weight: bold;
	text-decoration: underline;
}

.content a:hover {
	color: var(--bg-color);
	background-color: var(--fg-color);
	text-decoration: none;
}

.content a.button,
.content a.link {
	background-color: inherit;
	text-decoration: none;
}

.content a.button:hover,
.content a.link:hover {
	color: var(--fg-color);
}

.content a > svg {
	height: 100%;
	width: 100%;
}

.content blockquote {
	padding: 1em;
	background-color: #c3c3c3;
	font-style: italic;
}

.content code,
.content h1,
.content h2,
.content h3,
.content h4 {
	word-wrap: break-word;
}

.content figure:has(pre) {
	text-align: left;
}

.content pre {
	color: var(--bg-color);
	background-color: var(--fg-color);
	padding: 1em 1.5em;
	margin-bottom: 1em;
	overflow-x: auto;
}

.content pre a {
	color: inherit;
	text-decoration: underline;
}

.content ul,ol {
	list-style: square;
}

.content ul,ol > li {
	padding-left: 2em;
}

.content div.note,
.content div.warning {
	clear: right;
	margin: 0.5em 0 0.5em 0;
	padding: 0.5em;
	border: 0.5em solid var(--fg-color);
}

.content div.note {
	background-color: #a8ffa8;
}

.content div.warning {
	background-color: #ffa8a8;
}

/*
 * Blog posts
 */
article.post > h1 {
	border-bottom: 1px solid #dbdbdb;
}

article.post .post-links {
	border-top: 1px solid #dbdbdb;
	margin-top: 1em;
	padding-top: 0.5em;
}

article.post .post-links svg {
	height: 1.7em;
	width: 1.7em;
}

/*
 * Footer
 */
footer.footer {
	clear: both;
	margin-top: 10rem;
	padding-top: 10rem;
	padding-bottom: 3em;
	color: gray;
	background-color: var(--fg-color);
	font-size: medium;
	clip-path: polygon(0 100%, 100% 100%, 100% 20%, 0 0);
}

footer.footer div.columns > div.column > h5 {
	color: var(--bg-color);
	font-size: medium;
	font-weight: bold;
}

footer.footer a {
	color: gray;
}

footer.footer a:hover {
	color: var(--fg-color);
	background-color: var(--bg-color);
}

/*
 * Small Screens
 */
@media only screen and (max-width: 1023px) {
	.content {
		width: 95vw !important;
	}

	main section.content {
		padding-left: 1em;
		padding-right: 1em;
	}

	object.demo {
		width: 100%;
	}

	#top-bar {
		clip-path: polygon(0 0, 100% 0, 100% 100%, 0 50%);
	}

	#key-points > div.key-point:nth-child(odd) {
		clip-path: polygon(0 20%, 100% 0, 100% 100%, 0 80%);
	}

	#key-points > div.key-point:nth-child(2n+1) {
		clip-path: polygon(0 10%, 100% 0, 100% 100%, 0 90%);
	}

	footer.footer {
		clip-path: polygon(0 100%, 100% 100%, 100% 10%, 0 0);
	}
}

/*
 * Dark Mode
 */
body.dark-mode {
	color: var(--dark-mode-fg-color);
	background-color: var(--dark-mode-bg-color);
}

body.dark-mode #logo,
body.dark-mode .social-media-link svg,
body.dark-mode #feed-icon,
body.dark-mode #hackernews-icon {
	filter: invert(100%);
}

body.dark-mode main .box,
body.dark-mode main .button,
body.dark-mode main table {
	color: var(--dark-mode-fg-color);
	background-color: var(--dark-mode-bg-color);
}

body.dark-mode main code {
	color: var(--dark-mode-fg-color);
	background-color: black;
}

body.dark-mode main h1,
body.dark-mode main h2,
body.dark-mode main h3,
body.dark-mode main h4,
body.dark-mode main h5,
body.dark-mode main h6,
body.dark-mode main p,
body.dark-mode main label,
body.dark-mode main strong,
body.dark-mode main a {
	color: var(--dark-mode-fg-color);
}

body.dark-mode .content a.button:hover,
body.dark-mode .content a.link:hover {
	color: var(--dark-fg-color);
}

body.dark-mode main article.message > div.message-body > p {
	color: var(--var-fg-color);
}
body.dark-mode main article.message > div.message-body a:hover {
	color: var(--dark-mode-fg-color);
}
