:root {
  --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji";
  --text-primary: rgba(0, 0, 0, 1);
  --text-secondary: rgba(129, 129, 129, 1);
  --bg-primary: rgba(255, 255, 255, 1);
  --bg-secondary: rgba(248, 248, 248, 1);
  --border: rgba(0, 0, 0, 0.1);
  --red: #ff0000;
  --red-orange: #ff2400;
  --hot-orange: #ff4a00;
  --orange: #ff7300;
  --brown: #736455;
  --warm-yellow: #ffdc00;
  --yellow: #fff400;
  --light-yellow: #ffffa8;
  --ocean-green: #008f5a;
  --sunset-pink: #ff7487;
  --light-pink: #ffacb6;
  --xlight-pink: #ffd6dd;
  --font-size-small: 12px;
  --font-size-regular: 14px;
  --font-size-large: 20px;
  --radius-large: 12px;
  --radius-regular: 8px;
  --radius-small: 4px;
  --spacer-small: 4vh;
  --spacer-medium: 8vh;
  --spacer-large: 16vh;
  --gutter: 8px;
}

@supports (color: color(display-p3 1 1 1)) {
  :root {
    --red: color(display-p3 0.94 0.19 0.04);
    --red-orange: color(display-p3 0.97 0.26 0.11);
    --hot-orange: color(display-p3 1 0.36 0);
    --orange: color(display-p3 0.99 0.49 0.16);
    --brown: color(display-p3 0.44 0.393 0.341);
    --warm-yellow: color(display-p3 1 0.87 0.05);
    --yellow: color(display-p3 1 0.96 0.05);
    --light-yellow: color(display-p3 1 1 0.7);
    --ocean-green: color(display-p3 0 0.55 0.37);
    --sunset-pink: color(display-p3 1 0.495 0.54);
    --light-pink: color(display-p3 1 0.69 0.718);
    --xlight-pink: color(display-p3 1 0.845 0.869);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: rgba(255, 255, 255, 0.9);
    --text-secondary: rgba(255, 255, 255, 0.6);
    --bg-primary: rgba(0, 0, 0, 1);
    --bg-secondary: rgba(25, 25, 25, 1);
    --border: rgba(255, 255, 255, 0.2);
  }
}

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

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  font-family: var(--font-primary);
  font-synthesis: none;
  font-size: var(--font-size-regular);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  font-weight: 400;
}

figure {
  margin: 0;
}

video {
  display: block;
  width: 100%;
  height: auto;
  overflow: hidden;
  border-radius: var(--radius-large);
}

/* Typography */
h1 {
  font-size: var(--font-size-large);
  font-weight: 400;
}

h2,
h3,
h4,
h5,
h6 {
  font-size: var(--font-size-regular);
  font-weight: 500;
}

p {
  margin: 0;
  hyphens: none;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--border);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

a:hover {
  text-decoration-color: var(--text-secondary);
}

button {
  font: inherit;
}

ul {
  margin-bottom: 24px;
  padding: 20px;
  list-style: none;
  color: var(--text-secondary);
}

ul li {
  margin-bottom: 20px;
}

ul li::before {
  display: inline-block;
  width: 1em;
  margin-left: -1em;
  content: "-";
}

hr {
  margin: 5vh 0;
  border: 0;
  border-top: 1px solid var(--border);
}

code {
  padding: 0.2em 0.4em;
  white-space: break-spaces;
  font-size: 85%;
  color: var(--text-primary);
  background: var(--border);
  border-radius: var(--radius-small);
}

blockquote {
  margin: 4vh 0;
  padding: 2vh;
  color: var(--text-secondary);
  font-style: italic;
  background: var(--bg-secondary);
  border-radius: var(--radius-regular);
}

.the-content blockquote p {
  margin: 0;
}

pre,
pre code {
  display: block;
  width: 100%;
  height: auto;
  overflow-x: auto;
  white-space: pre;
  font-family: monospace;
  font-size: var(--font-size-small);
  background: var(--bg-secondary);
  border-radius: var(--radius-small);
}

pre {
  margin: 2vh 0;
  padding: 24px;
}

/* Layout */
.container {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  padding: 0 calc(var(--gutter) * 3);
}

.row {
  display: flex;
  flex-flow: row wrap;
}

.col-100 {
  width: 100%;
  padding: 0 var(--gutter);
}

.full-row-border-top {
  position: relative;
}

.full-row-border-top::before {
  position: absolute;
  top: 0;
  right: var(--gutter);
  left: var(--gutter);
  height: 1px;
  content: "";
  background: var(--border);
}

.hero {
  padding: 12vh 0;
}

/* Controls */
.button {
  display: inline-block;
  cursor: pointer;
  border-radius: 999px;
  text-decoration: none;
}

.button.small {
  padding: 4px 16px;
  font-size: var(--font-size-small);
}

.button.secondary {
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border);
}

.button.secondary:hover {
  background: var(--bg-secondary);
}

.label {
  display: inline-block;
  color: var(--text-primary);
  line-height: 1;
  border-radius: 999px;
}

.label.small {
  padding: 4px 8px;
  font-size: var(--font-size-small);
}

.label.secondary.filled {
  color: var(--text-secondary);
  background: var(--border);
}

/* Stuff */
.stuff-grid {
  --stuff-grid-columns: 2;

  display: grid;
  grid-template-columns: repeat(var(--stuff-grid-columns), minmax(0, 1fr));
  gap: clamp(12px, 1.2vw, 24px);
  width: 100%;
  margin: 0 auto;
  padding: 0 clamp(12px, 2vw, 32px) clamp(32px, 6vh, 80px);
}

