/*==================== GOOGLE FONTS ====================*/
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

/*==================== VARIABLES CSS ====================*/
:root {
  --header-height: 3rem;

  /*========== Colors ==========*/
  --hue-color: 230;

  --first-color: hsl(var(--hue-color), 69%, 61%);
  --first-color-second: hsl(var(--hue-color), 69%, 61%);
  --first-color-alt: hsl(var(--hue-color), 57%, 53%);
  --first-color-lighter: hsl(var(--hue-color), 92%, 85%);
  --body-color: #f5f6fa;
  --container-color: #fff;
  --title-color: #22223b;
  --text-color: #3a3a3a;
  --text-color-light: #6c6c6c;
  --input-color: #f0f0f0;
  --scroll-bar-color: #e0e0e0;
  --scroll-thumb-color: #bdbdbd;

  /*========== Font and typography ==========*/
  --body-font: 'Inter', sans-serif;
  --big-font-size: 2rem;
  --h1-font-size: 1.5rem;
  --h2-font-size: 1.25rem;
  --h3-font-size: 1.125rem;
  --normal-font-size: .938rem;
  --small-font-size: .813rem;
  --smaller-font-size: .75rem;

  --font-medium: 500;
  --font-semi-bold: 600;
  --font-bold: 700;
  --font-extra-bold: 800;

  --mb-0-25: .25rem;
  --mb-0-5: .5rem;
  --mb-0-75: .75rem;
  --mb-1: 1rem;
  --mb-1-5: 1.5rem;
  --mb-2: 2rem;
  --mb-2-5: 2.5rem;
  --mb-3: 3rem;

  --z-tooltip: 10;
  --z-fixed: 100;
  --z-modal: 1000;

  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.2);

  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

[data-theme="dark"] {
  --body-color: hsl(var(--hue-color), 28%, 12%);
  --container-color: hsl(var(--hue-color), 29%, 16%);
  --title-color: hsl(var(--hue-color), 8%, 95%);
  --text-color: hsl(var(--hue-color), 8%, 75%);
  --input-color: hsl(var(--hue-color), 29%, 16%);
  --scroll-bar-color: hsl(var(--hue-color), 12%, 48%);
  --scroll-thumb-color: hsl(var(--hue-color), 12%, 36%);
}

