*,
*:before,
*:after {
  box-sizing: border-box;
  margin: 0;
}

:root {
  font-size: 15px;
  --text-ratio: 1.2;
  --text-3: 1rem;
  --text-2: calc(1rem / var(--text-ratio));
  --text-1: calc(var(--text-2) / var(--text-ratio));
  --text-4: calc(1rem * var(--text-ratio));
  --text-5: calc(var(--text-4) * var(--text-ratio));
  --text-6: calc(var(--text-5) * var(--text-ratio));
  --text-7: calc(var(--text-6) * var(--text-ratio));
  --text-8: calc(var(--text-7) * var(--text-ratio));
  --bg: hsl(30, 20%, 98%);
  --logo: #d6f1ff;
  --theme-h: 180;
  --shift: 5;
  --theme: hsl(var(--theme-h), 100%, 25%);
  --theme-light: hsl(
    calc(var(--theme-h) + var(--shift)),
    100%,
    calc(25% + var(--shift) * 1%)
  );
  --theme-dark: hsl(
    calc(var(--theme-h) - var(--shift)),
    100%,
    calc(25% - var(--shift) * 1%)
  );
  --text-dark: #344;
  --theme-white: #fff;
  --theme-black: #111;
  --link: var(--theme);
  --text: var(--text-dark);
  --highlight: rgba(0, 0, 0, 0.1);
  --lighter: #666;
  --width: 50rem;
  --padded-column: calc(var(--width) + 4rem);
  --font-stack: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui,
    helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial,
    sans-serif;
  --icon-brightness: 100%;
  --icon-saturation: 100%;
}

@media screen and (min-width: 600px) {
  :root {
    font-size: 16px;
    --text-ratio: 1.3;
  }
}

html {
  background: var(--theme-light);
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-stack);
  line-height: 1.6em;
  border: 1em solid var(--theme-light);
  margin-bottom: calc(1em + env(safe-area-inset-bottom) * 1.5);
  min-height: 100vh;
  border-radius: 2rem;
}

header {
  margin: 3rem auto;
  max-width: var(--padded-column);
  padding: 0 2rem;
  display: grid;
  grid-template-columns: auto 1fr;
}

header h1 {
  font-size: var(--text-8);
  margin: 0;
  line-height: 1.1;
  align-self: center;
}

.header__tagline {
  grid-column: 1/3;
  font-weight: 400;
  position: relative;
  text-align: center;
  margin-top: 0.5rem;
}

@media screen and (min-width: 600px) {
  .header__tagline {
    margin-top: 0;
    grid-column: 2;
    padding-left: 2rem;
    text-align: left;
  }
}

footer {
  margin: 2rem auto 0;
  border-top: 2px dotted teal;
  padding: 2rem;
  max-width: var(--padded-column);
  display: grid;
  grid-gap: 1em;
}

.do-we-still-call-this-a-blogroll {
  display: flex;
  flex-wrap: wrap;
  list-style-type: none;
  padding: 0;
}

.do-we-still-call-this-a-blogroll li:not(:first-child):before {
  content: "•";
  margin: 0 0.5em;
}

.logo-icon {
  display: block;
  font-size: var(--text-7);
  height: 1.5em;
  width: 1.5em;
  margin-right: 0.5em;
  border-radius: 100%;
  box-shadow: inset 0 0 0.25rem rgba(0, 0, 0, 0.1);
  vertical-align: middle;
  background-color: var(--logo);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--header-weight, 600);
  line-height: 1.4;
  color: var(--text-header, var(--text));
  text-wrap: balance;
}

strong {
  font-weight: 600;
}

h1 {
  font-size: var(--text-6);
}

h2 {
  font-size: var(--text-5);
}

h3 {
  font-size: var(--text-4);
}

h4 {
  font-size: var(--text-3);
}

h5 {
  font-size: var(--text-2);
}

h6 {
  font-size: var(--text-1);
}

.title {
  font-size: var(--text-7);
}

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

article,
.fullbg {
  display: grid;
  grid-template-columns: minmax(1rem, 1fr) minmax(auto, var(--width)) minmax(
      1rem,
      1fr
    );
  grid-row-gap: 2em;
  overflow-x: hidden;
}

