:root {
  --black: 0 0 0;
  --white: 255 255 255;
  --glass-dark: 11 7 18;
  --shader-wave-color: 56 189 248;
  --max-width: 88rem;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow: hidden;
  background: rgb(4 8 17);
  color: rgb(var(--white) / 0.88);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

a {
  color: rgb(var(--white) / 0.92);
  text-decoration-color: rgb(var(--shader-wave-color) / 0.38);
  text-underline-offset: 0.16em;
}

a:hover {
  text-decoration-color: rgb(var(--white) / 0.78);
}

img {
  max-width: 100%;
}

#dither-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgb(var(--shader-wave-color) / 0.08), transparent 30rem),
    linear-gradient(180deg, rgb(11 15 25 / 0.32), rgb(4 8 17 / 0.78));
}

.site-shell {
  width: min(calc(100% - clamp(0.75rem, 2vw, 2.5rem)), var(--max-width));
  margin: 0 auto;
  padding: clamp(0.4rem, 1.5vw, 1rem) 0 clamp(0.4rem, 1.5vw, 1rem);
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(0.45rem, 1.1vw, 0.8rem);
}

.site-header,
.site-footer {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 0.6rem 1rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid rgb(var(--white) / 0.12);
  border-radius: 1rem;
  -webkit-backdrop-filter: blur(26px);
  backdrop-filter: blur(26px);
  background-color: rgb(var(--glass-dark) / 0.35);
  box-shadow:
    inset 0 1px 0 rgb(var(--white) / 0.04),
    0 25px 50px -12px rgb(var(--black) / 0.24);
}

.site-header {
  position: sticky;
  top: clamp(0.15rem, 0.8vw, 0.45rem);
  z-index: 12;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 34rem);
  align-items: center;
}

.site-brand {
  font-family: "IBM Plex Mono", "Fira Code", monospace;
  font-size: 0.88rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgb(var(--white) / 0.86);
}

.header-search {
  position: relative;
  width: 100%;
}

.search-shell {
  display: grid;
  gap: 0.55rem;
}

.search-input {
  width: 100%;
  padding: 0.68rem 0.95rem;
  border: 1px solid rgb(var(--white) / 0.12);
  border-radius: 0.95rem;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  background-color: rgb(var(--glass-dark) / 0.26);
  color: rgb(var(--white));
  font: inherit;
  box-shadow: inset 0 1px 0 rgb(var(--white) / 0.04);
}

.search-input::placeholder {
  color: rgb(var(--white) / 0.34);
}

.search-input:focus {
  outline: 2px solid rgb(var(--shader-wave-color) / 0.45);
  outline-offset: 2px;
}

.search-results-panel {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  width: min(100%, 38rem);
  max-height: min(70vh, 34rem);
  overflow-y: auto;
  padding: 0.55rem 0.9rem 1rem;
  border: 1px solid rgb(var(--white) / 0.12);
  border-radius: 1.25rem;
  -webkit-backdrop-filter: blur(28px);
  backdrop-filter: blur(28px);
  background-color: rgb(var(--glass-dark) / 0.35);
  box-shadow:
    inset 0 1px 0 rgb(var(--white) / 0.04),
    0 25px 50px -12px rgb(var(--black) / 0.3);
  z-index: 8;
}

.search-results-panel[hidden] {
  display: none;
}

.site-main {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  align-items: start;
  gap: clamp(0.8rem, 2vw, 1.5rem);
}

.hero,
.panel {
  width: 100%;
  padding: clamp(1rem, 2vw, 1.5rem);
  border: 1px solid rgb(var(--white) / 0.12);
  border-radius: 1.5rem;
  -webkit-backdrop-filter: blur(28px);
  backdrop-filter: blur(28px);
  background-color: rgb(var(--glass-dark) / 0.35);
  box-shadow:
    inset 0 1px 0 rgb(var(--white) / 0.04),
    0 25px 50px -12px rgb(var(--black) / 0.24);
}

.hero {
  padding-top: clamp(1.5rem, 4vw, 2.4rem);
  padding-bottom: clamp(1.5rem, 4vw, 2.4rem);
}

.hero-compact {
  padding-top: clamp(1rem, 3vw, 1.6rem);
  padding-bottom: clamp(1rem, 3vw, 1.6rem);
}