/* Font size for large devices */
@media screen and (min-width: 968px) {
  :root {
    --big-font-size: 3rem;
    --h1-font-size: 2.25rem;
    --h2-font-size: 1.5rem;
    --h3-font-size: 1.25rem;
    --normal-font-size: 1rem;
    --small-font-size: .875rem;
    --smaller-font-size: .813rem;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0 0 var(--header-height) 0;
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  background-color: var(--body-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

h1, h2, h3, h4 {
  color: var(--title-color);
  font-weight: var(--font-semi-bold);
  line-height: 1.2;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  transition: color var(--transition-fast);
}

img {
  max-width: 100%;
  height: auto;
}

/*==================== REUSABLE CSS CLASSES ====================*/
.section {
  padding: 1rem 0 2rem;
}

.section__title {
  font-size: var(--h1-font-size);
  color: var(--title-color);
  font-weight: var(--font-bold);
  margin-bottom: var(--mb-0-5);
}

.section__subtitle {
  display: block;
  font-size: var(--small-font-size);
  margin-bottom: var(--mb-2);
  color: var(--text-color-light);
  font-weight: var(--font-medium);
}

.section__title,
.section__subtitle {
  text-align: center;
}

/*==================== LAYOUT ====================*/
.container {
  max-width: 1200px;
  margin-left: var(--mb-1-5);
  margin-right: var(--mb-1-5);
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.header {
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: var(--z-fixed);
  background-color: var(--body-color);
  backdrop-filter: blur(10px);
  transition: all var(--transition-normal);
}

/*==================== NAV ====================*/
.nav {
  max-width: 968px;
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav__logo,
.nav__toggle {
  color: var(--title-color);
  font-weight: var(--font-bold);
  font-size: 1.2rem;
  transition: color var(--transition-fast);
}

.nav__logo:hover {
  color: var(--first-color);
  transform: scale(1.05);
}

.nav__toggle {
  font-size: 1.1rem;
  cursor: pointer;
}

.nav__toggle:hover {
  color: var(--first-color);
  transform: rotate(90deg);
  transition: transform var(--transition-normal);
}

@media screen and (max-width: 767px) {
  .nav__menu {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    background-color: var(--body-color);
    padding: 2rem 1.5rem 4rem;
    box-shadow: var(--shadow-heavy);
    border-radius: 1.5rem 1.5rem 0 0;
    transition: .3s;
    backdrop-filter: blur(10px);
  }
}

.nav__list {
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.nav__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: var(--small-font-size);
  color: var(--title-color);
  font-weight: var(--font-medium);
  transition: all var(--transition-fast);
  position: relative;
}

.nav__link:hover {
  color: var(--first-color);
  transform: translateY(-2px);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--first-color);
  transition: all var(--transition-normal);
  transform: translateX(-50%);
}

.nav__link:hover::after {
  width: 100%;
}

.nav__icon {
  font-size: 1.2rem;
}

.nav__close {
  position: absolute;
  right: 1.3rem;
  bottom: .5rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--first-color);
  transition: all var(--transition-fast);
}

.nav__close:hover {
  color: var(--first-color-alt);
  transform: rotate(90deg);
}

/* show menu */
.show-menu {
  bottom: 0;
}

/* Active link */
.active-link {
  color: var(--first-color);
}

.active-link::after {
  width: 100%;
}

/* Change background header */
.scroll-header {
  box-shadow: var(--shadow-medium);
  background-color: rgba(var(--body-color), 0.95);
}

/*==================== HOME ====================*/
.home__container {
  gap: 1rem;
}

.home__content {
  grid-template-columns: 0.5fr 3fr;
  padding-top: 3.5rem;
  align-items: center;
}

.home__social {
  display: grid;
  grid-template-columns: max-content;
  row-gap: 1rem;
  margin-top: -2rem;
  align-self: start;
}

.home__social-icon {
  font-size: 1.25rem;
  color: var(--first-color);
  transition: all var(--transition-fast);
}

.home__social-icon:hover {
  color: var(--first-color-alt);
  transform: translateY(-3px);
}

.home__blob {
  width: 200px;
  fill: var(--first-color);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

.home__blob-img {
  width: 170px;
}

.home__data {
  grid-column: 1/3;
}

.home__title {
  font-size: var(--big-font-size);
  font-weight: var(--font-bold);
  margin-bottom: var(--mb-0-5);
  background: linear-gradient(135deg, var(--first-color), var(--first-color-alt));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home__subtitle {
  font-size: var(--h3-font-size);
  color: var(--text-color);
  font-weight: var(--font-medium);
  margin-bottom: var(--mb-0-75);
}

.home__description {
  margin-bottom: var(--mb-2);
  line-height: 1.8;
}

.home__scroll {
  display: none;
}

.home__scroll-button {
  color: var(--first-color);
  transition: .3s;
}

.home__scroll-button:hover {
  transform: translateY(.25rem);
}

.home__scroll-mouse {
  font-size: 2rem;
}

.home__scroll-name {
  font-size: var(--small-font-size);
  color: var(--title-color);
  font-weight: var(--font-medium);
  margin-right: var(--mb-0-25);
}

.home__scroll-arrow {
  font-size: 1rem;
}

.home__title-color {
  color: var(--first-color);
  font-weight: var(--font-bold);
}

.home__buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/*==================== BUTTONS ====================*/
.button {
  display: inline-block;
  background-color: var(--first-color);
  color: #fff;
  padding: 1rem;
  border-radius: .5rem;
  font-weight: var(--font-medium);
  transition: all var(--transition-normal);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left var(--transition-slow);
}

.button:hover::before {
  left: 100%;
}

.button:hover {
  background-color: var(--first-color-alt);
  transform: translateY(-3px);
  box-shadow: var(--shadow-medium);
}

.button--secondary {
  background-color: transparent;
  color: var(--first-color);
  border: 2px solid var(--first-color);
}

.button--secondary:hover {
  background-color: var(--first-color);
  color: #fff;
}

.button--small {
  padding: .75rem 1rem;
  font-size: var(--small-font-size);
}

.button--link {
  padding: 0;
  background-color: transparent;
  color: var(--first-color);
}

.button--link:hover {
  background-color: transparent;
  color: var(--first-color-alt);
}

/*==================== ABOUT ====================*/
.about {
  padding-top: 0.5rem;
}

.about__img {
  justify-self: center;
  align-self: center;
  position: relative;
  transform: translateZ(0);
  will-change: transform;
  /* Eliminar cualquier animación de scroll */
  animation: none;
}

.about__img-pic {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-medium);
  transition: all var(--transition-normal);
  border: 4px solid var(--first-color);
  background: var(--container-color);
  transform: translateZ(0);
  backface-visibility: hidden;
}

.about__img-pic:hover {
  transform: scale(1.02) translateZ(0);
  box-shadow: var(--shadow-heavy);
}

/* Animación sutil de entrada para la imagen */
@keyframes fadeInImage {
  from {
    opacity: 0;
    transform: translateY(10px) translateZ(0);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateZ(0);
  }
}

.about__img {
  /* Sin animación de entrada para evitar movimiento */
}

.about__description {
  text-align: center;
  margin-bottom: var(--mb-2);
  line-height: 1.8;
}

.about__info {
  display: flex;
  justify-content: space-evenly;
  margin-bottom: var(--mb-2);
}

.about__info-title {
  font-size: var(--h2-font-size);
  font-weight: var(--font-semi-bold);
  color: var(--title-color);
}

.about__info-name {
  font-size: var(--smaller-font-size);
}

.about__info-title,
.about__info-name {
  display: block;
  text-align: center;
}

.about__buttons {
  display: flex;
  justify-content: center;
}

/*==================== SKILLS ====================*/
.skills__container {
  max-width: 1200px;
  margin: 0 auto;
}
.stack-groups-grid {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 2rem;
  flex-wrap: nowrap;
}

@media (max-width: 900px) {
  .stack-groups-grid {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }
}
.stack-group-card {
  background: var(--container-color);
  border-radius: 1.3rem;
  box-shadow: 0 4px 18px rgba(0,0,0,0.10);
  border: 1.5px solid rgba(80,80,80,0.07);
  padding: 2.2rem 1.5rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-width: 220px;
  min-height: 220px;
  max-width: 340px;
  width: 100%;
  transition: box-shadow 0.2s, transform 0.2s, background 0.2s;
  position: relative;
  cursor: default;
}
.stack-group-card h3 {
  color: var(--first-color);
  font-size: 1.18rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  text-align: center;
  letter-spacing: 0.5px;
}
.stack-group-card .stack-logos {
  justify-content: center;
  gap: 1.1rem;
  margin-bottom: 0;
}
.stack-group-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.16);
  background: var(--first-color-lighter);
  transform: scale(1.025) translateY(-4px);
  z-index: 2;
  border: 1.5px solid var(--first-color);
}
@media (max-width: 1100px) {
  .stack-groups-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 740px;
  }
}
@media (max-width: 700px) {
  .stack-groups-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
    max-width: 98vw;
  }
  .stack-group-card {
    min-width: 0;
    max-width: 98vw;
    width: 100%;
    padding: 1.2rem 0.7rem 1rem 0.7rem;
  }
}

