@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Serif:wght@400;600;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --color-bg: #1a1a1a;
  --color-surface: #262626;
  --color-border: #333333;
  --color-text: #e8e8e8;
  --color-text-muted: #a0a0a0;
  --color-text-secondary: #999999;

  --topbar-height: 46px;
  --sidebar-width: 240px;

  --transition-duration: 220ms;
  --transition-easing: ease;

  --font-heading: 'IBM Plex Serif', Georgia, serif;
  --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
}

/* Top bar */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
}

.topbar-title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.06);
}

.hamburger span {
  display: block;
  height: 2px;
  width: 18px;
  margin: 0 auto;
  background: var(--color-text-muted);
  border-radius: 1px;
}

/* Sidebar */

.sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform var(--transition-duration) var(--transition-easing);
  z-index: 90;
}

body.sidebar-open .sidebar {
  transform: translateX(0);
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 8px;
}

.sidebar-nav li + li {
  margin-top: 2px;
}

.sidebar-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 4px;
  color: var(--color-text);
  text-decoration: none;
  font-size: 14px;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Content */

.content {
  margin-top: var(--topbar-height);
  margin-left: 0;
  padding: 24px;
  transition: margin-left var(--transition-duration) var(--transition-easing);
}

body.sidebar-open .content {
  margin-left: var(--sidebar-width);
}

/* Homepage content */

.content-prose {
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vh, 5rem) clamp(1.25rem, 5vw, 2.5rem) 4rem;
}

.site-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 0.25rem;
}

.site-byline {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text-secondary);
  margin: 0 0 2rem;
}

.site-motto {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.15rem;
  color: #cccccc;
  margin: 0 0 1.5rem;
}

.site-purpose {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  max-width: 560px;
  margin: 0 0 2.5rem;
}

.site-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 0 0 1.5rem;
}

.site-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-toc > ul > li {
  padding: 1rem 0;
  border-bottom: 1px solid #2a2a2a;
}

.site-toc > ul > li:last-child {
  border-bottom: none;
}

.toc-label {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
}

.toc-desc {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin: 0.2rem 0 0;
}

.toc-sub {
  margin-top: 0.6rem;
  padding-left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.toc-sub li {
  font-size: 0.8rem;
}

.toc-sub a {
  color: var(--color-text);
  text-decoration: none;
}

.toc-sub a:hover {
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 600px) {
  :root {
    --sidebar-width: 200px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .content {
    transition: none;
  }
}
