/***
* CSS Reset
* Based on the modern CSS reset by Andy Bell
* https://piccalil.li/blog/a-modern-css-reset/
***/

/* Box sizing rules */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Prevent font size inflation */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* Remove default margin in favour of better control in authored CSS */
/* body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin-block-end: 0;
} */

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role="list"],
ol[role="list"] {
  list-style: none;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  line-height: 1.5;
}

/* Set shorter line heights on headings and interactive elements */
h1,
h2,
h3,
h4,
button,
input,
label {
  line-height: 1.1;
}

/* Balance text wrapping on headings */
h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
  color: currentColor;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
}

/* Make sure textareas without a rows attribute are not tiny */
textarea:not([rows]) {
  min-height: 10em;
}

/* Anything that has been anchored to should have extra scroll margin */
:target {
  scroll-margin-block: 5ex;
}
:root {
  /* Font Families & Syntax */
  --font-family: -apple-system, system-ui, sans-serif;
  --font-family-monospace: Consolas, Menlo, Monaco, Andale Mono WT, Andale Mono,
    Lucida Console, Lucida Sans Typewriter, DejaVu Sans Mono,
    Bitstream Vera Sans Mono, Liberation Mono, Nimbus Mono L, Courier New,
    Courier, monospace;
  --syntax-tab-size: 2;

  --brand-orange: #f08a42;
  --social-mastodon: #8373e7;
  --tag: var(--brand-orange);

  --bg: #f8f6f2;
  --text: #301e0e;
  --accent: #c54a20;
  --border-subtle: #a7a29b;
  --border-strong: #a6593f;

  --link-visited: #5c3770;
  --link: #275d27;
  --link-active: #662512;

  --blockquote-bg: #f2efe8;
  --blockquote-text: #5d3d32;
  --table-header-bg: #f1ece2;
  --table-row-stripe-bg: #f4f1eb;

  --text-heading: #bd4d28;
  --text-muted: #5c5137;
  --text-emphasis: #3fa63f;
}

/* --- Dark Theme --- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10141b;
    --text: #e9e2d7;
    --accent: #e88f63;
    --border-subtle: #4b566e;
    --border-strong: #d18661;

    --link-visited: #b990d6;
    --link: #7dcd8a;
    --link-active: #ff9b4f;

    --blockquote-bg: #191f2b;
    --blockquote-text: #dfd3c3;
    --table-header-bg: #1e2430;
    --table-row-stripe-bg: #131720;

    --text-heading: #f0a07e;
    --text-muted: #bca98f;
    --text-emphasis: #8cd899;
  }
}
/* 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);
  background-color: var(--bg);
}
html {
  overflow-y: scroll;
  overflow-x: hidden;
}
body {
  max-width: min(80ch, 100% - 4rem);
}

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

/* Fluid images via https://www.zachleat.com/web/fluid-images/ */
img {
  max-width: 100%;
}
img[width][height] {
  height: auto;
}
img[src$=".svg"] {
  width: 100%;
  height: auto;
  max-width: none;
}
video,
iframe {
  width: 100%;
  height: auto;
}
iframe {
  aspect-ratio: 16/9;
}

p {
  line-height: 1.5;
}

li {
  line-height: 1.5;
}

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

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

/* Prevent visually-hidden skip link fom pushing content around when focused */
#skip-link.visually-hidden:focus {
  position: absolute;
  top: 1rem;
  left: 1rem;
  /* Ensure it is positioned on top of everything else when it is shown */
  z-index: 999;
}

.links-nextprev {
  display: flex;
  justify-content: space-between;
  gap: 0.5em 1em;
  list-style: none;
  padding: 0;
}
.links-nextprev > * {
  flex-grow: 1;
}
.links-nextprev-next {
  text-align: right;
}

table {
  width: 100%;
  margin: 2rem 0;
  border-collapse: collapse;
  text-align: left;
}

table th,
table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

table th {
  background-color: var(--table-header-bg);
  font-weight: bold;
}

table tbody tr:nth-child(even) {
  background-color: var(--table-row-stripe-bg);
}

pre,
code {
  font-family: var(--font-family-monospace);
}
pre:not([class*="language-"]) {
  margin: 0.5em 0;
  line-height: 1.375; /* 22px /16 */
  -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;
}
code {
  word-break: break-all;
}