.skills__header {
  display: flex;
  align-items: center;
  margin-bottom: var(--mb-2);
  cursor: pointer;
  padding: 1rem;
  border-radius: .5rem;
  transition: all var(--transition-normal);
}

.skills__header:hover {
  background-color: rgba(var(--first-color), 0.1);
  transform: translateX(5px);
}

.skills__icon,
.skills__arrow {
  font-size: 2rem;
  color: var(--first-color);
  margin-right: var(--mb-0-75);
}

.skills__icon {
  margin-right: var(--mb-0-75);
}

.skills__title {
  font-size: var(--h3-font-size);
  font-weight: var(--font-semi-bold);
}

.skills__subtitle {
  font-size: var(--small-font-size);
  color: var(--text-color-light);
}

.skills__arrow {
  font-size: 1.25rem;
  transition: transform var(--transition-normal);
}

.skills__list {
  row-gap: 1rem;
  padding-left: 2.7rem;
}

.skills__titles {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--mb-0-5);
}

.skills__name {
  font-size: var(--normal-font-size);
  font-weight: var(--font-medium);
}

.skills__bar,
.skills__percentage {
  height: 5px;
  border-radius: .25rem;
}

.skills__bar {
  background-color: var(--input-color);
  position: relative;
  overflow: hidden;
}