@media screen and (min-width: 600px) {
  article,
  .fullbg {
    grid-template-columns: minmax(2rem, 1fr) minmax(auto, var(--width)) minmax(
        2rem,
        1fr
      );
  }
}

.cta-link:after {
  text-decoration: none;
  width: 1.5em;
  height: 1.25em;
  margin-left: 0.5rem;
  color: currentColor;
  display: inline-block;
  content: "";
  background: url(/http/potch.me/img/arrow.svg);
  filter: saturate(0%) invert(100%) brightness(200%);
  background-size: 1.25em;
  background-repeat: no-repeat;
  background-position: left center;
  vertical-align: text-bottom;
}

article > *,
.fullbg > * {
  grid-column: 2;
  margin-top: 0;
  margin-bottom: 0;
}

article > *:first-child {
  margin-top: 0;
}

article img {
  display: block;
  max-height: 90vh;
  object-fit: contain;
  max-width: 100%;
  margin: 0 auto;
}

article table {
  border: 1px solid var(--lighter);
}

article tr:nth-child(even),
article thead tr {
  background: var(--highlight);
}

article td,
article th {
  padding: 0.25rem 0.5rem;
}

section {
  margin: 0;
}

section h2 {
  margin: 0;
}

figure {
  margin: 2em 0;
}

figcaption {
  font-size: 0.8em;
  text-align: center;
  font-style: italic;
}

.video-frame {
  border: 0 none;
  display: block;
  margin: 0 auto;
  width: 100%;
  aspect-ratio: 16/9;
}

.present {
  width: 100%;
  max-width: 1200px;
  height: 70vh;
  height: 70svh;
  max-height: var(--prefer-height, 600px);
  border: 0 none;
  display: block;
  margin: 0 auto;
}

.present--frame {
  border: 2px solid teal;
  box-shadow: 0.5rem 0.5rem rgba(0, 0, 0, 0.75);
}

blockquote {
  padding-left: 1em;
  margin: 1em 0;
  border-left: 0.2em solid currentColor;
  font-size: 1rem;
}

blockquote > *:first-child {
  margin-top: 0.5em;
}

blockquote > *:last-child {
  margin-bottom: 0.5em;
}

ul,
ol {
  margin: 1em 0;
  padding-left: 2em;
}

li > p {
  margin: 0;
}

header h1 a {
  color: var(--text);
  text-decoration: none;
}

header h1 a:hover {
  text-decoration: underline;
}

code {
  background: var(--highlight);
  font-size: calc(1em / var(--text-ratio));
  padding: 0.25em;
}

pre {
  background: var(--highlight);
  line-height: 1;
  padding: 0.5em;
  margin: 1em 0;
}

pre code {
  font-size: var(--text-2);
}

pre.pretty-code {
  grid-column: 1 / -1;
  padding-inline: 1rem !important;
  margin-inline: 0 !important;
  border-radius: 0 !important;
}

pre.pretty-code code {
  padding: 0;
}

@media screen and (min-width: 600px) {
  pre.pretty-code {
    grid-column: 2;
    padding: 1rem !important;
    border-radius: 0.3em !important;
    margin-inline: -1rem !important;
  }

  pre.pretty-code code {
    font-size: var(--text-2);
  }
}

.full,
.fullbg,
.fullpad,
.twocol {
  grid-column: 1 / 4;
}

.fullbg {
  padding: 1em 0;
}

.fullpad {
  padding: 1em;
}

.centered {
  text-align: center;
}

.center {
  margin-inline: auto;
}

.twocol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
}

.meta {
  font-size: var(--text-2);
  margin: 0;
  color: var(--lighter);
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: start;
}

.meta__tag {
  margin-left: 1em;
}

.post-preview {
  margin-top: 2em;
}

.post-preview + .post-preview {
  border-top: 1px solid var(--highlight);
  padding-top: 2em;
}

.post-preview__title {
  text-wrap: balance;
}

.post-preview > * + * {
  margin-top: 1rem;
}

.post-preview__banner {
  display: block;
}