/* Prose */

.prose img {
  margin-inline: auto;
}

/* Font Awesome */
svg:has(use) {
  height: 1rem;
  width: 1rem;
}

/* -- Selection Styles -- */
::selection {
  background-color: var(--link-visited);
  color: var(--bg);
}

hr {
  border: none;
  border-top: 1px dashed var(--border-subtle);
  margin: 2rem 0;
}

.post-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.subtitle {
  font-style: italic;
  color: var(--text-muted);
}
/* @link https://utopia.fyi/type/calculator?c=360,16,1.2,1240,18,1.25,5,2,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l&g=s,l,xl,12 */

:root {
  --step--2: clamp(0.6944rem, 0.684rem + 0.0465vw, 0.72rem);
  --step--1: clamp(0.8333rem, 0.8061rem + 0.1212vw, 0.9rem);
  --step-0: clamp(1rem, 0.9489rem + 0.2273vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.1156rem + 0.375vw, 1.4063rem);
  --step-2: clamp(1.44rem, 1.31rem + 0.5778vw, 1.7578rem);
  --step-3: clamp(1.728rem, 1.536rem + 0.8532vw, 2.1973rem);
  --step-4: clamp(2.0736rem, 1.7983rem + 1.2236vw, 2.7466rem);
  --step-5: clamp(2.4883rem, 2.1018rem + 1.718vw, 3.4332rem);
}

h1 {
  font-size: var(--step-4);
}
h2 {
  font-size: var(--step-3);
}
h3 {
  font-size: var(--step-2);
}
h4 {
  font-size: var(--step-1);
}
h5 {
  font-size: var(--step-0);
}
h6 {
  font-size: var(--step--1);
}
body {
  font-size: var(--step-0);
}
pre {
  /* eslint-disable-next-line css/no-important */
  font-size: var(--step--1) !important;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
}

blockquote {
  margin-inline: 0;
  padding: 0.5em 1em;
  border-inline-start: 4px solid var(--accent);
  background-color: var(--blockquote-bg);
  color: var(--blockquote-text);
  font-style: italic;
}/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: 1rem;
}
.home-link {
  flex-grow: 1;
  font-size: var(--step-1);
  font-weight: bold;
  align-items: center;
}
.home-link:link:not(:hover) {
  text-decoration: none;
}
.atom {
  width: 1.5em;
  height: auto;
  margin-inline-end: 0.25rem;
}
.the-dot {
  color: var(--brand-orange);
}