.skills__percentage {
  display: block;
  background: linear-gradient(90deg, var(--first-color), var(--first-color-alt));
  position: relative;
  transition: width var(--transition-slow);
}

.skills__percentage::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skills__django {
  width: 90%;
}

.skills__python {
  width: 85%;
}

.skills__drf {
  width: 80%;
}

.skills__postgresql {
  width: 75%;
}

.skills__html {
  width: 90%;
}

.skills__css {
  width: 80%;
}

.skills__js {
  width: 70%;
}

.skills__react {
  width: 60%;
}

.skills__docker {
  width: 70%;
}

.skills__git {
  width: 85%;
}

.skills__linux {
  width: 75%;
}

.skills__aws {
  width: 60%;
}

.skills__close .skills__list {
  height: 0;
  overflow: hidden;
}

.skills__open .skills__list {
  height: max-content;
  margin-bottom: var(--mb-2-5);
}

.skills__open .skills__arrow {
  transform: rotate(-180deg);
}

/*==================== PORTFOLIO ====================*/
.portfolio__container {
  overflow: initial;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.portfolio__content {
  padding: 1.5rem;
  position: relative;
  background: var(--container-color);
  border-radius: 1rem;
  box-shadow: var(--shadow-medium);
  transition: all var(--transition-normal);
  border: 1px solid rgba(var(--first-color), 0.1);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.portfolio__content:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-heavy);
  border-color: var(--first-color);
}

.portfolio__img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: .5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-light);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.portfolio__img:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-heavy);
}

.portfolio__data {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 100%;
  height: 100%;
  flex: 1;
}

.portfolio__title {
  font-size: var(--h3-font-size);
  margin-bottom: var(--mb-0-5);
  color: var(--title-color);
  font-weight: var(--font-bold);
  line-height: 1.2;
}

.portfolio__description {
  margin-bottom: var(--mb-0-75);
  line-height: 1.7;
  max-width: 100%;
  text-align: left;
  font-size: var(--normal-font-size);
  color: var(--text-color);
}

.portfolio__technologies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--mb-1);
  margin-top: var(--mb-0-5);
}

.portfolio__tech {
  background: linear-gradient(135deg, var(--first-color), var(--first-color-alt));
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: var(--smaller-font-size);
  font-weight: var(--font-medium);
  transition: all var(--transition-fast);
}

.portfolio__tech:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-light);
}

.portfolio__buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: auto;
  justify-content: flex-start;
}

.swiper-container .swiper-pagination-bullet {
  background-color: var(--text-color);
}

.swiper-container .swiper-pagination-bullet-active {
  background-color: var(--first-color);
}

.swiper-button-prev::after,
.swiper-button-next::after {
  content: '';
}

.swiper-portfolio-icon {
  font-size: 2rem;
  color: var(--first-color);
}

.swiper-button-prev {
  color: var(--first-color);
}

.swiper-button-next {
  color: var(--first-color);
}

.swiper-container-horizontal > .swiper-pagination-bullets {
  bottom: -2.5rem;
}

.swiper-pagination-bullet {
  background-color: var(--text-color);
  opacity: 1;
}

.swiper-pagination-bullet-active {
  background-color: var(--first-color);
}

.swiper-button-prev,
.swiper-button-next {
  outline: none;
}

/*==================== CONTACT ====================*/
.contact__container {
  row-gap: 2.5rem;
}

.contact__information {
  display: flex;
  margin-bottom: var(--mb-2);
  align-items: center;
  padding: 1rem;
  border-radius: .5rem;
  transition: all var(--transition-normal);
}

.contact__information:hover {
  background-color: rgba(var(--first-color), 0.1);
  transform: translateX(5px);
}

