﻿/* Variables */
:root {
  --body-bg: #242E24;
  --nav-bg: #4f6c57;
  --primary: #cdd7a8;
  --secondary: #467554;
  --accent: #a6e0cb;
  --accent-soft: rgba(166, 224, 203, 0.15);
  --bold-text: #88EBB6;
}

/* General */
* {
  box-sizing: border-box;
}

html, body {
  /*font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;*/
  font-family: "Poppins", sans-serif;
  scroll-behavior: smooth;
  margin: 0;
}

h1 {
  font-size: 5rem;
  color: var(--accent);
}

h2 {
  font-size: 3rem;
  color: var(--primary);
}

.accent-text {
  color: var(--accent);
}

li li strong {
  color: var(--bold-text);
  font-weight: 500;
}

/* ----- Contenido principal ----- */
.page {
  display: flex;
  flex-direction: column !important;
}

.container-main {
  min-height: 100vh;
  width: 100%;
  margin: 0 0 0 0;
  display: flex;
  padding: 0;
}

footer {
  height: 5vh;
  min-width: 100%;
  background: linear-gradient(40deg, var(--body-bg), var(--nav-bg));
  box-shadow: 0 0 20px var(--accent-soft); /* Sombra en la parte superior */
  color: white;
}

.body {
  flex-grow: 1; /* Ocupa todo el espacio disponible IMPORTANTE */
  margin: 0;
  font-size: 2.25rem;
  /*background: var(--body-bg);*/
  background: linear-gradient(90deg, var(--body-bg) 2%, var(--secondary) 80%, var(--primary) 160%);
  color: white;
}

/*  ----- Cuerpo del las secciones  ----- */
header {
  text-align: left;
  margin: 25rem 20% 32rem 20%;
}

section {
  padding: 4rem 0 6rem 0;
  margin: 0 10rem 0 10rem;
}

section h1 {
  margin-bottom: 2rem;
}

/* ----- Menu lateral ----- */
li img {
  margin-top: -60px !important;
  margin-bottom: -10px !important;
}

.nav-pic {
  object-position: 10% 0;
  margin-left: 1.7rem !important;
}

.navbar {
  position: sticky;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  inline-size: fit-content;
  min-height: 100svh;
  background: linear-gradient(200deg, var(--nav-bg) 10%, var(--accent) 50%, var(--nav-bg) 100%);
}

.navbar::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 4px;
  background: linear-gradient(to right, transparent, rgba(39, 54, 40, 0.6));
  z-index: -1;
  pointer-events: none;
}

.nav-list {
  position: sticky;
  top: 2em;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 5rem;
  padding-block: 2rem;
  font-size: 2.5rem;
}

.nav-list a {
  text-decoration: none;
  text-wrap: nowrap;
  font-weight: bold;
  color: black;
  padding: 5px 10px;
}

.nav-list li.active a {
  background-image: linear-gradient(45deg, var(--accent), var(--primary));
  background-clip: text;
  color: transparent;
  font-weight: bold;
}

.nav-list li {
  padding: 1.4rem 2rem;
  margin-inline-start: 2rem;
  border-radius: 100vw 0 0 100vw;
}

.nav-list li.active {
  background: var(--body-bg);
  position: relative;
  animation: moveToActive 0.8s ease forwards; /*  animacion  */
  box-shadow: 25px 15px 0.8em var(--body-bg);
}

.nav-list li.active::before,
.nav-list li.active::after {
  --border-radius: 2rem;
  content: "";
  position: absolute;
  width: var(--border-radius);
  height: var(--border-radius);
  right: 0;
  background: transparent;
  border-radius: 50%;
}

.nav-list li.active::before {
  top: calc(var(--border-radius) * -1);
  border-radius: 0 0 100vw 0;
  box-shadow: 10px 10px 0 10px var(--body-bg);
  transform: translateZ(0); /* Solucion para evitar la aparicion de lineas buggeadas*/
}

.nav-list li.active::after {
  bottom: calc(var(--border-radius) * -1);
  border-radius: 0 100vw 0 0;
  box-shadow: 10px -10px 0 10px var(--body-bg);
  transform: translateZ(0);
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes moveToActive {
    from {
      transform: translateY(25%);
    }
    30% {
      transform: translateY(-15%);
    }
    to {
      transform: translateY(0);
    }
  }
}
/*  ----- Main page / Header ----- */
.name-and-image {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.profile-pic {
  border: 1.2px solid var(--body-bg);
  border-radius: 50%;
  inline-size: 10rem;
  aspect-ratio: 1;
  object-fit: cover;
  margin: 0 0 2rem 1rem;
  box-shadow: 0 10px 50px var(--accent-soft);
  transition: transform ease 0.3s, filter ease 0.8s;
}

.profile-pic:hover {
  transform: translateY(-3 %);
  filter: drop-shadow(0 10px 60px var(--accent-soft));
}

about-content h1 {
  text-wrap: balance;
}

about-content h2 {
  text-wrap: nowrap;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  align-items: center;
}

.flex-items {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.resume-btn {
  position: relative;
  padding: 12px 24px;
  border: none;
  outline: none;
  border-radius: 0.6rem;
  font-weight: 600;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  background: linear-gradient(90deg, rgb(42, 123, 155) 0%, rgb(87, 199, 133) 98%, rgb(83, 190, 130) 100%, rgb(79, 179, 127) 100%);
  color: black;
  position: relative;
  overflow: hidden;
}

.resume-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.7s ease;
}

.resume-btn:hover::before {
  left: 100%;
}

.hand {
  position: absolute;
  margin-left: 25%;
  margin-top: 22rem;
  font-size: 3rem;
  text-decoration: none;
  animation: bounce 1.8s infinite;
  color: black;
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes bounce {
    0%, 100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(10px);
    }
  }
}
/*  ----- Tecnologias ----- */
article {
  display: flex;
  flex-direction: column;
  border-radius: 1rem;
  box-shadow: 0 3px 8px 3px rgba(0, 0, 0, 0.6);
  padding: 2rem 1rem 1rem 1rem;
  text-align: center;
  transition: transform ease 0.3s, box-shadow ease 0.3s;
  overflow-wrap: break-word;
}

article:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px 3px rgba(0, 0, 0, 0.6);
}
article:hover .tech-card {
  transform: translateY(-5px);
  box-shadow: 0 2px 15px 10px rgba(0, 0, 0, 0.2);
}

.cards-container {
  display: grid;
  padding: 2em 4em 0 4em;
  gap: 10rem;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
}

.tech-card {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 1rem;
  margin-top: 2rem;
  background-color: antiquewhite;
  padding: 1rem 0 1rem 0;
  box-shadow: 0 3px 12px 1px var(--body-bg);
  transition: transform ease 0.3s, box-shadow ease 0.1s;
}

.tech-icons img {
  inline-size: 5rem;
  aspect-ratio: 1;
  object-fit: contain;
  margin: 0.3rem 0 0 1.3rem;
}

@media (max-width: 1800px) {
  .cards-container {
    gap: 5rem;
  }
  h2 {
    font-size: 2.2rem;
  }
  article {
    font-size: 1.7rem;
    height: auto; /* Ajusta la altura al contenido */
    max-height: fit-content; /* Asegura que no exceda la altura del contenido */
  }
}
/*  ----- Sobre mi ----- */
#sobre-mi-section p {
  margin-bottom: -1rem;
}

/*  ----- Formacion ----- */
.tech-courses {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4rem;
  justify-content: center;
}

.tech-courses img {
  inline-size: 10em;
  aspect-ratio: 1;
  object-fit: contain;
  margin: 0.3rem 0 0 1.3rem;
}

/* tooltips */
.custom-tooltip {
  position: relative;
  flex-shrink: 1;
}

.custom-tooltip::before {
  content: attr(data-custom-tooltip);
  position: absolute;
  left: 50%;
  transform: translateX(-40%);
  bottom: 6rem;
  width: fit-content;
  padding: 0.2rem 1rem 0.2rem 1rem;
  z-index: 10;
  border-radius: 0.4em;
  background-color: #000;
  color: var(--accent);
  text-align: center;
  text-wrap: nowrap;
  font-size: 0.55em;
  visibility: hidden;
  opacity: 0.01;
  transition: opacity 0.2s;
}

.custom-tooltip:hover::before {
  visibility: visible;
  opacity: 1;
}

.custom-tooltip.tooltip-webp::before {
  bottom: 22rem;
  left: 45%;
}

/*  ----- Contacto ----- */
.email-box {
  display: inline-flex;
}

[href^="mailto:"]::after {
  content: "";
  display: inline-block;
  width: 1.5rem;
  margin-bottom: 4px;
  aspect-ratio: 1;
  background-image: url(/images/icoicons/external-link.ico);
  background-size: contain;
  filter: invert(100%);
}

button::after {
  content: "";
  position: absolute;
  left: 85%;
  width: 1rem;
  margin-bottom: 1px;
  aspect-ratio: 1;
  background-image: url(/images/icoicons/external-link.ico);
  background-size: contain;
}

#contacto a {
  position: relative;
  display: inline-block;
  text-decoration: none;
  color: var(--primary);
  transition: color 0.2s ease;
  padding-bottom: 2px;
}

#contacto a::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  transform: scaleX(0);
  background-color: var(--accent);
  transform-origin: bottom left;
  transition: transform 0.2s ease-in-out;
}

#contacto a:hover::before {
  transform: scaleX(1);
}

.copy-icon {
  display: inline-block;
  inline-size: 1.5rem;
  aspect-ratio: 1;
  object-fit: contain;
  margin-left: 1rem;
  cursor: pointer;
  filter: invert(100%) contrast(200%);
  transition: transform ease 0.2s;
}

.copy-anchor {
  display: flex;
  position: relative;
  flex-shrink: 1;
}

.custom-tooltip-icon {
  position: absolute;
  left: 60%;
  transform: translateX(-50%) translateY(0);
  bottom: 5.2rem;
  width: fit-content;
  padding: 0.2rem 1rem 0.2rem 1rem;
  z-index: 10;
  border-radius: 0.4em;
  background-color: #000;
  color: var(--accent);
  text-align: center;
  text-wrap: nowrap;
  font-size: 0.55em;
  opacity: 0.01;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.custom-tooltip-icon.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-5px);
}