.eyebrow,
.meta {
  margin: 0 0 0.75rem;
  color: rgb(var(--white) / 0.5);
  font-family: "IBM Plex Mono", "Fira Code", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1,
.article h1 {
  margin: 0;
  max-width: 12ch;
  color: rgb(var(--white));
  font-family: "Fraunces", "Georgia", serif;
  font-size: clamp(2.5rem, 7vw, 5.2rem);
  line-height: 0.96;
}

.panel h2,
.panel h3 {
  margin: 0;
  color: rgb(var(--white));
  font-family: "Fraunces", "Georgia", serif;
}

.lede {
  max-width: 44rem;
  margin: 1rem 0 0;
  color: rgb(var(--white) / 0.78);
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  line-height: 1.75;
}

.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-note,
.search-empty,
.search-result-snippet,
.footer-description,
.footer-caption {
  color: rgb(var(--white) / 0.56);
}

.post-list {
  display: grid;
  gap: clamp(1rem, 2vw, 1.45rem);
}

.panel-posts {
  display: block;
}

.post-card {
  padding: clamp(0.7rem, 1.5vw, 1rem) 0 0;
  border-top: 1px solid rgb(var(--white) / 0.12);
}

.post-card:first-child {
  border-top: 0;
  padding-top: 0;
}

.post-card-clickable {
  cursor: pointer;
  border-radius: 1rem;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
}

.post-card-clickable:hover {
  background-color: rgb(var(--white) / 0.03);
}

.post-card-clickable:focus-visible {
  outline: 2px solid rgb(var(--shader-wave-color) / 0.45);
  outline-offset: 4px;
}

.post-card h2,
.post-card h3 {
  margin: 0.2rem 0 0.75rem;
}

.post-card h2 a,
.post-card h3 a {
  color: inherit;
}

.post-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 0.45rem;
}

.post-meta-line .meta {
  margin-bottom: 0;
}

.post-card-body,
.post-card-summary,
.article-body {
  color: rgb(var(--white) / 0.78);
  line-height: 1.8;
}

.post-card-body > :first-child,
.post-card-summary > :first-child,
.article-body > :first-child {
  margin-top: 0;
}

.post-card-body > :last-child,
.post-card-summary > :last-child,
.article-body > :last-child {
  margin-bottom: 0;
}

.post-card-image,
.article-image {
  width: 100%;
  display: block;
  margin: 0 0 1rem;
  border: 1px solid rgb(var(--white) / 0.12);
  border-radius: 1rem;
  object-fit: cover;
  aspect-ratio: 16 / 9;
  box-shadow: inset 0 1px 0 rgb(var(--white) / 0.04);
}

.article {
  max-width: 68rem;
  justify-self: stretch;
}

.article-body {
  font-size: clamp(1rem, 1.1vw, 1.12rem);
  line-height: 1.9;
}

.article-body code,
.post-card-body code,
.post-card-summary code,
.tags span,
.tags a {
  font-family: "IBM Plex Mono", "Fira Code", monospace;
}

.article-body :not(pre) > code,
.post-card-body :not(pre) > code,
.post-card-summary :not(pre) > code {
  padding: 0.12rem 0.35rem;
  border: 1px solid rgb(var(--white) / 0.12);
  border-radius: 0.45rem;
  background-color: rgb(var(--glass-dark) / 0.28);
}

.article-body pre,
.post-card-body pre,
.post-card-summary pre {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid rgb(var(--white) / 0.12);
  border-radius: 1rem;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  background-color: rgb(var(--glass-dark) / 0.28);
  box-shadow: inset 0 1px 0 rgb(var(--white) / 0.04);
}

