:root {
  --bg: #f9f9fb;
  --text: #222;
  --primary: #515eed;
  --link: #3a51ff;
  --code-bg: #eaeaea;
  --nav-bg: #ffffff;
  --footer-bg: #f0f0f0;
  --transition: 0.3s ease;
}

[data-theme="dark"] {
  --bg: #1e1f26;
  --text: #e0e0e0;
  --primary: #7885ff;
  --link: #9da9ff;
  --code-bg: #2c2d38;
  --nav-bg: #2a2a3b;
  --footer-bg: #1c1c2b;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.6;
  scroll-behavior: smooth;
  transition: background var(--transition), color var(--transition);
}

header {
  background: var(--nav-bg);
  border-bottom: 1px solid #ddd;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background var(--transition);
}

header .container {
  max-width: 1000px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav a {
  margin: 0 1rem;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  position: relative;
  transition: color var(--transition);
}

nav a:hover::after {
  content: '';
  position: absolute;
  height: 2px;
  width: 100%;
  background: var(--primary);
  bottom: -3px;
  left: 0;
}

nav button {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--primary);
  transition: transform var(--transition);
}

nav button:hover {
  transform: rotate(20deg);
}

main {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

section {
  margin-bottom: 3rem;
}

h1, h2, h3 {
  color: var(--primary);
}

code {
  background: var(--code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 5px;
  font-family: monospace;
}

a {
  color: var(--link);
  text-decoration: none;
}

footer {
  background: var(--footer-bg);
  padding: 1rem;
  text-align: center;
  font-size: 0.9rem;
  border-top: 1px solid #ddd;
  transition: background var(--transition);
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 600px) {
  nav {
    flex-direction: column;
    align-items: flex-end;
  }

  nav a, nav button {
    margin-top: 0.5rem;
  }
}
