* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-blue: #1e40af;
  --secondary-blue: #3730a3;
  --light-blue: #dbeafe;
  --dark-gray: #1f2937;
  --medium-gray: #6b7280;
  --light-gray: #f3f4f6;
  --white: #ffffff;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --primary-blue: #3b82f6;
  --secondary-blue: #6366f1;
  --light-blue: #1e3a8a;
  --dark-gray: #f9fafb;
  --medium-gray: #d1d5db;
  --light-gray: #111827;
  --white: #1f2937;
  --shadow: 0 4px 6px -1px rgba(255, 255, 255, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(255, 255, 255, 0.1);
}

body {
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  color: var(--dark-gray);
  background-color: var(--white);
  transition: all 0.3s ease;
}

.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 1rem 0;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

[data-theme="dark"] .navbar {
  background: rgba(31, 41, 55, 0.95);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--dark-gray);
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--primary-blue);
}

.theme-toggle {
  background: none;
  border: 2px solid var(--primary-blue);
  color: var(--primary-blue);
  padding: 0.5rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  background: var(--primary-blue);
  color: var(--white);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 5rem 0;
}

.hero {
  background: linear-gradient(135deg, var(--light-blue) 0%, var(--white) 100%);
  padding: 8rem 0 5rem;
  text-align: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.profile-image img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 4px solid var(--primary-blue);
  background: var(--medium-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--white);
  box-shadow: var(--shadow-lg);
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  color: var(--dark-gray);
  margin-bottom: 0.5rem;
}

.hero .subtitle {
  font-size: 1.5rem;
  color: var(--primary-blue);
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero .description {
  font-size: 1.1rem;
  color: var(--medium-gray);
  max-width: 600px;
  margin: 0 auto;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--dark-gray);
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--primary-blue);
  border-radius: 2px;
}

.education-card,
.tech-grid,
.project-card {
  background: var(--white);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] .education-card,
[data-theme="dark"] .tech-grid,
[data-theme="dark"] .project-card {
  background: var(--light-gray);
}

.education-card:hover,
.project-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.education-card h3 {
  color: var(--primary-blue);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.education-card .institution {
  font-weight: 600;
  color: var(--dark-gray);
  margin-bottom: 0.5rem;
}

.education-card .year {
  color: var(--medium-gray);
  font-style: italic;
}

.tech-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.tech-category h4 {
  color: var(--primary-blue);
  font-size: 1.2rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-tag {
  background: var(--light-blue);
  color: var(--primary-blue);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
}

[data-theme="dark"] .tech-tag {
  background: var(--primary-blue);
  color: var(--white);
}

.tech-tag:hover {
  background: var(--secondary-blue);
  color: var(--white);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

/* --- Tarjeta de proyecto GitHub --- */
.project-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--card-bg, #fff);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  padding: 2rem;
  margin-bottom: 2rem;
  transition: box-shadow 0.3s;
  opacity: 1;
  transform: translateY(0);
}

[data-theme="dark"] .project-card {
  --card-bg: #23272f;
  color: #f3f3f3;
}

.project-header {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.project-icon {
  font-size: 2rem;
  margin-right: 0.75rem;
  color: #24292e;
}

[data-theme="dark"] .project-icon {
  color: #f3f3f3;
}

.project-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #0070f3;
  text-decoration: none;
  transition: color 0.2s;
}

.project-title:hover {
  color: #0051a8;
}

.project-description {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: #444;
}

[data-theme="dark"] .project-description {
  color: #ccc;
}

.tech-tag {
  display: inline-block;
  background: #e3e8ee;
  color: #333;
  border-radius: 8px;
  padding: 0.3em 0.8em;
  font-size: 0.95em;
  margin-right: 0.5em;
  margin-bottom: 0.3em;
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
}

[data-theme="dark"] .tech-tag {
  background: #24292e;
  color: #f3f3f3;
}

.tech-tag:hover {
  background: var(--secondary-blue);
  color: var(--white);
}

.project-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
}

.project-stats {
  display: flex;
  gap: 1.5em;
  font-size: 0.98em;
  color: #555;
}

.project-stats i {
  margin-right: 0.3em;
  color: #fbbf24;
}

.btn.btn-secondary {
  display: inline-block;
  background: #24292e;
  color: #fff;
  margin-top: 0.2em;
  border-radius: 8px;
  padding: 0.6em 1.2em;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s;
  border: none;
  cursor: pointer;
}

.btn.btn-secondary:hover {
  background: var(--secondary-blue);
  color: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary-blue);
  color: var(--white);
  font-weight: 500;
  font-family: "Inter", sans-serif;
  font-size: 1rem;
}

.btn-primary:hover {
  background: var(--secondary-blue);
}

.btn-outline {
  border: 2px solid var(--primary-blue);
  color: var(--primary-blue);
  background: transparent;
}

.btn-outline:hover {
  background: var(--primary-blue);
  color: var(--white);
}

.contact-section {
  background: var(--light-gray);
}

[data-theme="dark"] .contact-section {
  background: linear-gradient(135deg, var(--light-blue) 0%, var(--white) 100%);
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.5rem;
}

.form-group label {
  font-weight: 500;
  color: var(--dark-gray);
}

.form-group input,
.form-group textarea {
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  font-family: inherit;
  transition: border-color 0.3s ease;
  background: var(--white);
  color: var(--dark-gray);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea {
  background: var(--light-gray);
  border-color: #374151;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-blue);
}

.contact-info h3 {
  color: var(--dark-gray);
  margin-bottom: 1.5rem;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--dark-gray);
  text-decoration: none;
  padding: 1rem;
  border-radius: 8px;
  transition: background-color 0.3s ease;
}

.contact-link:hover {
  background: var(--white);
}

[data-theme="dark"] .contact-link:hover {
  background: var(--light-gray);
}

.contact-link i {
  width: 24px;
  text-align: center;
  color: var(--primary-blue);
}

.footer {
  background: var(--dark-gray);
  color: var(--white);
  text-align: center;
  padding: 2rem 0;
}

[data-theme="dark"] .footer {
  background: var(--light-gray);
  color: var(--dark-gray);
}

.mobile-nav {
  display: none;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .mobile-nav {
    display: block;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero .subtitle {
    font-size: 1.2rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .contact-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .tech-categories {
    grid-template-columns: 1fr;
  }

  .project-card {
    padding: 1rem;
  }
  .project-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--primary-blue);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
}

.scroll-to-top.visible {
  opacity: 1;
}

.scroll-to-top:hover {
  background: var(--secondary-blue);
  transform: translateY(-2px);
}