.post-preview__go {
  text-decoration: none;
  overflow: hidden;
  text-indent: -9999px;
  width: 1.5em;
  height: 1.25em;
  display: inline-block;
  background: url(/http/potch.me/img/arrow.svg);
  filter: hue-rotate(calc(var(--theme-h) * 1deg))
    brightness(var(--icon-brightness)) saturate(var(--icon-saturation));
  background-size: 1.25em;
  background-repeat: no-repeat;
  background-position: left center;
  vertical-align: text-bottom;
}

.post-preview__go:hover {
  background-position: right center;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2rem;
  font-size: var(--text-3);
  text-decoration: none;
  text-align: center;
  border-radius: 1rem;
  padding: 0 1.5rem;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.5);
  background: var(--pill-bg, var(--theme-light));
  color: var(--pill-txt, #fff);
}
.pill:link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.4);
}

.elsewhere {
  margin-top: 2em;
  position: relative;
  display: flex;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  justify-content: center;
  flex-wrap: wrap;
  gap: 1em;
}

.elsewhere__link {
  flex: 1 1 100px;
  max-width: 20%;
  min-width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2rem;
  font-size: var(--text-3);
  text-decoration: none;
  text-align: center;
  border-radius: 1rem;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.5);
}

.social-embed {
  background: var(--theme-white);
  border: 1px solid var(--lighter);
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 1rem;
}

.social-embed__ident {
  display: grid;
  gap: 0 1rem;
  color: inherit;
  text-decoration: none;
  grid-template:
    "avatar display site" auto
    "avatar username site" auto
    / 48px 1fr auto;
}

.social-embed__body {
  font-size: var(--text-4);
  margin: 0.5rem 0;
}

.social-embed__meta {
  font-size: var(--text-2);
}

.social-embed__meta a {
  text-decoration: none;
  color: inherit;
}

.social-embed__avatar {
  grid-area: avatar;
  aspect-ratio: 1/1;
  border-radius: 4px;
}

.social-embed__site {
  grid-area: site;
  font-size: var(--text-2);
  color: var(--lighter);
}

.social-embed__username {
  font-size: var(--text-2);
  grid-area: username;
}

.social-embed__display {
  grid-area: display;
  font-weight: bold;
}

.social-embed__media {
  grid-area: media;
}

.tag-list {
  font-size: var(--text-2);
  margin-top: 0.5rem;
}
.tag-list__tag {
  margin-inline-end: 0.5rem;
  white-space: nowrap;
}

.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: auto;
  list-style-type: none;
  gap: 1rem;
  padding: 0;
  align-items: stretch;
}
.projects li {
  position: relative;
}
@media screen and (max-width: 512px) {
  .projects {
    grid-template-columns: 1fr;
  }
}
.project {
  display: grid;
  text-decoration: none;
  height: 100%;
  gap: 0.5rem;
  border-radius: 1rem;
  padding: 1rem;
  background: var(--card-bg, #fff);
  color: var(--card-txt, var(--text-dark));
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  align-content: start;
}
.project a {
  aspect-ratio: 2/1;
  display: flex;
  text-align: right;
  align-items: flex-end;
  justify-content: end;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  text-wrap: balance;
}
.projects li:has(img) {
  grid-row: span 3;
}
.project img {
  display: block;
  margin: -1rem -1rem 0.25rem;
  max-width: unset;
  aspect-ratio: 5/3;
  object-fit: cover;
  width: calc(100% + 2rem);
}
.project h3 {
  color: inherit;
  font-size: var(--text-4);
}
.project:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.4);
}

@media screen and (min-width: 65rem) {
  header {
    transform: translateX(calc(-2 * var(--text-7)));
  }

  .wide {
    width: calc(100% + 9.76rem);
    transform: translateX(-4.88rem);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c2040;
    --text: #eed;
    --logo: var(--theme-light);
    --link: lightcyan;
    --lighter: #aaa;
    --theme-white: #111;
    --theme-black: #eee;
    --highlight: rgba(255, 255, 255, 0.1);
    --icon-saturation: 20%;
    --icon-brightness: 300%;
  }
}
