/* ========================= */
/* ========================= */
/* GENERAL STYLES */
/* ========================= */

/* Basic reset for all elements */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body styles */
body {
  background-color: #000;
  color: #fff;
  font-family: 'Helvetica Neue', sans-serif;
  overflow-x: hidden;
}

/* Global link styles */
a {
  text-decoration: none;
  color: inherit;
}

/* Generic button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  border-radius: 30px;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}

/* ========================= */
/* INTRO ANIMATION */
/* ========================= */

.intro {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

/* Star canvas styles */
canvas#star-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ========================= */
/* MAIN CONTENT */
/* ========================= */

main.contenido {
  padding: 4rem;
  animation: fadeIn 1s ease forwards;
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
}

/* Fade-in animation for main content */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ========================= */
/* TYPOGRAPHY & HEADINGS */
/* ========================= */

h1, h2, h3 {
  color: #fff;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
  font-weight: 600;
}

h1 span {
  color: #00ffcc;
}

h2 {
  font-size: 2rem;
  color: #00ffcc;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  font-size: 1rem;
  line-height: 1.6;
  color: #ddd;
}

/* ========================= */
/* PROFILE SECTION */
/* ========================= */

.perfil {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #00ffcc;
  box-shadow: 0 0 20px rgba(0, 255, 204, 0.4);
  transition: transform 0.3s ease;
}

.avatar:hover {
  transform: scale(1.05);
}

.info .nombre {
  font-size: 2.2rem;
  font-weight: bold;
  color: #fff;
}

.info .rol {
  font-size: 1.2rem;
  color: #00ffcc;
  margin-top: 0.3rem;
}

/* Dynamic name animation */
#nombre-dinamico {
  display: flex;
  justify-content: center;
  gap: 0.1rem;
  user-select: none;
}

#nombre-dinamico span {
  display: inline-block;
  transition: transform 0.2s ease, color 0.2s ease;
  font-size: 2.5rem;
  color: #fff;
}

#nombre-dinamico span:hover {
  transform: scale(1.3);
  color: #00ffcc;
}

/* ========================= */
/* CONTACT SECTION */
/* ========================= */

.contactos {
  text-align: center;
  margin-bottom: 2rem;
}

/* Move contact buttons up and add spacing below */
.contacto-lista {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: -1.5rem; /* Move up */
  margin-bottom: 2.5rem; /* Add space below */
  z-index: 2;
  position: relative;
}

