.markdown {
  margin-top: 18px;
  line-height: 1.7;
}

.mdx-content > h1:first-of-type {
  display: none;
}

.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4 {
  font-family: var(--font-pixel);
  letter-spacing: 0.04em;
  line-height: 1.15;
}

.markdown h1 {
  font-size: clamp(28px, 4vw, 44px);
  margin: 26px 0 10px;
}

.markdown h2 {
  font-size: 22px;
  margin: 26px 0 10px;
}

.markdown h3 {
  font-size: 18px;
  margin: 22px 0 8px;
}

.markdown p {
  margin: 0 0 14px;
}

.markdown a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px dotted color-mix(in oklab, var(--link) 65%, transparent);
}

.markdown a:hover {
  color: var(--link2);
  border-bottom-color: color-mix(in oklab, var(--link2) 75%, transparent);
}

.markdown hr {
  border: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in oklab, var(--frame-border) 30%, transparent),
    transparent
  );
  margin: 26px 0;
}

.markdown blockquote {
  margin: 18px 0;
  padding: 14px 14px;
  border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--panel) 70%, transparent);
  border-left: 6px solid color-mix(in oklab, var(--accent) 60%, transparent);
  color: var(--muted);
}

.markdown ul,
.markdown ol {
  margin: 0 0 14px 22px;
}

.markdown li {
  margin: 4px 0;
}

.markdown img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid color-mix(in oklab, var(--frame-border) 20%, transparent);
  box-shadow: 0 12px 0 -8px rgba(0, 0, 0, 0.18);
}

.showcase-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.showcase-preview {
  position: absolute;
  left: 50%;
  top: 100%;
  width: min(420px, 80vw);
  padding: 8px;
  border-radius: 14px;
  background: color-mix(in oklab, var(--panel) 92%, transparent);
  border: 1px solid color-mix(in oklab, var(--frame-border) 30%, transparent);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.55);
  transform: translate(-50%, 10px) scale(0.98);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 20;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.showcase-preview img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid color-mix(in oklab, var(--frame-border) 25%, transparent);
  box-shadow: none;
}

.showcase-link:hover .showcase-preview,
.showcase-link:focus-within .showcase-preview {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 6px) scale(1);
}

@media (hover: none) {
  .showcase-preview {
    display: none;
  }
}

.markdown code {
  font-family: var(--font-body);
  font-size: 0.95em;
  padding: 0.15em 0.35em;
  border-radius: 8px;
  background: color-mix(in oklab, var(--panel) 70%, var(--code-bg));
  border: 1px solid color-mix(in oklab, var(--frame-border) 18%, transparent);
}

.markdown pre {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 14px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in oklab, var(--frame-border) 18%, transparent);
  overflow-x: auto;
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--code-accent) 12%, transparent);
}

.markdown pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
}

.markdown table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 22px;
  border: 1px solid color-mix(in oklab, var(--frame-border) 20%, transparent);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.markdown th,
.markdown td {
  padding: 10px 10px;
  border-bottom: 1px solid color-mix(in oklab, var(--frame-border) 15%, transparent);
  vertical-align: top;
}

.markdown th {
  background: color-mix(in oklab, var(--panel2) 85%, transparent);
  font-family: var(--font-pixel);
  letter-spacing: 0.06em;
}
