:root {
  --bg-color: #111827;
  --text-color: #f4f4f9;
  --card-bg: #1f2937;
  --accent: #4fd1c5;
  --accent-hover: #38b2ac;
  --nav-bg: rgba(17, 24, 39, 0.95);
  --link-hover: #a0f0eb;
}

[data-theme="light"] {
  --bg-color: #f4f4f4;
  --text-color: #1a202c;
  --card-bg: #e2e8f0;
  --accent: #4A90E2;
  --accent-hover: #2b6cb0;
  --nav-bg: #ffffffee;
  --link-hover: #2c5282;
}

body {
  margin: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Poppins', 'JetBrains Mono', sans-serif;
  scroll-behavior: smooth;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--nav-bg);
  padding: 0.6rem 2rem;
  font-size: 0.95rem;
}

.topbar .socials a {
  color: var(--text-color);
  text-decoration: none;
  margin-right: 1.2rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.3s ease;
}

.topbar .socials a:hover {
  color: var(--link-hover);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  margin-left: auto;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  background-color: #ccc;
  border-radius: 34px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: 0.4s;
}

.slider:before {
  position: absolute;
  content: "🌞";
  height: 22px;
  width: 22px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  text-align: center;
  font-size: 14px;
  line-height: 22px;
  transition: 0.4s;
}

.toggle-switch input:checked + .slider {
  background-color: var(--accent);
}

.toggle-switch input:checked + .slider:before {
  transform: translateX(24px);
  content: "🌙";
}

.navbar {
  background: var(--nav-bg);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.navbar ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 0;
  margin: 0;
}

.navbar a {
  color: var(--text-color);
  font-weight: bold;
  text-decoration: none;
  transition: color 0.3s ease;
}

.navbar a:hover,
.navbar a.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

.skills-sidebar {
  position: fixed;
  top: 90px;
  left: 0;
  width: 250px;
  height: 100%;
  padding: 2rem 1rem;
  background-color: var(--card-bg);
  overflow-y: auto;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.skills-sidebar h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  text-align: center;
}

.skills-sidebar .skills .card {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 10px;
  background: var(--bg-color);
}

main {
  margin-left: 270px;
  padding: 1rem;
}

.hero.full-height {
  height: 90vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-color);
  text-align: center;
  padding: 2rem;
}

.hero .avatar {
  width: 150px;
  border-radius: 50%;
  box-shadow: 0 0 0.5rem var(--accent);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0.2rem 0;
}

.hero .tagline {
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.hero .btn {
  background: var(--accent);
  color: white;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s ease;
}

.hero .btn:hover {
  background: var(--accent-hover);
}

section {
  padding: 3rem 2rem;
  max-width: 960px;
  margin: auto;
}

h2 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 2rem;
}

.certificates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.certificates a.card {
  background: var(--card-bg);
  color: var(--text-color);
  padding: 1.2rem;
  border-radius: 1rem;
  box-shadow: 0 0 0.5rem rgba(0,0,0,0.2);
  text-decoration: none;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.certificates a.card:hover {
  transform: scale(1.05);
  background-color: var(--accent);
  color: #fff;
}

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.projects a {
  text-decoration: none;
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.3);
  color: var(--text-color);
  transition: background 0.3s ease, transform 0.3s ease;
}

.projects a:hover {
  background: var(--accent);
  color: #ffffff;
  transform: translateY(-5px);
}

.projects a h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
  transition: color 0.3s ease;
}

.projects a:hover h3 {
  color: #ffffff;
}

.projects a p {
  font-size: 0.95rem;
  color: var(--text-color);
  transition: color 0.3s ease;
}

.projects a:hover p {
  color: #ffffff;
}

form {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 0 1rem rgba(0, 0, 0, 0.15);
}

input, textarea {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: none;
  border-radius: 0.5rem;
  background: #2d3748;
  color: white;
}

input:focus, textarea:focus {
  outline: 2px solid var(--accent);
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.btn:hover {
  background: var(--accent-hover);
}

footer {
  background: var(--card-bg);
  text-align: center;
  padding: 2rem;
  color: var(--text-color);
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  color: var(--accent-hover);
}

#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--accent);
  color: white;
  padding: 0.5rem;
  border-radius: 50%;
  display: none;
  z-index: 1000;
  box-shadow: 0 0 10px var(--accent);
  cursor: pointer;
}

#back-to-top.show {
  display: block;
}
