body {
  margin: 0;
  max-width: 100vw;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header {
  background: var(--surface);
  box-shadow: 0 1px 0 var(--border), 0 1px 24px -8px var(--accent-dim);
  padding: 14px 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out);

  @starting-style {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  header {
    transition-property: opacity;
    transform: none;

    @starting-style {
      transform: none;
    }
  }
}

/* Plain text+icon link: the arrow nudges toward its direction and the
   underline draws in, rather than a button surface lighting up. */
#back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s ease;
}

#back-link svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease-out);
}

#back-link span {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s ease;
}

#back-link:hover {
  color: var(--text);
}

#back-link:hover svg {
  transform: translateX(-3px);
}

#back-link:hover span {
  text-decoration-color: currentColor;
}

@media (prefers-reduced-motion: reduce) {
  #back-link svg {
    transition-duration: 0.01ms;
  }
}

.title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

#icon {
  width: 26px;
  height: 26px;
}

header h1 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

main {
  width: 100%;
  max-width: 760px;
  padding: 0 24px;
}

main section {
  padding: 40px 0 64px;
}

main section h2 {
  margin-top: 0;
  color: var(--text);
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

#markdown-content {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
}

/* The markdown fetch/parse finishes after page load; its rendered elements
   (not the plain-text "Loading..." placeholder, which isn't an element)
   fade in together as one block rather than popping in as a hard cut. */
#markdown-content > * {
  animation: content-reveal 450ms var(--ease-out) both;
}

@keyframes content-reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  #markdown-content > * {
    animation-name: content-reveal-fade-only;
  }
}

@keyframes content-reveal-fade-only {
  from {
    opacity: 0;
  }
}

#markdown-content h2,
#markdown-content h3 {
  color: var(--text);
  letter-spacing: -0.01em;
  margin-top: 2.2em;
}

#markdown-content p,
#markdown-content li {
  max-width: 65ch;
  color: var(--text);
}

#markdown-content a {
  color: var(--accent);
}

#markdown-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.4em 0;
}

#markdown-content code {
  font-family: var(--font-mono);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--text);
  font-size: 0.9em;
}

#markdown-content pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
}

#markdown-content pre code {
  border: none;
  padding: 0;
  background: none;
}
