/* ======= CONFIGURACIÓN GENERAL ======= */
:root {
  --bg: #fafafa;
  --text: #222;
  --accent: #00adb5;
  --header-bg: #111;
  --card-bg: #fff;
  --btn-bg: #00adb5;
  --btn-hover: #0099a3;
}

body:has(#toggle-theme:checked) {
  --bg: #121212;
  --text: #e0e0e0;
  --accent: #00e0ff;
  --header-bg: #1e1e1e;
  --card-bg: #222;
  --btn-bg: #00adb5;
  --btn-hover: #007a83;
}

/* ======= ESTILOS BASE ======= */
body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  transition: background 0.4s, color 0.4s;
}

.container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
}

/* ======= HEADER ======= */
header {
  background: var(--header-bg);
  color: #fff;
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 600;
  font-size: 1.4em;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5em;
  margin: 0;
  padding: 0;
}

nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 400;
}

nav a:hover {
  text-decoration: underline;
}

/* ======= TOGGLE MODO OSCURO ======= */
.theme-toggle {
  position: relative;
}

#toggle-theme {
  display: none;
}

.toggle-label {
  display: inline-block;
  width: 40px;
  height: 20px;
  background: #888;
  border-radius: 20px;
  position: relative;
  cursor: pointer;
}

.toggle-label::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  top: 1px;
  left: 1px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}

#toggle-theme:checked + .toggle-label {
  background: var(--accent);
}

#toggle-theme:checked + .toggle-label::after {
  transform: translateX(20px);
}

/* ======= HERO ======= */
.hero {
  background: linear-gradient(to right, var(--header-bg), rgb(113, 151, 118));
  color: #fff;
  text-align: center;
  padding: 100px 20px;
}

.hero span {
  color: var(--accent);
}

.hero .btn {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 25px;
  background: var(--btn-bg);
  color: #fff;
  text-decoration: none;
  border-radius: 30px;
  transition: 0.3s;
}

.hero .btn:hover {
  background: var(--btn-hover);
}

/* ======= HABILIDADES ======= */
.skills {
  padding: 80px 20px;
  text-align: center;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.skill {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s;
}

.skill:hover {
  transform: translateY(-5px);
}

/* ======= PROYECTOS ======= */
.projects {
  padding: 80px 20px;
  text-align: center;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.project-card {
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  overflow: hidden;
}

.project-card img {
  width: 100%;
  height: auto;
}

.project-card h3 {
  margin: 15px 0;
}

.project-card .btn {
  display: inline-block;
  margin: 10px 0 20px 0;
  padding: 10px 20px;
  background: var(--btn-bg);
  color: #fff;
  text-decoration: none;
  border-radius: 25px;
}

.project-card .btn:hover {
  background: var(--btn-hover);
}

/* ======= CONTACTO ======= */
.contact {
  padding: 80px 20px;
  text-align: center;
}

.contact .btn {
  background: var(--header-bg);
  color: #fff;
  padding: 12px 25px;
  text-decoration: none;
  border-radius: 30px;
}

.contact .btn:hover {
  background: #333;
}

.social a {
  color: var(--accent);
  text-decoration: none;
}

.social a:hover {
  text-decoration: underline;
}

/* ======= FOOTER ======= */
footer {
  background: var(--header-bg);
  color: #fff;
  text-align: center;
  padding: 20px 0;
  font-size: 0.9em;
}

/* ======= RESPONSIVO ======= */
@media (max-width: 600px) {
  nav ul {
    flex-direction: column;
    gap: 10px;
  }
  .hero {
    padding: 60px 10px;
  }
  .projects-grid, .skills-grid {
    grid-template-columns: 1fr;
  }
}
