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

html {
  scroll-behavior: smooth;
}

:root {
  --bg-color: #fdfdfd;
  --text-color: #1a1a1a;
  --card-bg: #f3f4f6;
  --accent-color: #ff6b6b;
}

body.dark-mode {
  --bg-color: #121212;
  --text-color: #f1f1f1;
  --card-bg: #1e1e1e;
  --accent-color: #ff8787;
}

 body.dark-mode .hero {
  background-color: #121212;
} 

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: "Work Sans", sans-serif;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== Tipografía ===== */
h1,
h2,
h3 {
  font-family: "Fugaz One", sans-serif;
  color: var(--text-color);
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

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

p {
  font-size: 1rem;
  margin-bottom: 1rem;
}

a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-color);
}

/* ===== Espaciado Global ===== */
header,
section,
footer {
  padding: 2rem 1rem;
}

/* ===== Navegación ===== */
.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-color);
}

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

.nav-links li {
  display: flex;
  align-items: center;
}

.nav-links a {
  font-weight: 600;
  transition: color 0.3s ease;
}

.nav-links button {
  all: unset;
  cursor: pointer;
  color: var(--text-color);
  display: flex;
  align-items: center;
  transition: color 0.3s ease;
}

#theme-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 4rem 1rem;
  background-color: #fdfdfd;
}

.hero-text h2 {
  margin-bottom: 0.5rem;
  animation: fadeSlideDown 0.6s ease forwards;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.social-links svg {
  width: 24px;
  height: 24px;
  fill: var(--text-color);
  transition: fill 0.3s ease;
}

/* ===== Proyectos ===== */
#projects {
  text-align: center;
}

#projects h2 {
  margin-bottom: 2rem;
}

.project-area {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--card-bg);
  border: 1px solid #ddd;
  padding: 1rem;
  border-radius: 8px;
  transition: box-shadow 0.2s ease;
}

.project-card:hover {
  animation: bounceCard 0.3s ease forwards;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.project-card a {
  font-weight: 600;
  color: var(--accent-color);
}

.project-card a:hover {
  text-decoration: underline;
}

.project-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

body.dark-mode .project-links {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.code-link {
  font-family: "Work Sans", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

.code-link:hover {
  color: var(--text-color);
  text-decoration: none;
}

.deploy-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--accent-color);
  color: var(--bg-color);
  transition: all 0.3s ease;
}

.deploy-link:hover {
  background-color: var(--text-color);
  transform: scale(1.1);
}

.deploy-link svg {
  width: 16px;
  height: 16px;
  stroke: var(--bg-color);
}

/* ===== Footer ===== */
footer {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-color);
  border-top: 1px solid #ddd;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.footer-links a {
  font-size: 0.9rem;
}

/* ===== Animaciones ===== */
@keyframes fadeSlideDown {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounceCard {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
  100% {
    transform: translateY(-4px);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

@keyframes wiggle {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(2deg);
  }
  75% {
    transform: rotate(-2deg);
  }
}

.nav-links button:hover,
.social-links svg:hover {
  animation: pulse 0.3s ease;
  color: var(--accent-color);
  fill: var(--accent-color);
}

/* ===== Logo Wiggle ===== */
.logo {
  display: inline-block;
  transition: color 0.3s ease;
}

.logo:hover {
  animation: wiggle 0.4s ease;
  color: var(--accent-color);
}

/* ===== Responsive para móviles (≤ 600px) ===== */
@media (max-width: 725px) {
  header {
    position: relative;
    padding: 1rem;
  }

  .nav-bar {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .menu-toggle {
    display: block;
    z-index: 100;
  }

  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-color);
    border: 1px solid #ddd;
    border-top: none;
    width: 100%;
    padding: 1rem;
    display: none;
    z-index: 99;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links li {
    margin-bottom: 1rem;
    width: 100%;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 0.5rem 0;
  }

  #theme-toggle {
    align-self: flex-start;
    margin-top: 0.5rem;
  }

  body.dark-mode .nav-links {
    border-color: #333;
  }

  .logo {
    font-size: 1.5rem;
  }

  .hero {
    padding: 3rem 1rem;
    background-size: 120px;
  }

  .hero-text h2 {
    font-size: 1.8rem;
  }

  .hero-text p {
    font-size: 0.95rem;
  }

  .social-links svg {
    width: 20px;
    height: 20px;
  }

  .project-area {
    grid-template-columns: 1fr;
  }

  footer {
    font-size: 0.85rem;
  }
}

/* ===== Responsive para tabletas (601px a 900px) ===== */
@media (min-width: 726px) and (max-width: 900px) {
  .hero {
    padding: 3.5rem 2rem;
    background-size: 160px;
  }

  .hero-text h2 {
    font-size: 2.2rem;
  }

  .hero-text p {
    font-size: 1rem;
  }

  .project-area {
    grid-template-columns: repeat(2, 1fr);
  }

  .logo {
    font-size: 2rem;
  }

  .social-links svg {
    width: 22px;
    height: 22px;
  }

  footer {
    font-size: 0.9rem;
  }
}