.article-body blockquote,
.post-card-body blockquote,
.post-card-summary blockquote {
  margin: 1.25rem 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 1px solid rgb(var(--shader-wave-color) / 0.3);
  color: rgb(var(--white) / 0.7);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tags span,
.tags a {
  padding: 0.3rem 0.65rem;
  border: 1px solid rgb(var(--white) / 0.12);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  background-color: rgb(var(--glass-dark) / 0.28);
  color: rgb(var(--white) / 0.68);
  font-size: 0.79rem;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgb(var(--white) / 0.04);
}

.tags a:hover {
  color: rgb(var(--white) / 0.9);
  background-color: rgb(var(--white) / 0.06);
}

.pagination {
  margin-top: clamp(1rem, 2vw, 1.5rem);
  padding-top: clamp(1rem, 2vw, 1.5rem);
  border-top: 1px solid rgb(var(--white) / 0.12);
}

.pagination-links {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}

.pagination-slot-left {
  justify-self: start;
}

.pagination-slot-center {
  justify-self: center;
}

.pagination-slot-right {
  justify-self: end;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.9rem;
  border: 1px solid rgb(var(--white) / 0.12);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  background-color: rgb(var(--glass-dark) / 0.28);
  color: rgb(var(--white) / 0.86);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgb(var(--white) / 0.04);
  transition:
    transform 150ms ease,
    background-color 150ms ease,
    border-color 150ms ease;
}

.pagination-link:hover {
  transform: translateY(-2px);
  border-color: rgb(var(--white) / 0.22);
  background-color: rgb(var(--white) / 0.06);
}

.search-result-link {
  display: block;
  padding: 0.85rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 1rem;
  text-decoration: none;
  transition:
    background-color 150ms ease,
    border-color 150ms ease;
}

.search-result-link:hover {
  background-color: rgb(var(--white) / 0.04);
}

.search-result-link:focus-visible,
.search-result-link.is-active {
  border-color: rgb(var(--shader-wave-color) / 0.2);
  outline: 2px solid rgb(var(--shader-wave-color) / 0.35);
  outline-offset: 2px;
  background-color: rgb(var(--white) / 0.05);
}

.search-result-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.search-result-tags {
  margin-top: 0.8rem;
}

.post-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  padding-top: clamp(1rem, 2vw, 1.5rem);
  border-top: 1px solid rgb(var(--white) / 0.12);
}

.post-nav-slot-left {
  justify-self: start;
}

.post-nav-slot-right {
  justify-self: end;
}

.post-nav-link {
  display: grid;
  gap: 0.35rem;
  max-width: 22rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgb(var(--white) / 0.12);
  border-radius: 1rem;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  background-color: rgb(var(--glass-dark) / 0.28);
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgb(var(--white) / 0.04);
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background-color 150ms ease;
}

.post-nav-link:hover {
  transform: translateY(-2px);
  border-color: rgb(var(--white) / 0.22);
  background-color: rgb(var(--white) / 0.06);
}

.post-nav-link .meta {
  margin: 0;
}

.post-nav-link strong {
  color: rgb(var(--white));
  font-family: "Fraunces", "Georgia", serif;
  line-height: 1.25;
}

.post-nav-link-next {
  text-align: right;
}

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

.site-footer {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.footer-copy,
.footer-meta {
  display: grid;
  gap: 0.2rem;
}

.footer-copy {
  min-height: 1rem;
}

.footer-brand,
.footer-description,
.footer-caption {
  margin: 0;
}

.footer-brand {
  font-family: "IBM Plex Mono", "Fira Code", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgb(var(--white) / 0.82);
}

.footer-description {
  max-width: 38rem;
  line-height: 1.6;
}

.footer-meta {
  justify-items: end;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem 0.5rem;
}

.footer-links a {
  color: rgb(var(--white) / 0.88);
  text-decoration: none;
}

.footer-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border: 1px solid rgb(var(--white) / 0.12);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  background-color: rgb(var(--glass-dark) / 0.28);
  box-shadow: inset 0 1px 0 rgb(var(--white) / 0.04);
}

.footer-icon-link svg {
  width: 0.82rem;
  height: 0.82rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.footer-icon-link:hover {
  background-color: rgb(var(--white) / 0.06);
}

@media (min-width: 960px) {
  .post-list {
    align-content: start;
  }
}

@media (max-width: 720px) {
  .site-shell {
    width: min(calc(100% - 0.45rem), var(--max-width));
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
  }

  .site-header,
  .panel-header,
  .site-footer {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .site-header {
    gap: 0.65rem;
  }

  .panel,
  .article,
  .hero {
    padding: 0.95rem;
    border-radius: 1.15rem;
  }

  .footer-meta {
    justify-items: start;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .hero h1,
  .article h1 {
    max-width: none;
  }

  .search-results-panel {
    width: 100%;
    max-height: min(58vh, 28rem);
  }

  .pagination-links {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .pagination-slot-left,
  .pagination-slot-center,
  .pagination-slot-right {
    justify-self: stretch;
    text-align: left;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav-slot-left,
  .post-nav-slot-right {
    justify-self: stretch;
  }

  .post-nav-link,
  .post-nav-link-next {
    max-width: none;
    text-align: left;
  }
}
