/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.4s ease, color 0.4s ease;
}

:root {
  --bg-dark: #121212;
  --text-dark: #e0e0e0;
  --bg-light: #f5f5f5;
  --text-light: #222222;
  --orange: #f97316;
  --blue: #38bdf8;
  --yellow: #fbbf24;
  --gray-light: #d1d5db;
}

body.dark-mode {
  --bg: var(--bg-dark);
  --text: var(--text-dark);
}

body.light-mode {
  --bg: var(--bg-light);
  --text: var(--text-light);
}

/* Navbar */
#navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: linear-gradient(90deg, var(--orange), var(--blue));
  padding: 1rem 2rem;
  z-index: 1000;
  display: flex;
  justify-content: center;
}

#navbar ul {
  display: flex;
  list-style: none;
  gap: 1rem;
  align-items: center;
}

#navbar a,
#navbar button {
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.3s ease;
}

#navbar a:hover,
#navbar a:focus,
#navbar button:hover,
#navbar button:focus {
  color: var(--yellow);
  outline: none;
}

/* Icono botón tema */
#theme-toggle i {
  font-size: 1.2rem;
}

/* Welcome Section */
#welcome-section {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, var(--orange) 40%, var(--blue) 90%);
  text-align: center;
  padding: 0 1rem;
}

#welcome-section h1 {
  font-size: 3.5rem;
  color: white;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);
}

/* Projects Section */
#projects {
  padding: 4rem 2rem 6rem;
  max-width: 1200px;
  margin: 0 auto;
}

#projects h2 {
  text-align: center;
  font-size: 2.8rem;
  margin-bottom: 2rem;
  color: var(--orange);
}

/* Grid de proyectos */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-tile {
  background-color: var(--bg-light);
  color: var(--text-light);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.15);
  padding: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body.dark-mode .project-tile {
  background-color: #1f2937;
  color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}

.project-tile:hover,
.project-tile:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px var(--orange);
}

.project-tile a {
  color: inherit;
  text-decoration: none;
  display: block;
}

.project-tile h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.project-tile p {
  font-size: 1rem;
  margin-bottom: 0.8rem;
}

.repo-language,
.repo-updated {
  font-size: 0.9rem;
  color: var(--orange);
}

body.dark-mode .repo-language,
body.dark-mode .repo-updated {
  color: var(--yellow);
}

/* Responsive */
@media (max-width: 720px) {
  #welcome-section h1 {
    font-size: 2.5rem;
  }

  #navbar ul {
    gap: 1rem;
  }
}

@media (max-width: 420px) {
  #welcome-section h1 {
    font-size: 1.8rem;
  }

  #projects h2 {
    font-size: 2rem;
  }

  .project-tile h3 {
    font-size: 1.2rem;
  }

  .project-tile p {
    font-size: 0.9rem;
  }
}

/* Skills Section */
#skills {
  padding: 2rem;
  background: linear-gradient(90deg, var(--orange), var(--blue));
  color: var(--text-light);
}

body.dark-mode #skills {
  color: var(--text);
}

#skills h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 2rem;
}

.languages-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  padding: 0;
  margin: 0 auto;
  max-width: 600px;
}

.languages-list li {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgb(0 0 0 / 0.1);
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.2rem;
  color: #222;
  min-width: 140px;
  cursor: default;
  transition: background-color 0.3s ease;
}

.languages-list li i {
  font-size: 2rem;
  color: var(--orange);
}

.languages-list li:hover {
  background-color: #ffeaa7;
}

/* Contact Section */
#contact {
  padding: 2rem;
  max-width: 600px;
  margin: 0 auto 4rem;
  text-align: center;
}

.contact-links a {
  display: inline-block;
  margin: 0 1rem;
  color: var(--orange);
  text-decoration: none;
  font-size: 1.3rem;
  transition: color 0.3s ease;
}

.contact-links a:hover,
.contact-links a:focus {
  color: var(--yellow);
}

.contact-links i {
  margin-right: 0.5rem;
}