.contact__icon {
  font-size: 2rem;
  color: var(--first-color);
  margin-right: var(--mb-0-75);
}

.contact__title {
  font-size: var(--h3-font-size);
  font-weight: var(--font-semi-bold);
}

.contact__subtitle {
  font-size: var(--small-font-size);
  color: var(--text-color-light);
}

.contact__content {
  position: relative;
  margin-bottom: var(--mb-0-75);
}

.contact__label {
  position: absolute;
  top: 0;
  left: 1rem;
  font-size: var(--small-font-size);
  color: var(--text-color-light);
  transition: all var(--transition-normal);
  pointer-events: none;
}

.contact__input {
  position: relative;
  width: 100%;
  background-color: var(--input-color);
  color: var(--text-color);
  padding: .75rem 1rem .75rem 1rem;
  border: none;
  outline: none;
  border-radius: .5rem;
  font-size: var(--normal-font-size);
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-light);
}

.contact__input:focus,
.contact__input:not(:placeholder-shown) {
  box-shadow: var(--shadow-medium);
  transform: translateY(-2px);
}

.contact__input:focus + .contact__label,
.contact__input:not(:placeholder-shown) + .contact__label {
  top: -0.5rem;
  left: 0.5rem;
  font-size: var(--smaller-font-size);
  color: var(--first-color);
  background-color: var(--body-color);
  padding: 0 0.25rem;
}

/*==================== FOOTER ====================*/
.footer {
  padding-top: 2rem;
}

.footer__container {
  row-gap: 3.5rem;
}

.footer__bg {
  background-color: var(--first-color);
  padding: 2rem 0 2.5rem;
  border-radius: 1rem 1rem 0 0;
}

.footer__title {
  font-size: var(--h1-font-size);
  margin-bottom: var(--mb-0-25);
  color: #fff;
}

.footer__subtitle {
  font-size: var(--small-font-size);
  color: rgba(255, 255, 255, 0.8);
}

.footer__links {
  display: flex;
  justify-content: center;
  column-gap: 2rem;
}

.footer__link:hover {
  color: #fff;
  transform: translateY(-2px);
}

.footer__social {
  font-size: 1.25rem;
  margin-right: var(--mb-1-5);
  color: #fff;
  transition: all var(--transition-fast);
}

.footer__social:hover {
  color: var(--first-color-lighter);
  transform: translateY(-3px);
}

.footer__copy {
  font-size: var(--smaller-font-size);
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  margin-top: var(--mb-3);
}

.footer__title,
.footer__subtitle,
.footer__link {
  color: #fff;
}

/*==================== SCROLL UP ====================*/
.scrollup {
  position: fixed;
  right: 1rem;
  bottom: -20%;
  background-color: var(--first-color);
  opacity: .8;
  padding: 0 .3rem;
  border-radius: .4rem;
  z-index: var(--z-tooltip);
  transition: .4s;
  box-shadow: var(--shadow-medium);
}

.scrollup:hover {
  background-color: var(--first-color-alt);
  transform: translateY(-3px);
}

.scrollup__icon {
  font-size: 1.5rem;
  color: #fff;
}

/* Show scroll */
.show-scroll {
  bottom: 3rem;
}

/*==================== SCROLL BAR ====================*/
::-webkit-scrollbar {
  width: .60rem;
  background-color: var(--scroll-bar-color);
  border-radius: .5rem;
}

::-webkit-scrollbar-thumb {
  background-color: var(--scroll-thumb-color);
  border-radius: .5rem;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-color-light);
}

/*==================== MEDIA QUERIES ====================*/
/* For small devices */
@media screen and (max-width: 350px) {
  .container {
    margin-left: var(--mb-1);
    margin-right: var(--mb-1);
  }

  .nav__menu {
    padding: 2rem .25rem 4rem;
  }

  .nav__list {
    column-gap: 0;
  }

  .home__content {
    grid-template-columns: .25fr 3fr;
  }

  .home__blob {
    width: 180px;
  }

  .skills__title {
    font-size: var(--normal-font-size);
  }

  .portfolio__container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .portfolio__content {
    padding: 1rem;
  }

  .portfolio__img {
    width: 100%;
    height: 150px;
  }
}

