/* Root color variables (light mode by default) */
:root {
  --bg: #f4f4f4;
  --fg: #222;
  --header-bg: #e0e0e0;
  --header-fg: #222;
  --link: #333;
  --link-hover: #000;
  --footer-fg: #666;
}

/* Dark mode variables */
:root.dark {
  --bg: #121212;
  --fg: #e5e5e5;
  --header-bg: #1e1e1e;
  --header-fg: #f0f0f0;
  --link: #ccc;
  --link-hover: #fff;
  --footer-fg: #aaa;
}

/* Global */
body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Header + Navigation */
header {
  background: var(--header-bg);
  color: var(--header-fg);
  padding: 20px 0;
  border-bottom: 1px solid #ccc;
  text-align: center;
}

nav a {
  margin: 0 15px;
  text-decoration: none;
  color: var(--link);
  font-weight: 600;
}

nav a:hover {
  text-decoration: underline;
  color: var(--link-hover);
}

/* Centered Content */
main {
  max-width: 820px;
  margin: 40px auto;
  padding: 0 20px;
}

/* Typography */
h1 {
  font-size: 2rem;
  margin-top: 0;
}

h2 {
  margin-top: 40px;
  font-size: 1.4rem;
}

h3 {
  margin-bottom: 5px;
  font-size: 1.1rem;
}

article {
  margin-top: 20px;
}

/* Footer */
footer {
  text-align: center;
  padding: 20px;
  margin-top: 60px;
  color: var(--footer-fg);
  font-size: 0.9rem;
}

/* Dark mode toggle button */
#darkmode-toggle {
  position: absolute;
  right: 20px;
  top: 20px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  border-radius: 6px;
  border: 1px solid #666;
  background: transparent;
  color: var(--header-fg);
  transition: opacity 0.2s ease;
}

#darkmode-toggle:hover {
  opacity: 0.7;
}
