:root {
  --bg: #ffffff;
  --text: #111111;
  --link: #007acc;
  --muted: #6b7280;
  --header-bg: transparent;
  --nav-bg: rgba(255,255,255,0.6);
  --toggle-bg: var(--nav-bg);
  --toggle-text: var(--text);
  --toggle-border: rgba(0,0,0,0.06);
}

[data-theme="dark"] {
  --bg: #0b0f13;
  --text: #e6eef6;
  --link: #66aaff;
  --muted: #9aa6b2;
  --header-bg: transparent;
  --nav-bg: rgba(11,15,19,0.6);
  --toggle-bg: #e5e7eb; /* light grey button in dark mode */
  --toggle-text: #0b0f13; /* dark text on the light button */
  --toggle-border: rgba(0,0,0,0.12);
}

html, body {
  height: 100%;
}

body {
  font-family: Arial, sans-serif;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  transition: background-color 200ms ease, color 200ms ease;
}

.site-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
  background: var(--header-bg);
  padding-bottom: 0.5rem;
}

.header-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-title {
  margin: 0;
  font-size: 1.25rem;
}

.site-title a {
  color: var(--text);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.main-nav a {
  margin: 0 0.5rem;
  text-decoration: none;
  color: var(--link);
  font-weight: 500;
}

.main-nav a:hover {
  text-decoration: underline;
}

.theme-toggle {
  background: var(--toggle-bg);
  color: var(--toggle-text);
  border: 1px solid var(--toggle-border);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.theme-toggle .theme-icon {
  line-height: 1;
}

#header-video {
  max-width: 60%;
  height: auto;
  display: block;
  cursor: pointer;
}

main {
  margin-top: 1.25rem;
}

@media (max-width: 640px) {
  .header-top { flex-direction: column; align-items: stretch; }
  .main-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem; }
  #header-video { max-width: 100%; }
}

/* Post navigation (previous / next) */
.post-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0 1rem;
}

.post-nav-item {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  border: 1px solid rgba(0,0,0,0.06);
}

.post-nav-item:hover {
  text-decoration: none;
  filter: brightness(0.97);
}

.post-nav-prev { text-align: left; }
.post-nav-next { text-align: right; }

.post-nav .placeholder {
  visibility: hidden;
}

@media (max-width: 520px) {
  .post-nav { flex-direction: column; align-items: stretch; }
  .post-nav-item { width: 100%; text-align: center; }
}

