:root {
  --nh-accent: #e86a30;
  --nh-accent-hover: #f07a42;
  --nh-accent-light: rgba(248, 0, 0, 0.12);
  --nh-surface: rgba(255, 255, 255, 0.04);
  --nh-border: rgba(255, 255, 255, 0.08);
  --nh-text: #ffffff;
  --nh-text-muted: rgba(255, 255, 255, 0.6);
}

[data-md-color-scheme="slate"] {
  --md-accent-fg-color: var(--nh-accent);
  --md-accent-fg-color--transparent: var(--nh-accent-light);
  --md-typeset-a-color: var(--nh-accent);
  --md-code-bg-color: #16171d;
  --md-code-fg-color: #d8dee9;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-image: radial-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 24px 24px;
}

h1, h2, h3, h4, h5, h6,
.md-header__title {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 700;
}

.md-typeset {
  font-size: 0.82rem;
  line-height: 1.7;
}

::selection {
  background: var(--nh-accent-light);
  color: var(--nh-text);
}

.md-logo img {
  border-radius: 50%;
  width: 50px;
  height: 50px;
  object-fit: cover;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

.md-typeset a {
  transition: color 0.15s ease;
}

.md-typeset a:hover {
  color: var(--nh-accent-hover);
}

.md-typeset img {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

.md-author img,
.mdx-hero img {
  border: none;
}

.md-typeset blockquote {
  border-left: 3px solid var(--nh-accent);
  color: var(--nh-text-muted);
  padding-left: 1rem;
}

.md-typeset hr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.md-typeset h1 {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 0.4rem;
  margin-bottom: 1.5rem;
}

.md-typeset h2 {
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 0.3rem;
  margin-bottom: 1rem;
}

.md-typeset code {
  color: var(--nh-accent-hover);
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
}

.md-typeset pre > code {
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(0, 0, 0, 0.3);
}

/* Terminal-style code blocks */
.md-typeset .highlight {
  position: relative;
  margin: 1.25rem 0;
  border: 1px solid var(--nh-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--md-code-bg-color);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.md-typeset .highlight::before {
  content: "";
  display: block;
  height: 2.1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--nh-border);
}

.md-typeset .highlight::after {
  content: "";
  position: absolute;
  top: 0.85rem;
  left: 1.1rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff5f56;
  box-shadow: 18px 0 0 #ffbd2e, 36px 0 0 #27c93f;
}

.md-typeset .highlight:has(.filename)::before,
.md-typeset .highlight:has(.filename)::after {
  display: none;
}

.md-typeset .highlight .filename {
  position: relative;
  display: block;
  padding: 0.6rem 1.1rem 0.6rem 3.6rem;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.7rem;
  color: var(--nh-text-muted);
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--nh-border);
}

.md-typeset .highlight .filename::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 1.1rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff5f56;
  box-shadow: 18px 0 0 #ffbd2e, 36px 0 0 #27c93f;
  transform: translateY(-50%);
}

.md-typeset .highlight pre {
  margin: 0;
  background: transparent;
}

.md-typeset .highlight pre > code {
  border: none;
  background: transparent;
  font-size: 0.78rem;
  line-height: 1.7;
}

.md-typeset .highlight code,
.md-typeset .highlight pre {
  font-family: 'JetBrains Mono', 'Fira Code', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
}

.md-typeset .highlight pre::-webkit-scrollbar {
  height: 8px;
}

.md-typeset .highlight pre::-webkit-scrollbar-track {
  background: transparent;
}

.md-typeset .highlight pre::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

.md-typeset .highlight .md-clipboard {
  top: 0.55rem;
  right: 0.7rem;
  color: var(--nh-text-muted);
}

.md-typeset .highlight .md-clipboard:hover {
  color: var(--nh-accent);
}

.md-typeset .footnote-ref {
  color: var(--nh-accent);
}

.md-typeset .grid.cards {
  margin: 2rem 0;
}

.md-typeset .grid.cards > ul > li {
  border: 1px solid var(--nh-border);
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  transition: border-color 0.2s ease, transform 0.15s ease;
  background: var(--nh-surface);
}

.md-typeset .grid.cards > ul > li:hover {
  border-color: var(--nh-accent);
  transform: translateY(-2px);
}

.md-typeset .grid.cards > ul > li > hr {
  border-bottom-color: rgba(255, 255, 255, 0.06);
  margin: 0.6rem 0;
}

.mdx-hero {
  z-index: 2;
  text-align: center;
  padding: 0 1rem;
  position: relative;
  background-color: transparent;
  color: var(--nh-text);
  max-width: 480px;
  margin: 2rem auto 3rem;
}

.mdx-hero img {
  display: block;
  margin: 0 auto;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 2;
}

.mdx-name {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0.75rem 0 0.2rem;
  color: var(--nh-text);
}

.mdx-bio {
  font-size: 1rem;
  margin: 0.2rem 0 1.2rem;
  color: var(--nh-text-muted);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  z-index: 10;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--nh-border);
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  pointer-events: auto;
}

.social-links a:hover {
  background: var(--nh-accent-light);
  border-color: var(--nh-accent);
  transform: translateY(-2px);
}

.social-links svg {
  width: 22px;
  height: 22px;
  fill: var(--nh-text);
}

.md-post--excerpt {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.md-post--excerpt:last-of-type {
  border-bottom: none;
}

.md-post__title {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.md-post__title a {
  color: var(--nh-text);
}

.md-post__title a:hover {
  color: var(--nh-accent);
}

.md-post__meta {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.75rem;
}

.md-post__meta .md-meta__link {
  color: var(--nh-accent);
}

.md-content--post .md-post__title {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.md-sidebar--post {
  border-left: 1px solid rgba(255, 255, 255, 0.04);
}

.md-tag {
  background: var(--nh-accent-light);
  color: var(--nh-accent);
  border-radius: 4px;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
}

.md-tag:hover {
  background: var(--nh-accent-light);
  color: var(--nh-accent-hover);
}

.md-nav__link--active {
  color: var(--nh-accent);
}

.md-nav__link:hover {
  color: var(--nh-accent);
}

.md-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

/* Mastodon comments */

.nh-comments {
  margin-top: 1rem;
}

.nh-comments__hint {
  font-size: 0.72rem;
  color: var(--nh-text-muted);
}

.nh-comments__list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.nh-comment {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--nh-surface);
  border: 1px solid var(--nh-border);
  border-radius: 8px;
}

.md-typeset .nh-comment__avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.nh-comment__body {
  min-width: 0;
  flex: 1;
}

.nh-comment__author {
  font-weight: 700;
  color: var(--nh-text);
  margin-right: 0.5rem;
}

.nh-comment__date {
  font-size: 0.7rem;
  color: var(--nh-text-muted);
}

.nh-comment__content {
  font-size: 0.8rem;
  line-height: 1.6;
  margin-top: 0.25rem;
  word-wrap: break-word;
}

.nh-comment__content p {
  margin: 0.4rem 0;
}

.nh-comment__stats {
  margin-top: 0.5rem;
  display: flex;
  gap: 1rem;
  font-size: 0.7rem;
  color: var(--nh-text-muted);
}

.nh-comment__stats a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: inherit;
}

.nh-comment__stats a:hover {
  color: var(--nh-accent);
}

.nh-comment__stats svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
