:root {
  --bg: #fafafa;
  --text: #222;
  --card-bg: #fff;
  --card-shadow: rgba(0,0,0,0.1);
}

body.dark {
  --bg: #121212;
  --text: #eee;
  --card-bg: #1e1e1e;
  --card-shadow: rgba(0,0,0,0.5);
}

body {
  font-family: sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  text-align: center;
  transition: background 0.3s, color 0.3s;
  min-height: 100vh;
}

header {
  padding: 2rem;
}

#projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  max-width: 1000px;
  margin: auto;
}

.project-card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 4px 10px var(--card-shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px var(--card-shadow);
}

footer {
  padding: 1rem;
  font-size: 0.9rem;
  color: #666;
}

.theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.theme-toggle input {
  display: none;
}

.switch {
  width: 60px;
  height: 30px;
  background: #ccc;
  border-radius: 30px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  box-sizing: border-box;
}

.switch::before {
  content: "";
  width: 26px;
  height: 26px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.3s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.icon {
  font-size: 16px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.8;
}

.sun {
  color: gold;
}
.moon {
  color: #ddd;
}

input:checked + .switch {
  background: #4cafef;
}

input:checked + .switch::before {
  transform: translateX(30px);
}
