:root {
  --bg-color: linear-gradient(135deg, #0f0f0f, #1a1a1a, #222);
  --header-bg: linear-gradient(135deg, #111, #222);
  --text-color: #fff;
  --subtext-color: #bbb;
  --card-bg: #1c1c1c;
  --highlight-bg: linear-gradient(135deg, #2a0a5e, #3a0d77, #1c1c1c);
  --highlight-border: #7f5af0;
  --nav-bg: #111;
}

[data-theme="light"] {
  --bg-color: #f5f5f5;
  --header-bg: #eaeaea;
  --text-color: #111;
  --subtext-color: #333;
  --card-bg: #fff;
  --highlight-bg: linear-gradient(135deg, #d0c4ff, #e0d9ff, #fff);
  --highlight-border: #4f2df9;
  --nav-bg: #ddd;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.5s, color 0.5s;
}
header {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--header-bg);
  transition: background 0.5s;
}
header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  border-right: 3px solid var(--text-color);
  animation: typing 3s steps(30, end), blink 0.7s step-end infinite;
}
header p {
  color: var(--subtext-color);
  font-size: 1rem;
}
nav {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--nav-bg);
  padding: 0.5rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background 0.5s;
}
nav a {
  color: var(--text-color);
  text-decoration: none;
  margin: 0.5rem 1rem;
  font-weight: bold;
  transition: color 0.3s;
  font-size: 1rem;
}
nav a:hover {
  color: #4f9cf9;
}
.theme-toggle {
  margin-left: auto;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.4rem 0.8rem;
  border-radius: 0.4rem;
  background: #444;
  color: #fff;
  border: none;
  transition: background 0.3s;
}
.theme-toggle:hover {
  background: #666;
}
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  margin-left: 1rem;
}
.hamburger div {
  width: 25px;
  height: 3px;
  background: var(--text-color);
  margin: 4px;
  transition: 0.4s;
}
.nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
}
.nav-links.mobile {
  display: none;
  flex-direction: column;
  width: 100%;
  background: var(--nav-bg);
}
.nav-links.mobile a {
  margin: 1rem 0;
}
.nav-links.show {
  display: flex;
}
section {
  max-width: 1000px;
  margin: 3rem auto;
  padding: 1rem;
}
section h2 {
  font-size: 1.8rem;
  border-bottom: 2px solid #444;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}
.card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease, background 0.5s;
}
.card.visible {
  opacity: 1;
  transform: translateY(0);
}
.highlight {
  background: var(--highlight-bg);
  border-left: 5px solid var(--highlight-border);
}
.contact-buttons a {
  display: inline-block;
  margin: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  background: #222;
  border: 1px solid #444;
  color: #fff;
  text-decoration: none;
  transition: background 0.3s, transform 0.3s;
  font-size: 1rem;
}
.contact-buttons a:hover {
  background: #4f9cf9;
  transform: scale(1.05);
}
/* Responsive */
@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }
  nav {
    flex-wrap: wrap;
  }
  .hamburger {
    display: flex;
  }
  .nav-links {
    display: none;
  }
  section {
    margin: 2rem 1rem;
  }
  nav a {
    font-size: 0.95rem;
  }
}
@media (max-width: 480px) {
  header h1 {
    font-size: 1.7rem;
  }
  header p {
    font-size: 0.9rem;
  }
}
/* Typing effect */
@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}
@keyframes blink {
  50% { border-color: transparent }
}