/* For medium devices */
@media screen and (min-width: 568px) {
  .home__content {
    grid-template-columns: max-content 1fr 1fr;
  }

  .home__data {
    grid-column: initial;
  }

  .home__img {
    order: 1;
    justify-self: center;
  }

  .about__container,
  .skills__container,
  .contact__container,
  .footer__container {
    grid-template-columns: repeat(2, 1fr);
  }

  .portfolio__container {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media screen and (min-width: 768px) {
  .container {
    margin-left: auto;
    margin-right: auto;
    max-width: 1200px;
  }

  body {
    margin: 0;
  }

  .section {
    padding: 3rem 0 2rem;
  }

  .section__subtitle {
    margin-bottom: 4rem;
  }

  .header {
    top: 0;
    bottom: initial;
  }

  .header,
  .main,
  .footer__container {
    padding: 0 1rem;
  }

  .nav {
    height: calc(var(--header-height) + 1.5rem);
    column-gap: 1rem;
  }

  .nav__icon,
  .nav__close,
  .nav__toggle {
    display: none;
  }

  .nav__list {
    display: flex;
    column-gap: 2rem;
  }

  .nav__menu {
    margin-left: auto;
  }

  .change-theme {
    margin: 0;
  }

  .home__container {
    row-gap: 5rem;
  }

  .home__content {
    padding-top: 5.5rem;
    column-gap: 2rem;
  }

  .home__blob {
    width: 270px;
  }

  .home__scroll {
    display: block;
  }

  .home__scroll-button {
    margin-left: 3rem;
  }

  .about__container {
    column-gap: 5rem;
  }

  .about__img {
    width: 300px;
    position: relative;
    /* Sin sticky para evitar movimiento */
  }
  
  .about__img-pic {
    width: 280px;
    height: 280px;
    transform: translateZ(0);
  }

  .about__description {
    text-align: initial;
  }

  .about__info {
    justify-content: space-between;
  }

  .about__buttons {
    justify-content: initial;
  }

  .portfolio__container {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }

  .footer__container {
    column-gap: 3rem;
  }

  .footer__bg {
    padding: 3rem 0 3.5rem;
  }

  .footer__links {
    flex-direction: row;
    column-gap: 2rem;
  }

  .footer__socials {
    justify-self: flex-end;
  }

  .footer__links {
    justify-self: center;
  }
}

/* For large devices */
@media screen and (min-width: 1024px) {
  .header,
  .main,
  .footer__container {
    padding: 0;
  }

  .home__blob {
    width: 320px;
  }

  .home__social {
    transform: translateX(-6rem);
    margin-top: -1rem;
  }

  .portfolio__container {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }

  .swiper-portfolio-icon {
    font-size: 3.6rem;
  }

  .swiper-button-prev {
    left: -3.5rem;
  }

  .swiper-button-next {
    right: -3.5rem;
  }

  .swiper-container-horizontal > .swiper-pagination-bullets {
    bottom: -4.5rem;
  }

  .contact__form {
    width: 460px;
  }

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

/*==================== ANIMATIONS ====================*/
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

.slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

/*==================== LOADING ANIMATION ====================*/
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--body-color);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out;
}

.loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--first-color-lighter);
  border-top: 3px solid var(--first-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/*==================== THEME TOGGLE ====================*/
.theme-toggle {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: var(--first-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  z-index: 1000;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-medium);
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-heavy);
}

/*==================== FORM VALIDATION STYLES ====================*/
.contact__form.color-red {
  border: 2px solid #ff4444;
  animation: shake 0.5s ease-in-out;
}

