body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.6;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.page {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 2rem auto 0;
  padding: 0 1rem;
}

.footer-art {
  margin-top: 2rem;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  color: var(--footer-art-color, currentColor);
  pointer-events: none;
  user-select: none;
}

.footer-art svg {
  display: block;
  width: 100%;
  height: 200px;
}

img {
  display: block;
  height: auto;
  max-width: min(100%, 720px);
  margin: 1rem auto;
}

a { text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

pre {
  padding: 1rem;
  overflow-x: auto;
  border: 1px solid #ddd;
  border-radius: 8px;
}

/* topbar */
.topbar {
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 1.25rem;
}

.topbar-inner {
  display: flex;
  align-items: center;
  padding: 0.75rem 0;
}

.social-links {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.icon-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.25rem 0.35rem;
  border-radius: 6px;
  color: inherit;
}

.icon-label {
  font-size: 0.7rem;
  line-height: 1;
}

.icon-link:hover {
  text-decoration: none;
  background-color: color-mix(in srgb, currentColor 10%, transparent);
}

.icon-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.icon {
  width: 18px;
  height: 18px;
  display: block;
}

/* Ensure consistent nav → title spacing across pages */
main > h1:first-child {
  margin-top: 0;
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0;
  border-radius: 0;
  text-decoration: none;
  color: inherit;
  transition: transform 160ms ease, background-color 160ms ease;
}

/* Animated underline */
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.2rem;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.nav-links a:hover {
  text-decoration: none;
  transform: translateY(-1px);
  background-color: color-mix(in srgb, currentColor 10%, transparent);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

/* Current page indicator */
.nav-links a.is-active {
  font-weight: 650;
}

.nav-links a.is-active::after {
  transform: scaleX(1);
}


.nav-links a:active {
  transform: translateY(0);
}

.nav-links a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}



@media (prefers-reduced-motion: reduce) {
  .nav-links a,
  .nav-links a::after {
    transition: none;
  }
}