.contacto-social-icono {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: rgba(0, 255, 204, 0.1);
  border: 1px solid #00ffcc;
  box-shadow: 0 4px 15px rgba(0, 255, 204, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, background-color 0.3s ease;
  flex-shrink: 0;
  padding: 0;
}

.contacto-social-icono img {
  width: 24px;
  height: 24px;
  object-fit: cover;
}

.contacto-social-icono:hover {
  background-color: rgba(0, 255, 204, 0.2);
  transform: scale(1.15);
}

@media (max-width: 320px) {
  .contacto-lista {
    gap: 0.5rem;
    margin-top: -1rem;
    margin-bottom: 2rem;
  }
  .contacto-social-icono {
    width: 45px;
    height: 45px;
  }
}

.contacto-item {
  background-color: rgba(0, 255, 204, 0.1);
  border: 1px solid #00ffcc;
  box-shadow: 0 4px 15px rgba(0, 255, 204, 0.2);
}

.contacto-item img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.contacto-item:hover {
  background-color: rgba(0, 255, 204, 0.2);
  transform: translateY(-2px);
}

.contacto-item.solo-icono {
  width: 50px;
  height: 50px;
  padding: 0;
  border-radius: 50%;
  background-color: rgba(0, 255, 204, 0.1);
  border: 1px solid #00ffcc;
  box-shadow: 0 4px 15px rgba(0, 255, 204, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.contacto-item.solo-icono:hover {
  background-color: rgba(0, 255, 204, 0.2);
  transform: scale(1.15);
}

.contacto-item.solo-icono img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

/* ========================= */
/* ABOUT ME SECTION */
/* ========================= */

.sobre-mi {
  max-width: 600px;
  margin: 0 auto 4rem auto;
  padding: 2rem;
  background-color: rgba(255, 255, 255, 0.02);
  border-radius: 20px;
  box-shadow: 0 0 30px rgba(0, 255, 204, 0.1);
}

/* ========================= */
/* PROJECTS SECTION */
/* ========================= */

.proyectos {
  margin-top: 4rem;
  padding: 2rem;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.proyecto {
  background-color: rgba(255, 255, 255, 0.02);
  border-radius: 20px;
  box-shadow: 0 0 30px rgba(0, 255, 204, 0.1);
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  align-items: center;
  view-timeline-name: --proyecto-scroll;
  view-timeline-axis: block;
  animation-name: animarEntradaProyecto;
  animation-duration: 1s;
  animation-fill-mode: both;
  animation-timeline: --proyecto-scroll;
  animation-range: entry 20% cover 50%;
}

@keyframes animarEntradaProyecto {
  from {
    opacity: 0;
    transform: translateY(60px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.logo-proyecto {
  width: 120px;
  height: 120px;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid #00ffcc;
  flex-shrink: 0;
  transition: transform 0.3s ease-in-out;
  view-timeline-name: --proyecto;
  view-timeline-axis: block;
  animation-name: aparecerSuave;
  animation-duration: 1s;
  animation-fill-mode: both;
  animation-timeline: --proyecto;
  animation-range: entry 20% cover 50%;
}

.logo-proyecto:hover {
  transform: scale(1.08);
}

.contenido-proyecto {
  flex: 1;
  color: #ccc;
}

.tecnologias {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tech-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background-color: rgba(0, 255, 204, 0.1);
  border: 1px solid #00ffcc;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  color: #00ffcc;
}

.tech-badge img {
  width: 20px;
  height: 20px;
}

/* Project button */
.proyecto-btn {
  background: linear-gradient(135deg, #00ffcc, #005555);
  color: #000;
}

.proyecto-btn:hover {
  background: linear-gradient(135deg, #00ffaa, #003333);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 255, 204, 0.4);
}

/* ========================= */
/* GENERAL ANIMATIONS & EFFECTS */
/* ========================= */

/* Entry animation classes for IntersectionObserver */
.oculto {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

.mostrar {
  opacity: 1;
  transform: translateY(0);
}

/* ========================= */
/* SCROLL TO TOP BUTTON */
/* ========================= */

#scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: rgba(0, 255, 204, 0.15);
  border: 2px solid #00ffcc;
  border-radius: 50%;
  color: #00ffcc;
  font-size: 1.8rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 999;
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 15px rgba(0, 255, 204, 0.3);
}

#scroll-top:hover {
  background-color: rgba(0, 255, 204, 0.3);
  transform: scale(1.1);
}

#scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ========================= */
/* RESPONSIVE DESIGN */
/* ========================= */

@media (max-width: 768px) {
  main.contenido {
    padding: 1.5rem;
  }
  h1 { font-size: 2rem; }
  #nombre-dinamico span { font-size: 2rem; }
  .perfil { flex-direction: column; text-align: center; }
  .info { margin-top: 1rem; }
  .sobre-mi { padding: 1.5rem; }
  .proyecto { flex-direction: column; text-align: center; }
  .logo-proyecto { margin: 0 auto 1rem auto; }
  .contenido-proyecto h3 { margin-top: 2rem; }
  .tecnologias { justify-content: center; }
  .contacto-lista { flex-direction: column; align-items: center; }
  .contacto-item { width: 80%; max-width: 250px; }
  #scroll-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  main.contenido { padding: 1rem; }
  h1 { font-size: 1.8rem; }
  #nombre-dinamico span { font-size: 1.8rem; }
  h2 { font-size: 1.6rem; }
  h3 { font-size: 1.3rem; }
  p { font-size: 0.9rem; }
  .avatar { width: 80px; height: 80px; }
  .logo-proyecto { width: 100px; height: 100px; }
}