.contact__form.color-green {
  border: 2px solid #00C851;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/*==================== PROJECT FILTERS ====================*/
.portfolio__filters {
  display: flex;
  justify-content: center;
  align-items: center;
  column-gap: .75rem;
  margin-bottom: 2.5rem;
}

.portfolio__filter-btn {
  cursor: pointer;
  color: var(--text-color);
  padding: .25rem .75rem;
  font-weight: var(--font-medium);
  border-radius: .5rem;
  transition: all var(--transition-normal);
}

.portfolio__filter-btn:hover,
.portfolio__filter-btn.active {
  color: var(--first-color);
  background-color: rgba(var(--first-color), 0.1);
}

/*==================== RESPONSIVE IMPROVEMENTS ====================*/
@media screen and (max-width: 480px) {
  .home__buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .button {
    width: 100%;
    max-width: 200px;
  }
  
  .portfolio__technologies {
    justify-content: center;
  }
  
  .contact__inputs {
    grid-template-columns: 1fr;
  }
}

/* STACK TECNOLÓGICO - LOGOS */
.stack-tech-center {
  justify-content: center;
}
.stack-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
  overflow: visible;
}
.stack-logos img {
  width: 64px;
  height: 64px;
  background: var(--container-color);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 14px;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  cursor: pointer;
  position: relative;
  border: 1.5px solid rgba(80,80,80,0.07);
  z-index: 1;
}
.stack-logos img:hover,
.stack-logos img:focus {
  transform: scale(1.18) translateY(-6px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  background: var(--first-color-lighter);
  z-index: 10;
  border: 1.5px solid var(--first-color);
}
.stack-logos img[title]:hover::after,
.stack-logos img[title]:focus::after {
  content: attr(title);
  position: absolute;
  left: 50%;
  top: 112%;
  transform: translateX(-50%);
  background: rgba(30,30,40,0.97);
  color: #fff;
  padding: 0.5em 1.2em;
  border-radius: 0.6em;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  font-size: 1.08em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 1;
  font-weight: 700;
  margin-top: 0.3em;
  letter-spacing: 0.5px;
  z-index: 100;
}
@media (max-width: 700px) {
  .stack-logos img {
    width: 48px;
    height: 48px;
    padding: 8px;
  }
}
@media (max-width: 480px) {
  .stack-logos img {
    width: 36px;
    height: 36px;
    padding: 4px;
  }
}

/* EXPERIENCIA - CARDS */
.experience__container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}
.experience__item {
  background: var(--container-color);
  border-radius: 1.1rem;
  box-shadow: 0 4px 18px rgba(0,0,0,0.10);
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  min-width: 270px;
  max-width: 370px;
  flex: 1 1 320px;
  border: 1.5px solid rgba(80,80,80,0.07);
  transition: box-shadow 0.2s, transform 0.2s;
  margin-bottom: 0.5rem;
}
.experience__item:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.16);
  transform: translateY(-4px) scale(1.02);
}
.experience__item h3 {
  color: var(--first-color);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}
.experience__role {
  font-weight: 600;
  color: var(--title-color);
  margin-bottom: 0.2rem;
  font-size: 1rem;
}
.experience__date {
  color: var(--text-color-light);
  font-size: 0.95em;
  font-weight: 400;
}
.experience__item ul {
  margin: 0.5rem 0 1.2rem 1.2rem;
  padding: 0;
  list-style: disc inside;
  color: var(--text-color);
  font-size: 0.98em;
}

/* EDUCACIÓN - CARDS */
.education__list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.2rem 0 0 0;
  padding: 0;
}
.education__list li {
  background: var(--container-color);
  border-radius: 0.9rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  padding: 1.1rem 1.3rem;
  border: 1.5px solid rgba(80,80,80,0.07);
  font-size: 1em;
  color: var(--text-color);
  font-weight: 500;
  transition: box-shadow 0.2s, transform 0.2s;
}
.education__list li:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.13);
  transform: scale(1.02);
}
.education__list strong {
  color: var(--first-color);
  font-weight: 700;
}

/* HABILIDADES - CHIPS */
.skills__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
  margin-top: 1.2rem;
  margin-bottom: 1.2rem;
  padding: 0;
}
.skills__list li {
  background: var(--container-color);
  border-radius: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  border: 1.5px solid rgba(80,80,80,0.07);
  padding: 0.7em 1.3em;
  font-size: 1em;
  color: var(--text-color);
  font-weight: 500;
  transition: box-shadow 0.2s, transform 0.2s, background 0.2s;
  margin: 0;
  cursor: default;
}
.skills__list li:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.13);
  background: var(--first-color-lighter);
  transform: scale(1.07);
}

