:root {
  --color: #ece9e0;
  --accent: oklch(0.6726 0.2341 351.99);
  --unaccent: #404040; /* FIXME: call this something else; choose the color more thoroughly */
  /* FIXME: I don't like this color... */
  --code: #0d120e;
  --background: #000300;
  --max-width: 864px;
  --button-scale: 2;
}

@font-face {
  font-family: "AtkinsonHyperlegibleNext";
  src:
    local("AtkinsonHyperlegibleNext"),
    url("/font/AtkinsonHyperlegibleNext-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "AtkinsonHyperlegibleMono";
  src:
    local("AtkinsonHyperlegibleMono"),
    url("/font/AtkinsonHyperlegibleMono-Regular.woff2") format("woff2");
}

* {
  box-sizing: border-box;
}

body {
  color: var(--color);
  font: 14.5pt AtkinsonHyperlegibleNext;
  background-color: var(--background);
  line-height: 1.5;
  accent-color: var(--accent);

  /* min-height so that footer is always at the bottom;
     replacing margin with padding so that min-height doesn't create unnecessary scrolling */
  min-height: 100svh;
  margin: 0;
  padding: 8px;

  display: grid;
  /*                  header   main footer*/
  grid-template-rows: /*auto*/ 1fr  auto;
  grid-template-columns: 100%;
}

time, span.separator {
  font-family: AtkinsonHyperlegibleMono;
}

.left-right {
  display: flex;
  gap: 20px;
  align-items: center;
}

main, body > section {
  padding: 10px;
  max-width: var(--max-width);
  /* margin-left: auto; */
  /* justify-self: */
  justify-self: center;
  align-self: start;
}

@media (max-width: 500px) {
  main { padding: 10px; }
  ul.post-list .date { display: none; }
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--background);
  background-color: var(--accent);
}

code {
  /* FIXME: Iosevka? */
  font-family: AtkinsonHyperlegibleMono;
  background: var(--code);
}

/* FIXME: is there a less worse way to do this? >_> */
:not(pre) > code {
  border-radius: 3px;
  border: solid 1px #2b2b33;
  padding: 1px 2px;  
  color: var(--accent);
}

pre {
  background: #0A0A0A;
  border-radius: 3px;
  padding: 10px;
}

pre > code {
  display: block;
  background: none;
  overflow: auto;
}

ul {
  list-style-type: "- ";
}

ul {
  padding-left: 24px;
}

footer {
  bottom: 0;
  text-align: center;
}

footer > style {
  display:block;

  max-width: var(--max-width);
  border: 1px solid var(--accent);
  border-radius: 4px;
  text-align: left;
  margin: 0 auto;

  /* without this firefox doesn't allow you to actually edit the styles... idk */
  white-space: break-spaces;
}

main > p:has(img:only-child) {
  text-align:center;
}
main > p > img {
  border-radius: 8px;
  width: 90%;
  height: auto;
  margin: auto;
}

h2, h3, h4, h5, h6, ul, ol {
  margin: 10px 0 10px 0;
}

.button {
  display: inline-block; /* otherwise <a> bounding box is weird (smaller than the <img> inside */
  background: none !important; /* otherwise hovering semi-transparent buttons is weird */
                               /* it kinda looks cool sometimes though,,,*/
}

.button img {
  image-rendering: pixelated;
  vertical-align: bottom; /* https://stackoverflow.com/a/31445364 */
  width: calc(88px * var(--button-scale));
  height: calc(31px * var(--button-scale));
}

.buttons {
  display:grid;
  gap: 2px;
  justify-content:center;
  grid-template-columns:repeat(auto-fill,calc(88px * var(--button-scale)));
}
 
/* FIXME: there must be a better way lol :sob: */
.buttons {
  --display-animated: initial;
  --display-still: none;
}

.buttons:has(~ p #reduce-motion:checked) {
    --display-animated: none;
    --display-still: initial;
}
  
@media (prefers-reduced-motion) {
  .buttons {
    --display-animated: none;
    --display-still: initial;
  }
}

.button img.animated {
    display: var(--display-animated);
}
.button img.still {
    display: var(--display-still);
}

.buttons:hover .button img.animated {
    display: initial;
}
.buttons:hover .button img.still {
    display: none;
}

div.quote {
  border-left: 1px solid var(--accent);
  margin-left: 8px;
}
blockquote {
  margin-bottom: 8px;
  margin-left: 20px;
}
blockquote ~ p {
  text-align: right;
  margin-top: 8px;
}

footer > .buttons {
  --button-scale: 1;
  max-width: var(--max-width);
  margin: 0 auto;
}

div.callout {
  display: flex;
  width: 100%;
  border-radius: 6px;
  border-width: 1px;
  border-style: solid;
  border-color: rgba(0,0,0,0);
  background: var(--accent);
  padding: 16px 16px 16px 12px;
  margin-bottom: 20px;
}

div.callout > img {
  width: 16px;
  height: 16px;
  display: flex;
  margin: 4px;
}

div.callout > span {
  margin-left: 8px;
}

.talk-location {
  color: var(--unaccent);
}

abbr {
  cursor: help;
}
