/* ---------- Base ---------- */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
}

:root {
  --bg: #fafafa;
  --text: #222;
  --header-bg: #111;
  --header-text: #fff;
  --nav-bg: #222;
  --nav-hover: #444;
  --accent: #111;
}
body.dark {
  --bg: #121212;
  --text: #eee;
  --header-bg: #000;
  --header-text: #eee;
  --nav-bg: #222;
  --nav-hover: #333;
  --accent: #eee;
}

/* ---------- Header ---------- */
header {
  background: var(--header-bg);
  color: var(--header-text);
  text-align: center;
  padding: 2.5rem 1rem;
  position: relative;
}
header img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 3px solid var(--header-text);
  margin-bottom: 1rem;
}
header h1 { margin: 0.5rem 0; font-size: 2rem; }
header p { color: #ccc; margin: 0; }

/* ---------- Navigation ---------- */
nav {
  background: var(--nav-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
nav a {
  color: white;
  text-decoration: none;
  padding: 1rem;
  font-weight: 500;
  transition: background 0.2s;
}
nav a:hover, nav a.active { background: var(--nav-hover); }

/* Hamburger button */
.hamburger {
  display: none;
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 24px;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}
.hamburger span {
  display: block;
  height: 4px;
  width: 100%;
  background: white;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger.active span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

/* Mobile nav menu */
@media (max-width: 700px) {
  nav {
    flex-direction: column;
    display: none;
  }
  nav.active { display: flex; }
  .hamburger { display: flex; }
}

/* ---------- Main ---------- */
main {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}
section { margin-bottom: 3rem; }
h2 {
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

/* ---------- Skills ---------- */
.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.skill {
  background: var(--accent);
  color: var(--header-text);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
}

/* ---------- Form ---------- */
form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-width: 600px;
}
input, textarea {
  padding: 0.8rem;
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 100%;
}
button {
  background: var(--accent);
  color: var(--header-text);
  border: none;
  padding: 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
button:hover { background: var(--nav-hover); }

/* ---------- Footer ---------- */
footer {
  background: var(--header-bg);
  color: #ccc;
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: none;
  border: 2px solid var(--header-text);
  color: var(--header-text);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
}
.theme-toggle:hover {
  background: var(--nav-hover);
}