/* Subtítulos y separación */
.section__subtitle {
  font-size: 1.05em;
  color: var(--first-color-alt);
  font-weight: 600;
  margin-bottom: 1.2rem;
  letter-spacing: 0.2px;
}

/* Responsividad cards */
@media (max-width: 900px) {
  .experience__container {
    flex-direction: column;
    gap: 1.2rem;
    align-items: center;
  }
  .experience__item {
    max-width: 98vw;
    min-width: 0;
    width: 100%;
  }
}
@media (max-width: 600px) {
  .education__list li {
    font-size: 0.97em;
    padding: 0.8rem 0.7rem;
  }
  .skills__list li {
    font-size: 0.97em;
    padding: 0.5em 1em;
  }
}

.stack-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 2rem;
  justify-items: center;
  align-items: center;
  margin: 2.5rem 0 1.5rem 0;
}
.tech-card {
  background: var(--container-color);
  border-radius: 1.2rem;
  box-shadow: 0 4px 18px rgba(0,0,0,0.10);
  border: 1.5px solid rgba(80,80,80,0.07);
  padding: 1.2rem 1.2rem 0.7rem 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  min-height: 100px;
  max-width: 120px;
  max-height: 120px;
  transition: box-shadow 0.2s, transform 0.2s, background 0.2s;
  position: relative;
  cursor: pointer;
}
.tech-card:hover, .tech-card:focus {
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  background: var(--first-color-lighter);
  transform: scale(1.07) translateY(-4px);
  z-index: 2;
  border: 1.5px solid var(--first-color);
}
.tech-card img {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  display: block;
  background: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  border: none;
}
.tech-card img[title]:hover::after, .tech-card img[title]:focus::after {
  content: attr(title);
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  background: rgba(30,30,40,0.97);
  color: #fff;
  padding: 0.5em 1.2em;
  border-radius: 0.6em;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  font-size: 1.08em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 1;
  font-weight: 700;
  margin-top: 0.3em;
  letter-spacing: 0.5px;
  z-index: 100;
}
@media (max-width: 900px) {
  .stack-cards-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
  }
}
@media (max-width: 600px) {
  .stack-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }
  .tech-card {
    min-width: 80px;
    min-height: 80px;
    max-width: 90px;
    max-height: 90px;
    padding: 0.7rem 0.7rem 0.4rem 0.7rem;
  }
  .tech-card img {
    width: 38px;
    height: 38px;
  }
}

/* Chips de habilidades */
.skills__chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin: 2rem auto 0 auto;
  max-width: 800px;
}
.skill-chip {
  background: var(--primary-gradient, linear-gradient(90deg, #6366f1 0%, #4f46e5 100%));
  color: #fff;
  padding: 0.6em 1.2em;
  border-radius: 2em;
  font-size: 1rem;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(79,70,229,0.08);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: default;
  user-select: none;
}
.skill-chip:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 4px 16px rgba(79,70,229,0.15);
}

/* Acordeón Educación */
.accordion {
  width: 100%;
  max-width: 700px;
  margin: 2rem auto 0 auto;
}
.accordion-item {
  border-radius: 0.7em;
  background: var(--card-bg, #fff);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 1.2rem;
  overflow: hidden;
}
.accordion-header {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  outline: none;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 1.1em 1.5em;
  cursor: pointer;
  color: var(--primary, #4f46e5);
  transition: background 0.2s;
}
.accordion-header[aria-expanded="true"] {
  background: rgba(79,70,229,0.08);
}
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1);
  background: #fafbfc;
  padding: 0 1.5em;
}
.accordion-content.open {
  padding: 1em 1.5em 1.5em 1.5em;
  max-height: 500px;
  transition: max-height 0.5s cubic-bezier(0.4,0,0.2,1);
}

@media (max-width: 600px) {
  .skills__chips-container {
    gap: 0.6rem;
    padding: 0 0.5rem;
  }
  .accordion {
    max-width: 98vw;
  }
  .skill-chip {
    font-size: 0.97rem;
    padding: 0.5em 1em;
  }
}