.social-links {
  display: flex;
  gap: 1em;
}
.social-links a {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.1rem;
  font-weight: bold;
}
.social-links a[href="/rss.xml"] svg {
  color: var(--brand-orange);
}
.social-links a[href="https://github.com/semanticdata"] svg
{
  color: var(--text);
}
.social-links a[href="https://social.lol/@database"] svg
{
  color: var(--social-mastodon);
}
.social-links-cta {
  display: flex;
  gap: 1em;
}
.social-links-cta a {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.1rem;
  font-weight: bold;
}
.social-links-cta a[href="/rss.xml"] svg {
  color: var(--brand-orange);
}
.social-links-cta a[href="https://github.com/semanticdata"] svg
{
  color: var(--text);
}
.social-links-cta a[href="https://social.lol/@database"] svg
{
  color: var(--social-mastodon);
}
.desktop-only {
  color: var(--text);
}
.desktop-only:hover {
  color: var(--link-active);
}
.desktop-only-cta {
  color: var(--text);
}
.desktop-only-cta:hover {
  color: var(--link-active);
}
/* Nav */
.main-nav {
  width: 100%;
  border-bottom: 1px dashed var(--border-subtle);
  padding-block-end: 1rem;
}
.nav {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.nav-item {
  font-size: var(--step--1);
  border: dashed 1px var(--border-strong);
  border-radius: 5px;
  padding: 0.5rem 0;
  flex: 1 1 auto;
  text-align: center;
}
.nav-item:hover {
  transform: translateY(-2px) translateX(-2px);
  box-shadow: 6px 10px rgba(0, 0, 0, 0.15);
  border-style: solid;
  transition: all 0.2s ease-out;
  text-decoration: none;
  border-color: var(--border-strong);
}
.nav-item[href]:not(:hover) {
  text-decoration: none;
}
.nav a:visited:not(:hover) {
  color: var(--link);
}
.nav a[href][aria-current="page"] {
  transform: translateY(-2px) translateX(-2px);
  box-shadow: 6px 10px rgba(0, 0, 0, 0.15);
  border-style: solid;
  border-color: var(--brand-orange);
  color: var(--accent);
}
/* Posts list */
.post-metadata {
  display: flex;
  flex-direction: column;
  border: 1px dashed var(--border-subtle);
  border-radius: 5px;
  padding: 1rem;
  align-items: center;
  justify-content: center;
}
.post-metadata time {
  color: var(--text-muted);
}

.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-block-end: 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-date,
.postlist-item:before {
  font-size: var(--step--1);
  color: var(--text-muted);
}
.postlist-date {
  word-spacing: -0.5px;
}
.postlist-link {
  font-weight: bold;
  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;
}

.taglist {
  padding-left: 1.5rem;
}

/* Tags */
.post-tag {
  font-style: italic;
}
/* Projects */
.project-metadata {
  display: flex;
  flex-direction: column;
  border: 1px dashed var(--border-subtle);
  border-radius: 5px;
  padding: 1rem;
  align-items: center;
  justify-content: center;
}
.projectlist {
  list-style-type: none;
  padding: 0;
}
.projectlist .projectlist-item:not(:last-child) {
  margin-bottom: 1em;
  padding-block-end: 1rem;
  border-bottom: 1px dashed var(--border-subtle);
}
.projectlist-link {
  display: flex;
  align-items: center;
  gap: 1em;

  border: 1px dashed var(--border-subtle);
  border-radius: 5px;
  width: 100%;
  padding: 1em;
  text-decoration: none;
}
.projectlist-link:hover {
  transform: translateY(-2px) translateX(-2px);
  box-shadow: 6px 10px rgba(0, 0, 0, 0.15);
  border-style: solid;
  transition: all 0.2s ease-out;
}

.projectlist-title {
  color: var(--text);
}

.projectlist-description {
  color: var(--text);
}

.projectlist-icon-container {
  flex-shrink: 0;
  line-height: 1;
}
.projectlist-icon-container > svg {
  color: var(--text);
}

.projectlist-text-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}

.projectlist-tag {
  color: var(--tag);
  font-size: var(--step--1);
}
.projectlist-tag::before {
  content: "#";
}

.projectlist-item {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.projectlist-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}
.projectlist-title svg {
  font-size: var(--step-2);
  flex-shrink: 0;
}
.projectlist-title a {
  text-decoration: none;
}
.projectlist-description {
  margin-bottom: 0.75rem;
}
.projectlist-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.projectlist-links a {
  margin-right: 1rem;
}
.projectlist {
  list-style: none;
  padding-left: 0;
}
footer {
  border-top: 1px dashed var(--border-subtle);
  padding-block: 1em;
  margin-block-start: 2rem;
}
footer p {
  margin-block-start: 0;
}

.footer-links {
  display: flex;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
  justify-content: center;
  margin-block-end: 1em;
}
.footer-gifs {
  display: flex;
  gap: 0.2em;
  justify-content: center;
  flex-wrap: wrap;
}
.footer-gifs img {
  max-width: unset;
}
@media (max-width: 550px) {
  body {
    max-width: min(80ch, 100% - 2rem);
  }
  pre {
    width: 100vw;
    transform: translateX(-1rem);
  }
  .callout pre {
    width: calc(100vw - 2rem);
    transform: translateX(0);
  }
  main img {
    max-width: 100vw;
    transform: translateX(-1rem);
  }
  .projectlist-description,
  .projectlist-metadata {
    font-size: var(--step--1);
  }
  footer svg:has(use) {
    width: 1.25em;
    height: 1.25em;
  }
  .desktop-only {
    display: none;
  }
  .nav {
    gap: 0.5rem;
  }
  .social-links a {
    padding: 0.25rem;
  }
  .social-links-cta {
    display: flex;
    flex-direction: column;
  }

  /* Make tables scrollable on small screens */
  table {
    display: block;
    width: 100vw;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* max-width: 100vw; */
    transform: translateX(-1rem);
    font-size: var(--step--1);
  }
  table th,
  table td {
    padding: 0.5rem;
  }
}