:root {
  --afor-dig: #110714;
  --primary-text-color: #ffd000;
  --pink-w: #ffd6ff;
  --font-max: 2.8rem;
  --font-med: 1.8rem;
  --font-sm: 1.6rem;
  --font-md: 1.6rem;
  --radius-lg: 40px;
  --radius-md: 20px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  font-family: "Rubik", serif;
  margin: 0;
  padding: 0;
  text-decoration: none;
}

html {
  background-color: var(--afor-dig);
  font-size: 62.5%;
}

/* Skip to content */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 200;
  padding: 10px 20px;
  background: var(--primary-text-color);
  color: var(--afor-dig);
  font-size: 1.6rem;
  font-weight: 600;
  border-radius: 0 0 5px 0;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

*:focus-visible {
  outline: 3px solid var(--primary-text-color);
  outline-offset: 3px;
}

button:hover {
  transform: scale(1.1);
}

/* Nav */
.container-nav {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  overflow: hidden;
  padding: 80px 0;
}

.navbar {
  padding: 0;
  background-color: var(--afor-dig);
}

.nav {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__menu {
  width: 35px;
  height: 35px;
  cursor: pointer;
  z-index: 100;
  border-radius: 5px;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 5px;
}

.nav__menu-bar {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--primary-text-color);
  border-radius: 3px;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

.nav__menu--active .nav__menu-bar:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.nav__menu--active .nav__menu-bar:nth-child(2) {
  opacity: 0;
}

.nav__menu--active .nav__menu-bar:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

.nav__list {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(35, 25, 66, 0.97);
  backdrop-filter: blur(8px);
  padding: 80px 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 2.5rem;
  list-style: none;
  transform: translate(-100%);
  transition: transform 0.4s ease;
  z-index: 50;
}

.nav__list--show {
  transform: translate(0);
}

.nav__list--show .nav__link {
  animation: fadeInNav 0.4s ease forwards;
  opacity: 0;
}

.nav__list--show li:nth-child(1) .nav__link {
  animation-delay: 0.05s;
}

.nav__list--show li:nth-child(2) .nav__link {
  animation-delay: 0.1s;
}

.nav__list--show li:nth-child(3) .nav__link {
  animation-delay: 0.15s;
}

.nav__list--show li:nth-child(4) .nav__link {
  animation-delay: 0.2s;
}

.nav__list--show li:nth-child(5) .nav__link {
  animation-delay: 0.25s;
}

.nav__list--show li:nth-child(6) .nav__link {
  animation-delay: 0.3s;
}

@keyframes fadeInNav {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav__link {
  text-decoration: none;
  color: var(--primary-text-color);
  font-weight: 600;
  font-size: var(--font-med);
}

/* Container (experiencia) */
.container {
  border-radius: var(--radius-lg);
  background: linear-gradient(to right, #24243e, #302b63, #0f0c29);
  border: solid var(--primary-text-color) 2px;
  color: var(--primary-text-color);
  font-size: var(--font-med);
  display: flex;
  margin: 20px;
  padding: 30px;
}

.container-experiencia {
  display: flex;
  justify-self: center;
  max-width: 880px;
  border-radius: var(--radius-md);
}

h2 {
  font-size: var(--font-max);
}

.experiencia > h2 {
  font-size: var(--font-max);
  padding: 10px 20px;
}

.experiencia > p {
  font-size: var(--font-md);
  padding: 10px 20px;
}

.experiencia > h3 {
  font-size: var(--font-md);
  padding: 10px 20px 0;
}

.experiencia > ul {
  padding: 5px 40px;
  font-size: var(--font-md);
}

.experiencia > ul > li {
  margin: 4px 0;
}

/* Proyectos section */
.container-proyectos {
  max-width: 880px;
  flex-direction: column;
  font-size: var(--font-med);
  color: var(--primary-text-color);
  justify-self: center;
}

.proyectos__title {
  margin-top: 40px;
  margin-bottom: 20px;
  padding-top: 40px;
}

.proyectos__subtitle {
  padding-top: 20px;
  margin-bottom: 30px;
  font-weight: 500;
  font-size: var(--font-med);
}

.container-proyectos > article {
  display: grid;
  max-width: 880px;
  grid-template-columns: 1fr 2fr;
  border-radius: var(--radius-lg);
  background: linear-gradient(to right, #24243e, #302b63, #0f0c29);
  border: solid var(--primary-text-color) 2px;
  color: var(--primary-text-color);
  align-items: center;
  padding: 15px;
  margin-bottom: 40px;
  margin-top: 15px;
}

.project-img img {
  width: 380px;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.project-info {
  padding: 10px 20px;
}

.project-info h3 {
  font-size: var(--font-med);
  padding: 5px 0;
}

.project-info p {
  font-size: var(--font-sm);
  padding: 5px 0;
}

.project-features {
  padding: 0 20px;
  font-size: var(--font-sm);
}

.project-features > li {
  margin: 3px 0;
}

.apply-tech > ul {
  display: flex;
  padding: 5px 0;
}

.apply-tech > ul > li {
  text-decoration: none;
  list-style: none;
}

.html {
  background-color: rgb(255, 81, 0);
  color: white;
  font-size: 1.4rem;
  padding: 4px;
  border-radius: 6px;
  margin: 5px;
  font-weight: 600;
}

.css {
  background-color: rebeccapurple;
  color: white;
  font-size: 1.4rem;
  padding: 4px;
  border-radius: 6px;
  margin: 5px;
  font-weight: 600;
}

.js {
  background-color: yellow;
  color: black;
  font-size: 1.4rem;
  padding: 4px;
  border-radius: 6px;
  margin: 5px;
  font-weight: 600;
}

.flask {
  background-color: white;
  color: black;
  font-size: 1.4rem;
  padding: 4px;
  border-radius: 6px;
  margin: 5px;
  font-weight: 600;
}

.mysql {
  background-color: rgb(0, 106, 255);
  color: white;
  font-size: 1.4rem;
  padding: 4px;
  border-radius: 6px;
  margin: 5px;
  font-weight: 600;
}

.python {
  background-color: #3776ab;
  color: white;
  font-size: 1.4rem;
  padding: 4px;
  border-radius: 6px;
  margin: 5px;
  font-weight: 600;
}

.telegram {
  background-color: #0088cc;
  color: white;
  font-size: 1.4rem;
  padding: 4px;
  border-radius: 6px;
  margin: 5px;
  font-weight: 600;
}

.chartjs {
  background-color: #ff6384;
  color: white;
  font-size: 1.4rem;
  padding: 4px;
  border-radius: 6px;
  margin: 5px;
  font-weight: 600;
}

/* Buttons */
.btn-contact {
  display: flex;
  justify-content: center;
  padding: 20px 0;
  align-content: center;
}

.btn-contact > a {
  background-color: white;
  text-decoration: none;
  border-radius: var(--radius-md);
  padding: 0 5px;
  margin: 0 5px;
  display: flex;
}

.btn-projects {
  display: flex;
  justify-content: center;
  padding: 20px 0;
  align-content: center;
}

.btn-projects > a {
  background-color: white;
  border-radius: var(--radius-md);
  padding: 0 5px;
  margin: 0 5px;
  display: flex;
}

.btn-to-see {
  display: flex;
  justify-content: center;
  padding: 20px 0;
  align-content: center;
}

.btn-to-see > a {
  background-color: white;
  text-decoration: none;
  border-radius: var(--radius-md);
  padding: 0 5px;
  margin: 10px;
  display: flex;
}

.btn-ver-mas {
  display: flex;
  justify-content: center;
  padding: 0 0 40px 0;
  align-content: center;
}

.btn-ver-mas > a {
  background-color: white;
  text-decoration: none;
  border-radius: var(--radius-md);
  padding: 0 5px;
  margin: 0 5px;
  display: flex;
  flex-direction: row-reverse;
}

.btn-ver-mas > a > img {
  rotate: 180deg;
}

a > img {
  height: 36px;
}

a > span {
  align-self: center;
}

a > img,
span {
  color: black;
  font-weight: 500;
  padding: 5px;
  font-size: 1.6rem;
}

/* Play project card */
.play-project {
  border-radius: var(--radius-lg);
  background: linear-gradient(to right, #24243e, #302b63, #0f0c29);
  border: solid var(--primary-text-color) 2px;
  color: var(--primary-text-color);
  padding: 25px;
}

.play-project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

/* About me */
.container-about-me {
  display: grid;
  max-width: 880px;
  grid-template-columns: 1fr;
  border-radius: var(--radius-lg);
  background: linear-gradient(to right, #24243e, #302b63, #0f0c29);
  border: solid var(--primary-text-color) 2px;
  color: var(--primary-text-color);
  align-items: center;
  padding: 20px;
  margin: 80px 0;
  justify-self: center;
  font-size: var(--font-med);
}

.about-me {
  padding: 24px 20px;
}

.about-me > h2 {
  padding-bottom: 10px;
}

.about-me > p {
  font-size: var(--font-md);
}

/* Contact */
.container-contact {
  display: grid;
  max-width: 880px;
  grid-template-columns: 1fr;
  margin: 40px auto 60px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(to right, #24243e, #302b63, #0f0c29);
  border: solid var(--primary-text-color) 2px;
  color: var(--primary-text-color);
  align-items: center;
  justify-self: center;
  font-size: var(--font-med);
}

.container-contact h2 {
  font-size: var(--font-max);
  padding: 10px;
}

.container-contact h3 {
  font-size: var(--font-max);
  padding: 10px;
}

.contact-me {
  align-items: center;
}

.contact-me > a {
  margin: 0 40px;
  padding: 0 10px;
}

.contact-me a span {
  height: 36px;
  align-content: center;
}

/* Footer */
footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100px;
}

.final-note {
  width: 420px;
}

footer span {
  color: var(--primary-text-color);
  font-size: var(--font-med);
  align-content: center;
  font-weight: 600;
}

/* Icon CSS badge */
.icon-css {
  display: flex;
  height: 50px;
  width: 50px;
  justify-content: flex-end;
  align-items: flex-end;
  padding: 0.2rem;
  border-radius: 12.5%;
  border-top-left-radius: 0;
  background-color: #673499;
  color: #fefefe;
  font-family: Impact;
  font-size: 16px;
}

.icon-css::before {
  content: "CSS";
}

/* Animations */
@keyframes profileLeft {
  0% {
    opacity: 0;
    transform: translateX(-200px);
  }
  60% {
    opacity: 1;
    transform: translateX(30px);
  }
  80% {
    transform: translateX(-10px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes profileRight {
  0% {
    opacity: 0;
    transform: translateX(200px);
  }
  60% {
    opacity: 1;
    transform: translateX(-30px);
  }
  80% {
    transform: translateX(10px);
  }
  100% {
    transform: translateX(0);
  }
}

/* Carousel */
.carousel {
  position: relative;
  width: 380px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.carousel__track {
  display: flex;
  height: 100%;
  transition: transform 0.5s ease-in-out;
}

.carousel__slide {
  min-width: 100%;
  flex-shrink: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel__media {
  position: relative;
  width: 78%;
  height: 65%;
}

.carousel__media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.carousel__zoom {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.5);
  color: var(--accent-color);
  border: 0;
  outline: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition:
    opacity 0.3s ease,
    background 0.3s ease,
    transform 0.3s ease;
  z-index: 2;
}

.carousel__media:hover .carousel__zoom {
  opacity: 1;
}

.carousel__zoom:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translate(-50%, -50%) scale(1.15);
}

.carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: var(--primary-text-color);
  border: 0;
  outline: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition:
    opacity 0.3s ease,
    background 0.3s ease;
  z-index: 2;
}

.carousel:hover .carousel__arrow {
  opacity: 1;
}

.carousel__arrow:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-50%);
}

.carousel__arrow--left {
  left: 8px;
}

.carousel__arrow--right {
  right: 8px;
}

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px 0 5px;
}

.carousel__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--accent-color);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s ease;
}

.carousel__dot--active {
  background: var(--accent-color);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.lightbox--active {
  display: flex;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox__close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: 0;
  outline: none;
  color: var(--primary-text-color);
  font-size: 3.6rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.3s ease;
}

.lightbox__close:hover {
  color: var(--accent-color);
}

/* Shared media queries */
@media (prefers-reduced-motion: reduce) {
  .carousel__track {
    transition: none;
  }
}

@media (max-width: 768px) {
  .nav__menu {
    display: block;
  }

  .btn-contact {
    flex-direction: column;
    justify-self: center;
  }

  .btn-contact a {
    margin: 8px;
    justify-content: center;
  }

  .btn-contact a span {
    font-size: 1.2rem;
    font-weight: 500;
  }

  .btn-projects a span {
    font-size: 1.2rem;
    font-weight: 500;
    height: 36px;
    align-content: center;
  }

  .container-proyectos {
    margin: 20px 0;
    padding: 30px;
    justify-self: auto;
  }

  .container-proyectos > article {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .project-img img {
    width: 90%;
  }

  .carousel {
    width: 90%;
  }

  .carousel__media {
    width: 90%;
    height: 70%;
  }

  .play-project-img img {
    width: 90%;
  }

  .play-project-img {
    display: flex;
    justify-content: center;
  }

  .container-about-me {
    margin: 40px 30px;
    padding: 15px;
  }
}

@media (min-width: 768px) {
  .nav__menu {
    display: none;
  }

  .navbar {
    padding: 15px 0;
    display: flex;
    justify-content: center;
  }

  .nav__list {
    position: static;
    background: var(--afor-dig);
    padding: 0;
    display: flex;
    gap: 2rem;
    list-style: none;
    transform: unset;
    transition: none;
  }

  .nav__list--show {
    transform: unset;
  }

  .nav__link {
    color: var(--primary-text-color);
    display: block;
  }

  .navbar ul li a:hover {
    background: #555;
    border-radius: 5px;
    padding: 5px;
  }
}

@media (max-width: 450px) {
  .project-info {
    width: 100%;
  }

  .apply-tech ul {
    flex-flow: wrap;
    justify-content: center;
  }

  .btn-to-see {
    flex-direction: column;
    justify-self: center;
  }

  p,
  .experiencia > p,
  .about-me > p {
    font-size: 1.6rem;
    padding: 10px 20px;
  }
}

/* Side projects hidden */
.side-projects-wrapper,
.nav__link[href="#side-projects"],
.btn-ver-mas {
  display: none;
}