.item {
  min-width: 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 180px;
}

.item:hover,
.item:focus-within {
  opacity: 0.8;
}

.item__folder-caption {
  margin-top: 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.item__image-file img,
.other-file {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-small);
}

.item__image-file img {
  display: block;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.other-file {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: var(--font-size-small);
  text-align: center;
  background: var(--bg-secondary);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-small);
}

.item__text-filename {
  min-width: 0;
  padding: 12px;
  overflow-wrap: anywhere;
}

.message {
  grid-column: 1 / -1;
  padding: var(--spacer-medium) 24px;
  color: var(--text-secondary);
  text-align: center;
}

@media screen and (min-width: 680px) {
  .stuff-grid {
    --stuff-grid-columns: 4;
  }
}

@media screen and (min-width: 1024px) {
  .stuff-grid {
    --stuff-grid-columns: 7;
  }
}

@media screen and (min-width: 1360px) {
  .stuff-grid {
    --stuff-grid-columns: 10;
  }
}

@media screen and (min-width: 1800px) {
  .stuff-grid {
    --stuff-grid-columns: 12;
  }
}

.lazy-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 1px;
  padding: var(--spacer-large) 0;
}

.lazy-loader[aria-busy="true"]::after {
  content: "Loading…";
  font-size: var(--font-size-small);
  color: var(--text-secondary);
}

.text-file-content {
  padding: 6vh 0;
}

/* Blog */
.the-content p {
  margin-bottom: 40px;
}

.the-content h1 {
  margin-bottom: 12vh;
}

.the-content h2,
.the-content h3,
.the-content h4,
.the-content h5,
.the-content h6 {
  margin-top: 80px;
}

.the-content img {
  display: block;
  width: 100%;
  height: auto;
  margin: 6vh 0;
  overflow: hidden;
  border-radius: var(--radius-small);
}

.blog-list-item {
  display: block;
  padding: 0.8vh 0;
  text-decoration: none;
}

.blog-list-item__title {
  text-decoration-line: underline;
  text-decoration-color: var(--border);
  font-weight: 500;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.blog-list-item__date {
  margin-left: 2px;
  white-space: nowrap;
  font-size: var(--font-size-small);
}

.blog-list-item:hover .blog-list-item__title {
  text-decoration-color: var(--text-secondary);
}

.post-chapter {
  padding: 1vh 0;
  border-bottom: 1px solid var(--border);
}

/* Image lightbox */
.zoomlightbox-trigger {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  cursor: zoom-in;
  color: inherit;
  background: transparent;
  border: 0;
}

.zoomlightbox-container {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: zoom-out;
  text-align: center;
  background: var(--bg-secondary);
}

.zoomlightbox-image {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  width: auto;
  max-width: 520px;
  height: auto;
  max-height: 520px;
  transform: translate(-50%, -50%);
}

.zoomlightbox-image-name,
.close-zoomlightbox {
  position: absolute;
  left: 50%;
  width: 320px;
  margin-left: -160px;
  font-size: var(--font-size-small);
  text-align: center;
}

.zoomlightbox-image-name {
  top: 15px;
}

.close-zoomlightbox {
  bottom: 15px;
  cursor: pointer;
}

/* Utilities */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auto-margins {
  margin: auto;
}

.fluid-img {
  display: block;
  width: 100%;
  height: auto;
}

.show-on-desktop-only {
  display: block;
}

.show-on-mobile-only {
  display: none;
}

.border-all-around {
  border: 1px solid var(--border);
}

.border-top {
  border-top: 1px solid var(--border);
}

.border-bottom {
  border-bottom: 1px solid var(--border);
}

.bg-primary {
  background-color: var(--bg-primary);
}

.bg-secondary {
  background-color: var(--bg-secondary);
}

.text-color-primary {
  color: var(--text-primary);
}

.text-color-secondary {
  color: var(--text-secondary);
}

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

.text-align-left {
  text-align: left;
}

.text-align-right {
  text-align: right;
}

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

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

.text-large {
  font-size: var(--font-size-large);
  line-height: 1.4;
}

.no-margin {
  margin: 0;
}

.no-margin-top {
  margin-top: 0;
}

.no-margin-bottom {
  margin-bottom: 0;
}

.large-margin-bottom {
  margin-bottom: var(--spacer-large);
}

.large-margin-top {
  margin-top: var(--spacer-large);
}

.medium-margin-bottom {
  margin-bottom: var(--spacer-medium);
}

.medium-margin-top {
  margin-top: var(--spacer-medium);
}

.small-margin-bottom {
  margin-bottom: var(--spacer-small);
}

.small-margin-top {
  margin-top: var(--spacer-small);
}

.no-padding {
  padding: 0;
}

.no-padding-top {
  padding-top: 0;
}

.no-padding-bottom {
  padding-bottom: 0;
}

.large-padding-bottom {
  padding-bottom: var(--spacer-large);
}

.large-padding-top {
  padding-top: var(--spacer-large);
}

.medium-padding-bottom {
  padding-bottom: var(--spacer-medium);
}

.medium-padding-top {
  padding-top: var(--spacer-medium);
}

.small-padding-bottom {
  padding-bottom: var(--spacer-small);
}

.small-padding-top {
  padding-top: var(--spacer-small);
}

.padded-section {
  padding: var(--spacer-large) 0;
}

@media screen and (max-width: 821px) {
  .show-on-desktop-only {
    display: none;
  }

  .show-on-mobile-only {
    display: block;
  }

  .zoomlightbox-image {
    max-width: 90%;
    max-height: 60%;
  }
}
