:root {
  --bg-color: #fefefe;
  --text-color: #222;
  --link-color: #0066cc;
  --font-size: 1.1rem;
}

.dark-mode {
  --bg-color: #1a1a1a;
  --text-color: #e0e0e0;
  --link-color: #6db3f2;
}

* {
  box-sizing: border-box;
}

body {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: var(--font-size);
  line-height: 1.7;
  max-width: 42em;
  margin: 0 auto;
  padding: 1.5rem;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
}

a {
  color: var(--link-color);
}

.controls {
  position: sticky;
  top: 0;
  background: var(--bg-color);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--text-color);
  margin-bottom: 1rem;
  z-index: 50;
}

.controls button {
  font-size: 1rem;
  padding: 0.3rem 0.7rem;
  margin-right: 0.5rem;
  cursor: pointer;
}

.controls a {
  text-decoration: none;
  margin-left: 1rem;
}

h1, h2 {
  line-height: 1.3;
}

.byline {
  font-style: italic;
  color: var(--text-color);
  opacity: 0.7;
  margin-top: -0.5rem;
}

.reading-time {
  font-size: 0.85em;
  color: var(--text-color);
  opacity: 0.6;
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
}

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

.toc li {
  margin: 0.8rem 0;
}

.toc a {
  text-decoration: none;
}

.toc a:hover {
  text-decoration: underline;
}

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--link-color);
  width: 0%;
  z-index: 100;
  transition: width 0.1s;
}
