:root {
  --background: 222 47% 6%;
  --foreground: 210 40% 92%;
  --card: 222 44% 9%;
  --primary: 174 72% 46%;
  --secondary: 222 30% 14%;
  --muted-foreground: 215 20% 55%;
  --border: 222 30% 18%;
  --radius: 8px;
  --gh-font-heading: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gh-font-body: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--gh-font-body);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.site-main {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid hsl(var(--border) / 0.5);
  background: hsl(var(--background) / 0.8);
  backdrop-filter: blur(12px);
}

.site-header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  color: hsl(var(--primary));
}

.brand-accent {
  color: hsl(var(--muted-foreground));
  font-weight: 400;
}

.site-nav .nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.site-nav .nav li a {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  color: hsl(var(--muted-foreground));
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86rem;
  transition: color 150ms ease, background-color 150ms ease;
}

.site-nav .nav li a:hover,
.site-nav .nav-current a {
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.1);
}

.site-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2rem;
  padding: 0 0.75rem;
  border-radius: var(--radius);
  background: hsl(var(--primary));
  color: hsl(var(--background));
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  font-weight: 600;
}

.hero {
  padding-block: 2rem 2.25rem;
}

.hero-kicker,
.article-kicker {
  margin: 0 0 0.75rem;
  color: hsl(var(--primary));
  font-size: 0.84rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.hero-title,
.article-title,
.gh-content h1,
.gh-content h2,
.gh-content h3,
.gh-content h4 {
  margin: 0;
  font-family: var(--gh-font-heading);
  line-height: 1.2;
}

.hero-title,
.article-title {
  font-size: clamp(1.8rem, 4.2vw, 2.9rem);
  max-width: 24ch;
}

.hero-description,
.article-excerpt {
  color: hsl(var(--muted-foreground));
  max-width: 68ch;
}

.post-feed {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}

.post-card {
  grid-column: span 12;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  overflow: hidden;
}

.post-card-link {
  display: grid;
  grid-template-columns: 1fr;
}

.post-card-image-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid hsl(var(--border));
}

.post-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card-body {
  padding: 1rem;
}

.post-card-meta,
.article-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.82rem;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.post-card-title {
  margin: 0.55rem 0 0;
  font-size: 1.18rem;
  line-height: 1.32;
}

.post-card-excerpt {
  margin: 0.55rem 0 0;
  color: hsl(var(--muted-foreground));
}

.post-card-more {
  margin-top: 0.8rem;
  display: inline-flex;
  color: hsl(var(--primary));
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
}

.article {
  width: min(820px, calc(100% - 2rem));
}

.article-header {
  margin-bottom: 1.25rem;
}

.article-image-wrap {
  margin: 1rem 0 1.8rem;
}

.article-image {
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
}

.article-image-wrap figcaption {
  margin-top: 0.5rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.86rem;
}

.gh-content {
  font-size: 1.04rem;
}

.gh-content > * {
  margin-top: 0;
  margin-bottom: 1rem;
}

.gh-content h2,
.gh-content h3,
.gh-content h4 {
  margin-top: 2rem;
}

.gh-content p,
.gh-content li,
.gh-content blockquote,
.gh-content figcaption {
  color: hsl(var(--foreground));
}

.gh-content a {
  color: hsl(var(--primary));
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.gh-content ul,
.gh-content ol {
  padding-left: 1.2rem;
}

.gh-content blockquote {
  margin: 1.4rem 0;
  padding-left: 1rem;
  border-left: 2px solid hsl(var(--primary) / 0.6);
}

.gh-content code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: hsl(var(--secondary));
  border-radius: 6px;
  padding: 0.2rem 0.35rem;
}

.gh-content pre {
  background: hsl(var(--secondary));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow-x: auto;
  padding: 0.9rem;
}

.gh-content pre code {
  background: transparent;
  padding: 0;
}

.gh-content .kg-width-wide {
  width: min(1100px, 100vw - 2rem);
  margin-left: 50%;
  transform: translateX(-50%);
}

.gh-content .kg-width-full {
  width: 100vw;
  max-width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
}

.gh-content .kg-image-card img,
.gh-content .kg-gallery-image img {
  border-radius: var(--radius);
}

.gh-content .kg-bookmark-container,
.gh-content .kg-callout-card,
.gh-content .kg-toggle-card {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
}

.gh-content .kg-bookmark-title,
.gh-content .kg-bookmark-description,
.gh-content .kg-bookmark-metadata {
  color: hsl(var(--foreground));
}

.gh-content .kg-bookmark-icon {
  border-radius: 4px;
}

.gh-content .kg-callout-text,
.gh-content .kg-toggle-content {
  color: hsl(var(--foreground));
}

.has-serif-font {
  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
}

.has-sans-serif-font {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.has-monospace-font {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.2rem;
}

.tag-pill {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  color: hsl(var(--primary));
  border: 1px solid hsl(var(--primary) / 0.35);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  background: hsl(var(--primary) / 0.08);
}

.pagination {
  margin-top: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.pagination-link {
  color: hsl(var(--primary));
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
}

.pagination-link.is-disabled {
  color: hsl(var(--muted-foreground));
}

.page-number {
  color: hsl(var(--muted-foreground));
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
}

.site-footer {
  border-top: 1px solid hsl(var(--border) / 0.5);
  margin-top: 3rem;
  padding-top: 2rem;
  padding-bottom: 1.2rem;
}

.site-footer-inner {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.4fr 2fr;
}

.footer-description {
  margin: 0.5rem 0 0;
  color: hsl(var(--muted-foreground));
  max-width: 52ch;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.footer-links a {
  color: hsl(var(--muted-foreground));
  font-size: 0.93rem;
}

.footer-links a:hover {
  color: hsl(var(--primary));
}

.footer-bottom {
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px solid hsl(var(--border) / 0.5);
  color: hsl(var(--muted-foreground));
  font-size: 0.78rem;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (max-width: 960px) {
  .site-header-inner {
    flex-wrap: wrap;
    min-height: auto;
    padding: 0.8rem 0;
  }

  .site-nav {
    width: 100%;
    order: 3;
  }

  .site-nav .nav {
    flex-wrap: wrap;
  }

  .site-cta {
    margin-left: auto;
  }

  .site-footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 740px) {
  .post-card {
    grid-column: span 6;
  }

  .post-card-link {
    height: 100%;
  }
}

@media (min-width: 1080px) {
  .post-card {
    grid-column: span 4;
  }
}
