@font-face {
  font-family: "Playwrite Norge";
  src: url("/fonts/PlaywriteNorge.woff2") format("woff2");
}

@font-face {
  font-family: 'Monaspace Neon';
  src: url("/fonts/monaspace.woff2") format("woff2");
}

@font-face {
  font-family: 'Monaspace Neon Fallback',
  src: local('Courier New');
  font-style: normal;
  font-weight: 400;
  ascent-override: 91.47%;
  descent-override: 19.36%;
  line-gap-override: 9.68%;
  size-adjust: 103.32%;
}

:root {
  --bg: #08080e;
  --fg: #bbbac1;
  --accent: #e56182;
  --link: var(--accent);
  --muted-fg: #6d6b79;
  --logo: #f20068;
  --transition: 0.3s;
  color-scheme: dark;
}

body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  color: var(--fg);
  background: var(--bg);
  font-size: 100%;
  font-family: "Monaspace Neon", "Monaspace Neon Fallback", monospace;
  line-height: 1.3;
}

/* chromium insists on smooth scroll on first open otherwise */
@keyframes enable-smooth-scroll {
  0% {
    scroll-behavior: auto;
  }
  100% {
    scroll-behavior: smooth;
  }
}

body, html {
  scroll-behavior: smooth;
  animation: enable-smooth-scroll 1ms linear;
}

.blog-name {
  color: #fff;
  display: inline-block;
  font-family: "Playwrite Norge";
  font-size: 2.5rem;
  padding: 1rem;
  text-shadow:
    0 0 0.1em #fff,
    0 0 0.2em #fff,
    0 0 0.7em var(--logo),
    0 0 1.9em var(--logo),
    0 0 2.1em var(--logo),
    0 0 2.4em var(--logo);
  transform: rotate(-10deg);
}

@media not (prefers-reduced-motion) {
  .blog-name:hover {
    animation: neon-glitch 2s ease-in-out;
  }
}

@keyframes neon-glitch {
  0%, 17%, 40%, 57%, 70%, 77%, 90%, 100% {
    color: #fff;
    text-shadow:
      0 0 0.1em #fff,
      0 0 0.2em #fff,
      0 0 0.7em var(--logo),
      0 0 1.9em var(--logo),
      0 0 2.1em var(--logo),
      0 0 2.4em var(--logo);
  }
  20%, 60%, 80% {
    color: var(--fg-muted);
    text-shadow: none;
  }
}

#nojs {
  visibility: hidden;
}

.about {
  margin-right: 2em;
  display: flex;
  flex-direction: column;
  text-align: right;
  align-self: center;
}

.about a {
  color: var(--accent);
  text-decoration: dotted underline;
}

header {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 2em;
}

main {
  max-width: min(75ch, 90vw);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.5em;
}

.feed-post {
  margin-bottom: 2.5lh;
}

h1, .feed-post > a > h2 {
  margin-bottom: 0.2lh;
}

a {
  color: var(--link);
  transition: text-shadow var(--transition);
}

a:hover {
  text-shadow: 0 0 0.5em var(--link);
}

a.heading-link {
  color: var(--fg);
  text-decoration: none;
}

a.heading-link:hover {
  text-shadow: none;
}

a.heading-link > ::before {
  transition: color var(--transition), text-shadow var(--transition);
}

a.heading-link:hover > ::before {
  color: var(--link);
  text-shadow: 0 0 0.5em var(--link);
}

.feed-post > a.heading-link > ::before {
  color: var(--accent);
}

strong {
  color: var(--accent);
  text-shadow: 0 0 0.5em var(--accent);
  font-weight: normal;
}

code, pre {
  font-family: "Monaspace Neon", "Monaspace Neon Fallback", monospace;
}

@media (min-width: 85ch) {
  code {
    white-space: nowrap;
  }
}

@media not (min-width: 85ch) {
  code {
    word-break: break-word;
  }
}

pre > code {
  white-space: pre;
}

pre > code span {
  font-style: normal !important;
}

code::before, code::after {
  content: "`";
  color: var(--muted-fg);
}

pre:has(code) {
  overflow-x: auto;
  background-color: var(--bg) !important;
  scrollbar-color: var(--muted-fg) rgba(0,0,0,0);
  scrollbar-width: thin;
}

pre:has(code)::before {
  content: "```";
  color: var(--muted-fg);
}

pre > code::before {
  content: attr(data-lang);
  color: var(--accent);
}

pre > code:not([data-lang]) {
  display: block;
}

pre > code::after {
  content: "```";
  color: var(--muted-fg);
}

blockquote {
  margin-left: 0;
  border-left: 3px solid var(--accent);
  padding-left: calc(2ch - 3px);
}

table {
  margin-left: auto;
  margin-right: auto;
  margin-top: 1em;
  margin-bottom: 1em;
  border-collapse: collapse;
  border-style: hidden;
}

th {
  padding-left: 0.5em;
  padding-right: 0.5em;
}

th, td {
  border: 1px solid var(--muted-fg);
  padding-left: 0.5em;
  padding-right: 0.5em;
  padding-top: 0.2em;
  padding-bottom: 0.2em;
}

.td-center {
  text-align: center;
}

ul, ol {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
  counter-reset: list-counter;
}

ul > li::before, ol > li::before {
  float: left;
  margin-right: 1ch;
}

ul > li::before {
  content: "—";
}

ol > li::before {
  counter-increment: list-counter;
  content: counter(list-counter) ".";
}

li ol, li ul {
  margin-left: 3ch;
}

h1::before {
  content: "# ";
  color: var(--muted-fg);
}

h2::before {
  content: "## ";
  color: var(--muted-fg);
}

h3::before {
  content: "### ";
  color: var(--muted-fg);
}

h4::before {
  content: "#### ";
  color: var(--muted-fg);
}

img, object {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* vim: set ts=2 sw=2 et */
