:root {
  --bg-color: #fff;
  --text-color: #777;
  --heading-color: #333;
  --hover-bg: #eee;
}

body.dark-mode {
  --bg-color: #1a1a1a;
  --text-color: #999;
  --heading-color: #eee;
  --hover-bg: #333;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Figtree", -apple-system, system-ui, sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-color);
  background-color: var(--bg-color);
  padding: 16px;
  display: flex;
  gap: 48px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

main {
  max-width: 800px;
}

h1 {
  font-size: 1.5rem;
  color: var(--heading-color);
  margin-bottom: 1rem;
}

time {
  display: none;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

p {
  margin-bottom: 1rem;
}

main a {
  color: var(--heading-color);
  text-decoration: none;
}

main ul,
main ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

main li {
  margin-bottom: 0.5rem;
}

main h4 {
  color: var(--heading-color);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

blockquote {
  border-left: 2px solid var(--text-color);
  padding-left: 1rem;
  margin-bottom: 1rem;
  font-style: italic;
}

blockquote cite {
  display: block;
  margin-top: 0.5rem;
  font-style: normal;
  font-size: 0.9rem;
}

nav {
  width: 300px;
  flex-shrink: 0;
  margin-left: auto;
  text-align: right;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 32px);
}

nav h2 {
  font-size: 1rem;
  color: var(--heading-color);
  margin-bottom: 32px;
}

nav h3 {
  font-size: 0.9rem;
  color: var(--heading-color);
  margin-top: 24px;
  margin-bottom: 4px;
}

nav ul {
  list-style: none;
}

nav ul li {
  padding: 0;
  margin: 0;
}

nav a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background-color 0.1s ease;
}

nav a:hover {
  background-color: var(--hover-bg);
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  margin-top: auto;
  align-self: flex-end;
  padding: 0;
  display: flex;
  gap: 4px;
}

.theme-toggle .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid var(--text-color);
}

.theme-toggle .dot.light {
  background-color: var(--text-color);
}

.theme-toggle .dot.dark {
  background-color: transparent;
}

body.dark-mode .theme-toggle .dot.light {
  background-color: transparent;
}

body.dark-mode .theme-toggle .dot.dark {
  background-color: var(--text-color);
}

@media (max-width: 768px) {
  body {
    flex-direction: column-reverse;
    gap: 32px;
  }

  nav {
    width: 100%;
    margin-left: 0;
    text-align: left;
    min-height: auto;
  }

  nav h2 {
    margin-bottom: 16px;
  }

  nav h3 {
    margin-top: 16px;
  }

  .theme-toggle {
    margin-top: 24px;
    align-self: flex-start;
  }
}
