/***
* 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;
}
/* === Raw Color Palette === */
/* Not themed. Don't use these directly in components. */
:root {
  /* Hues */
  --hue-purple: 280;
  --hue-orange: 30; /* approx for darkorange */

  /* Brand Colors (kept for reference) */
  --brand-orange: hsl(var(--hue-orange), 100%, 50%); /* darkorange */
  --social-mastodon: #8373e7;
  --tag: var(--brand-orange);

  /* 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;
}


/* === Themes === */

/* --- Light Theme (Default) --- */
:root {
  --bg: hsl(var(--hue-purple), 20%, 98%);
  --text: hsl(var(--hue-purple), 15%, 15%);
  --accent: hsl(var(--hue-purple), 70%, 55%);
  --border-subtle: hsl(var(--hue-purple), 20%, 90%);
  --border-strong: hsl(var(--hue-purple), 15%, 40%);

  --link: var(--accent);
  --link-visited: hsl(var(--hue-purple), 30%, 45%);
  --link-active: hsl(var(--hue-purple), 80%, 65%);

  --blockquote-bg: hsl(var(--hue-purple), 20%, 95%);
  --blockquote-text: hsl(var(--hue-purple), 15%, 35%);
  --table-header-bg: hsl(var(--hue-purple), 20%, 92%);
  --table-row-stripe-bg: hsl(var(--hue-purple), 20%, 96%);
}

/* --- Dark Theme --- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: hsl(var(--hue-purple), 15%, 10%);
    --text: hsl(var(--hue-purple), 25%, 85%);
    --accent: hsl(var(--hue-purple), 80%, 75%);
    --border-subtle: hsl(var(--hue-purple), 15%, 20%);
    --border-strong: hsl(var(--hue-purple), 25%, 70%);

    --link: var(--accent);
    --link-visited: hsl(var(--hue-purple), 50%, 80%);
    --link-active: hsl(var(--hue-purple), 90%, 85%);

    --blockquote-bg: hsl(var(--hue-purple), 15%, 15%);
    --blockquote-text: hsl(var(--hue-purple), 25%, 70%);
    --table-header-bg: hsl(var(--hue-purple), 15%, 20%);
    --table-row-stripe-bg: hsl(var(--hue-purple), 15%, 12%);
  }
}
/* 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:last-child {
  margin-bottom: 0;
}
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;
  border-top: 1px dashed var(--border-subtle);
  padding: 1em 0;
}
.links-nextprev > * {
  flex-grow: 1;
}
.links-nextprev-next {
  text-align: right;
}

table {
  width: 100%;
  margin: 2em 0;
  border-collapse: collapse;
  text-align: left;
}

table th,
table td {
  padding: 0.75em 1em;
  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: 1em;
  width: 1em;
  /* display: inline-block; */
}

/* -- Selection Styles -- */
::selection {
  background-color: var(--accent);
  color: var(--bg);
}/* @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);
}

blockquote {
  margin-inline: 2em;
  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;
  /* gap: 1em; */
  /* flex-wrap: wrap; */
  justify-content: space-between;
  align-items: center;
  padding-block: 1rem;
}
.home-link {
  flex-grow: 1;
  font-size: var(--step-1);
  font-weight: 700;
  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: 600;
}
.social-links a[href="/feed/feed.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);
}
/* Nav */
.nav {
  display: flex;
  gap: 0.75rem;
  padding: 0;
  margin: 0;
  list-style: none;
  flex-wrap: wrap;
}
.nav-item {
  /* display: inline-block; */
  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(--brand-orange);
}
.nav-item[href]:not(:hover) {
  text-decoration: none;
}
.nav a[href][aria-current="page"] {
  /* text-decoration: underline; */
  transform: translateY(-2px) translateX(-2px);
  box-shadow: 6px 10px rgba(0, 0, 0, 0.15);
  border-style: solid;
  border-color: var(--brand-orange);
}
.main-nav {
  width: 100%;
  border-bottom: 1px dashed var(--border-subtle);
  padding-block-end: 1rem;
}
/* Posts list */
.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);
}
.postlist-date {
  word-spacing: -0.5px;
}
.postlist-link {
  /* font-size: 1.1875em; */
  font-weight: 700;
  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;
}

/* Tags */
.post-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: capitalize;
  font-style: italic;
}
.postlist-item > .post-tag {
  align-self: center;
}

/* Tags list */
.post-metadata {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5em;
  list-style: none;
  padding: 0;
  margin: 0;
}
.post-metadata time {
  margin-right: 1em;
}
/* Projects */
.project-metadata {
  border: 1px dashed var(--border-subtle);
  border-radius: 5px;
  padding: 1em;
}
.projectlist {
  list-style-type: none;
  padding: 0;
}
.projectlist .projectlist-item:not(:last-child) {
  margin-bottom: 1em;
}
.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);
  font-weight: bold;
}

.projectlist-description {
  color: var(--text);
}

.projectlist-icon-container {
  flex-shrink: 0;
  font-size: 2.5em;
  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: "#";
}
footer {
  border-top: 1px dashed var(--border-subtle);
  padding-block: 1em;
  margin-block-start: 3em;
}
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);
  }
  main img {
    max-width: 100vw;
    transform: translateX(-1rem);
  }
  .projectlist-description {
    font-size: var(--step--1);
  }
  .projectlist-link {
    margin-block-end: 0.5em;
  }
  footer svg:has(use) {
    width: 1.25em;
    height: 1.25em;
  }
  .desktop-only {
    display: none;
  }
  .nav {
    gap: 0.5rem;
  }
  .social-links a {
    padding: 0.25rem;
  }

  /* Make tables scrollable on small screens */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}