@font-face {
  font-family: "Hk Grotesk";
  font-style: normal;
  font-weight: 400;
  src: url("./fonts/HKGrotesk-Regular.woff") format("woff");
}

@font-face {
  font-family: "Jost";
  font-style: normal;
  font-weight: 400;
  src: url("./fonts/Jost-Regular.ttf") format("woff");
}

* {
  margin: 0;
  padding: 0;
  box-sizing: inherit;
}

:root {
  --font-size-small: 1.8rem;
  --font-size-normal: 2.2rem;
  --font-size-medium: 2.8rem;
  --font-size-medium-1: 3.6rem;
  --font-size-large: 5.5rem;
  --font-size-huge: 7.5rem;
  --font-stack: "Hk Grotesk", sans-serif;

  --line-height-normal: 1.7;
  --line-height-small: 1.2;

  --black: #000;
  --pink: #00b5fcde;
  --white: #f0e9f2;
  --white-1: #e5e5e6da;

  --container-max-width: 1180px;
  --container-normal-width: 800px;
  --container-medium-width: 700px;
  --container-small-width: 500px;

  --gutter-huge: 12rem;
  --gutter-medium: 6rem;
  --gutter-normal: 3rem;
  --gutter-small-1: 2.5rem;
  --gutter-small: 2rem;

  --border-light: 1px solid rgb(36, 35, 35);
}

html {
  font-size: 62.5%;
  /* (16/10)*100 = 62.5% => 1rem = 10px */
  box-sizing: border-box;
  scroll-behavior: smooth;
}

@media (max-width: 1000px) {
  html {
    font-size: 52%;
  }
}

body {
  font-size: var(--font-size-small);
  font-family: var(--font-stack);
  font-weight: 400;
  color: var(--white-1);
  line-height: var(--line-height-normal);
  background: var(--black);
  overflow-x: hidden;
}

.row {
  max-width: var(--container-max-width);
  margin: 0 auto;
}

.column {
  max-width: var(--container-max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  text-align: center;
  justify-content: center;
  filter: invert(100%) grayscale(80%) opacity(0.8);
  transition: filter 0.3s, background-color 0.3s;
  padding: 10px;
}

.column:hover {
  filter: none;
  background-color: #fff;
  border-radius: 10px;
}

@media (max-width: 1340px) {
  .row {
    max-width: 1100px;
  }
}

@media (max-width: 1240px) {
  .row {
    padding: 0 var(--gutter-medium);
  }
}

@media (max-width: 600px) {
  .row {
    padding: 0 var(--gutter-normal);
  }
}

@media (max-width: 600px) {
  .row {
    padding: 0 var(--gutter-small);
  }
}

section {
  padding: var(--gutter-huge) 0;
  border-bottom: var(--border-light);
}

img {
  object-fit: contain;
  max-width: 100%;
}

/* --------------------------------------- */
/* ----- Headlines and Paragraphs ----- */
/* --------------------------------------- */

h1,
h2,
h3 {
  font-family: "Jost", sans-serif;
  font-weight: 400;
  line-height: var(--line-height-small);
  color: var(--white);
}

.heading-primary {
  line-height: 1;
  font-size: var(--font-size-huge);
  font-weight: 400;
}

@media (max-width: 900px) {
  .heading-primary {
    margin-top: 30%;
    font-size: 6.5rem;
  }
}

h2 {
  font-size: var(--font-size-large);
  margin-bottom: var(--gutter-medium);
}

h2::after {
  content: "";
  display: block;
  height: 2px;
  width: 10rem;
  background: var(--pink);
  margin: var(--gutter-small) 0;
}

h3 {
  font-size: var(--font-size-medium-1);
  margin-bottom: var(--gutter-small);
}

@media (max-width: 500px) {
  .heading-primary {
    font-size: var(--font-size-large);
  }

  h2 {
    font-size: var(--font-size-medium-1);
  }

  h3 {
    font-size: var(--font-size-medium);
  }

  .location {
    display: block;
  }
}

p {
  margin: var(--gutter-small-1) 0;
  text-align: justify;
}

@media (max-width: 900px) {
  p {
    max-width: var(--container-small-width);
  }

  .location {
    display: block;
  }
}

/* --------------------------------------- */
/* ----- Buttons and Links ----- */
/* --------------------------------------- */

a {
  color: var(--white);
  font-weight: 400;
  font-family: "Jost", sans-serif;
  transition: all 0.2s;
  outline: 2px solid transparent;
}

::-moz-focus-inner {
  border: 0;
}

button:focus,
a:focus {
  outline: 2px solid var(--pink);
}

body:not(.user-is-tabbing) button:focus,
body:not(.user-is-tabbing) a:focus {
  outline: none;
}

.link:hover {
  color: var(--pink);
}

.btn {
  position: relative;
  display: inline-block;
  padding: 1rem 4.2rem;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--pink);
  font-weight: 400;
  margin-top: 0.4rem;
  text-align: center;
  width: 280px;
  margin-right: 25px;
}

.btn:focus {
  outline: none;
}

.btn::after {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 100%;
  background: var(--white);
  height: 100%;
  z-index: -1;
  transition: all 0.2s cubic-bezier(1, 0.68, 0.16, 0.9);
}

.btn:hover::after,
.btn:focus::after {
  right: 0;
  background: var(--pink);
}

.btn--pink {
  background: var(--pink);
  transition: all 0.2s;
}

.btn--pink::after {
  display: none;
}

.btn--pink:hover,
.btn--pink:focus {
  background: transparent;
}

.link__text {
  position: relative;
  display: inline-block;
  padding: 0.6rem;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--pink);
}

.link__text::after {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 100%;
  background: var(--white);
  height: 100%;
  z-index: -1;
  transition: all 0.2s cubic-bezier(1, 0.68, 0.16, 0.9);
}

.link__text:focus {
  outline: none;
}

.link__text:hover::after,
.link__text:focus:after {
  right: 0;
  background: var(--pink);
}

.link__text span {
  padding-left: 1rem;
  font-family: sans-serif;
}

/* ----- Back to Top ----- */

.back-to-top {
  position: fixed;
  bottom: 7rem;
  right: 4rem;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 5.5rem;
  width: 5.5rem;
  background-color: var(--pink);
  border-radius: 50%;
  z-index: 10;
  visibility: hidden;
  transition: all 0.4s;
}

.back-to-top__image {
  height: 70%;
}

@media (max-width: 900px) {
  .back-to-top {
    right: 2rem;
  }
}

@media (max-width: 500px) {
  .back-to-top {
    right: 1rem;
  }
}

.whatsapp {
  position: fixed;
  bottom: 1rem;
  right: 4rem;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 5.5rem;
  width: 5.5rem;
  border-radius: 50%;
  z-index: 10;
}

@media (max-width: 900px) {
  .whatsapp {
    right: 2rem;
  }
}

@media (max-width: 500px) {
  .whatsapp {
    right: 1rem;
  }
}

/* --------------------------------------- */
/* ----- Navigation ----- */
/* --------------------------------------- */

.nav {
  display: flex;
  justify-content: flex-start;
  padding: var(--gutter-normal) 0;
  position: absolute;
  transition: all 0.5s ease;
}

.nav__items {
  display: flex;
  list-style: none;
}

.nav__item:not(:last-child) {
  margin-right: var(--gutter-medium);
}

@media (max-width: 500px) {
  .nav {
    justify-content: center;
  }
}

@media (max-width: 400px) {
  .nav__item:not(:last-child) {
    margin-right: var(--gutter-normal);
  }
}

@media (max-width: 300px) {
  .nav {
    font-size: var(--font-size-small);
  }
}

.nav__link {
  position: relative;
  display: inline-block;
  padding: 1rem 0;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.nav__link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 100%;
  display: inline-block;
  height: 1rem;
  background: var(--white);
  transition: all 0.25s cubic-bezier(1, 0.68, 0.16, 0.9);
}

.nav__link:hover {
  color: var(--pink);
}

.nav__link:hover::after {
  right: 0;
  height: 2px;
  background: var(--pink);
}

/* --------------------------------------- */
/* ----- Header ----- */
/* --------------------------------------- */

.header {
  background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)),
    url("./images/header.jpeg");
  height: 100vh;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  font-size: var(--font-size-normal);
}

.header__text {
  position: absolute;
  top: 50%;
}

.header__text p {
  margin: 1.5rem 0 3.5rem;
  max-width: var(--container-medium-width);
  font-family: "Jost", sans-serif;
  font-size: var(--font-size-medium);
}

@media (max-width: 500px) {
  .header {
    text-align: center;
  }

  .header__text p {
    transform: scale(0.8);
    width: 80%;
    margin-left: 10%;
    margin-right: 10%;
  }
}

/* --------------------------------------- */
/* ----- Work ----- */
/* --------------------------------------- */

.work__box {
  display: flex;
  align-items: center;
}

@media (max-width: 900px) {
  .work__box {
    align-items: initial;
    flex-direction: column;
  }
}

.work__box:not(:last-child) {
  margin-bottom: 25rem;
}

@media (max-width: 500px) {
  .work__box:not(:last-child) {
    margin-bottom: 20rem;
  }
}

.work__links {
  display: flex;
  align-items: center;
}

.work__text {
  flex: 0 0 30%;
}

.work__list {
  /* list-style-type: square; */
  list-style-position: inside;
  margin-bottom: var(--gutter-normal);
}

.work__code {
  display: block;
  height: 3rem;
  margin-left: var(--gutter-normal);
  transition: all 0.3s;
}

.work__code:hover {
  transform: scale(1.2);
}

.work__image-box {
  margin-bottom: var(--gutter-normal);
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.404);
  border-radius: 10px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

.grid-container img {
  width: 100%;
  height: auto;
  border-radius: 5px;
  transition: transform 0.3s ease-in-out;
}

.grid-container img:hover {
  transform: scale(2.5);
}

@media (max-width: 600px) {
  .grid-container {
      grid-template-columns: repeat(2, 1fr); /* 2 columnas en pantallas pequeñas */
  }
}

@media (max-width: 400px) {
  .grid-container {
      grid-template-columns: repeat(1, 1fr); /* 1 columna en pantallas muy pequeñas */
  }
}

@media (min-width: 901px) {
  .work__image-box {
    flex: 1;
    margin: 0 0 0 10rem;
  }  
}

@media (max-width: 900px) {
  .work__code {
    height: 4rem;
  }
}

/* --------------------------------------- */
/* ----- Clients ----- */
/* --------------------------------------- */

.client__logos {
  display: flex;
  justify-content: space-between;
  color: grey;
}

.logos {
  filter: invert(100%) grayscale(80%) opacity(0.8);
  transition: filter 0.3s, background-color 0.3s;
  padding: 10px;
}
.logos:hover {
  filter: none;
  background-color: #fff;
  border-radius: 10px;
}

a {
  text-decoration: none;
  color: grey;
}

.client__logo {
  height: 6.5rem;
  max-width: 18rem;
}

@media (max-width: 1240px) {
  .client__logos {
    overflow-x: scroll;
    padding: var(--gutter-normal);
  }

  .client__logo:not(:last-of-type) {
    margin-right: var(--gutter-medium);
  }
}

/* --------------------------------------- */
/* ----- About ----- */
/* --------------------------------------- */

.about__content {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
}

@media (max-width: 900px) {
  .about__content {
    flex-direction: column-reverse;
    align-items: initial;
  }
}

.about__photo-container {
  margin-bottom: var(--gutter-normal);
  background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)),
    url("./images/1.jpeg");
  padding-top: 2rem;
  height: 73.7vh;
  display: flex;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  font-size: var(--font-size-normal);
  border-radius: 20%;
}

.about__photo {
  border-radius: 50%;
}

@media (min-width: 901px) {
  .about__text {
    flex: 0 0 35%;
  }

  .about__photo-container {
    flex: 1;
    margin: 0 var(--gutter-huge) 0 0;
  }
}

/* --------------------------------------- */
/* ----- Contact ----- */
/* --------------------------------------- */

.contact__info {
  max-width: var(--container-medium-width);
}

/* --------------------------------------- */
/* ----- Footer ----- */
/* --------------------------------------- */

.footer {
  text-align: center;
  padding: var(--gutter-medium) 0 var(--gutter-normal);
}

.footer__social-links {
  display: flex;
  justify-content: center;
  padding: var(--gutter-normal) 0;
  list-style: none;
}

.footer__social-link-item:not(:last-of-type) {
  margin-right: var(--gutter-small);
  /* margin-top: var(--gutter-small); */
}

.footer__social-image {
  height: 4rem;
}

.footer__github-buttons {
  display: flex;
  justify-content: center;
}

.footer__github-buttons iframe {
  height: 2.5rem;
  width: 84px;
  transform: translateY(3px);
}

@media (max-width: 500px) {
  .footer {
    padding: var(--gutter-medium) 0;
  }
}

/* --------------------------------------- */
/* ----- Hamburger Menu ----- */
/* --------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

.main {
  position: relative;
  text-align: left;
  padding-top: 100px;
  margin-left: 11%;
}

.hamburger {
  position: relative;
  width: 70px;
  height: 70px;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  padding: 20px;

  &:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #383838;
    /* fallback for old browsers */
    background: -webkit-linear-gradient(to right, #383838, #383838);
    /* Chrome 10-25, Safari 5.1-6 */
    background: linear-gradient(to right, #383838, #383838);
    /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
    transform: rotate(0deg);
    transition: all 0.4s cubic-bezier(0.54, -0.1, 0.57, 0.57);
  }

  .hamburger-input {
    position: absolute;
    opacity: 0;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    cursor: pointer;
  }

  .hamburger-line {
    width: 100%;
    background: #fff;
    height: 2px;
    display: block;
    border-radius: 6px;
    transition: transform 0.4s cubic-bezier(0.54, -0.81, 0.57, 0.57);
    position: relative;

    &.first,
    &.third {
      width: 50%;
    }

    &.third {
      margin-left: 50%;
      transform-origin: left;
    }
  }
}

.menu-button-wrapper {
  position: relative;
  display: inline-block;

  .item-list {
    position: absolute;
    top: 0px;
    right: 0%;
    transform: translateX(100%) scaleY(0) translateY(-100%);
    transform-origin: top;
    transition: all 0.4s cubic-bezier(0.54, -0.1, 0.57, 0.57);
    color: #fff;
    padding: 15px 0 0 35px;
    opacity: 0;
    user-select: none;
    display: flex;
    flex-direction: row;

    div {
      padding: 10px 30px;
      cursor: pointer;
    }
  }

  .menu-button {
    position: absolute;
    width: 70px;
    height: 70px;
    left: 0;
    z-index: 2;
    opacity: 0;
    cursor: pointer;
  }
}

.menu-button {
  &:checked ~ .item-list {
    transform: translateX(100%) scaleY(1);
    opacity: 1;
    user-select: auto;
  }

  &:checked ~ .icon-wrapper .hamburger-line.second {
    transform: rotate(-45deg);
  }

  &:checked ~ .icon-wrapper .hamburger-line.first {
    transform: translate(2px, 8px) rotate(-135deg);
  }

  &:checked ~ .icon-wrapper .hamburger-line.third {
    transform: translate(11px, -3px) rotate(-135deg);
  }

  &:checked ~ .icon-wrapper .hamburger:before {
    transform: rotate(45deg);
  }
}

@media (max-width: 500px) {
  .menu-button-wrapper {
    position: relative;
    display: inline-block;

    .item-list {
      position: absolute;
      top: 90px;
      right: 100%;
      transform: translateX(-50%) scale(0);
      transform-origin: center;
      transition: all 0.4s cubic-bezier(0.54, -0.1, 0.57, 0.57);
      color: #fff;
    }
  }
}

@media (max-width: 768px) {
  .menu-button-wrapper {
    position: relative;
    display: inline-block;

    .item-list {
      position: absolute;
      top: 90px;
      right: 100%;
      transform: translateX(-50%) scale(0);
      transform-origin: center;
      transition: all 0.4s cubic-bezier(0.54, -0.1, 0.57, 0.57);
      color: #fff;
      font-size: medium;

      div {
        cursor: pointer;
      }
    }
  }
}

.switch {
  display: flex;
  flex-direction: column;
  padding-right: 10%;
  justify-content: end;
  align-items: end;
  position: relative;
}

.switch__input {
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
}

.switch__label {
  position: relative;
  display: inline-block;
  width: 120px;
  height: 60px;
  background-color: #2b2b2b;
  border: 5px solid #5b5b5b;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.46, 0.03, 0.52, 0.96);
}

.switch__indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateX(-72%);
  display: block;
  width: 40px;
  height: 40px;
  background-color: #7b7b7b;
  border-radius: 9999px;
  box-shadow: 10px 0px 0 0 rgba(#000000, 0.2) inset;

  &::before,
  &::after {
    position: absolute;
    content: "";
    display: block;
    background-color: #ffffff;
    border-radius: 9999px;
  }

  &::before {
    top: 7px;
    left: 7px;
    width: 9px;
    height: 9px;
    background-color: #ffffff;
    opacity: 0.6;
  }

  &::after {
    bottom: 8px;
    right: 6px;
    width: 14px;
    height: 14px;
    background-color: #ffffff;
    opacity: 0.8;
  }
}

.switch__decoration {
  position: absolute;
  top: 65%;
  left: 50%;
  display: block;
  width: 5px;
  height: 5px;
  background-color: #ffffff;
  border-radius: 9999px;
  animation: twinkle 0.8s infinite -0.6s;

  &::before,
  &::after {
    position: absolute;
    display: block;
    content: "";
    width: 5px;
    height: 5px;
    background-color: #ffffff;
    border-radius: 9999px;
  }

  &::before {
    top: -20px;
    left: 10px;
    opacity: 1;
    animation: twinkle 0.6s infinite;
  }

  &::after {
    top: -7px;
    left: 30px;
    animation: twinkle 0.6s infinite -0.2s;
  }
}

@keyframes twinkle {
  50% {
    opacity: 0.2;
  }
}

.switch__indicator {
  &,
  &::before,
  &::after {
    transition: all 0.4s cubic-bezier(0.46, 0.03, 0.52, 0.96);
  }
}

.switch__input:checked + .switch__label {
  background-color: #8fb5f5;
  border-color: #347cf8;

  .switch__indicator {
    background-color: #ecd21f;
    box-shadow: none;
    transform: translate(-50%, -50%) translateX(72%);

    &::before,
    &::after {
      display: none;
    }
  }

  .switch__decoration {
    top: 50%;
    transform: translate(0%, -50%);
    animation: cloud 8s linear infinite;

    width: 20px;
    height: 20px;

    &::before {
      width: 10px;
      height: 10px;
      top: auto;
      bottom: 0;
      left: -8px;
      animation: none;
    }

    &::after {
      width: 15px;
      height: 15px;
      top: auto;
      bottom: 0;
      left: 16px;
      animation: none;
    }

    &,
    &::before,
    &::after {
      border-radius: 9999px 9999px 0 0;
    }

    &::after {
      border-bottom-right-radius: 9999px;
    }
  }
}

@keyframes cloud {
  0% {
    transform: translate(0%, -50%);
  }
  50% {
    transform: translate(-50%, -50%);
  }
  100% {
    transform: translate(0%, -50%);
  }
}

.switch-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-right: 10%;
}

/* Base styling for messages */
.message {
  font-size: 18px;
  text-align: center;
  max-width: 100%;
  padding: 10px;
  color: #fff;
  display: none;
  animation: colorChange 3s forwards;
}

/* Specific styles for dark and light messages */
.message-light {
  border-color: #347cf8;
  /* background-color: #8fb5f5; */
}

/* Show the dark message when checkbox is not checked */
.switch__input:not(:checked) ~ .message-dark {
  display: block; /* Muestra el mensaje de modo oscuro */
}

/* Show the light message when checkbox is checked */
.switch__input:checked ~ .message-light {
  display: block; /* Muestra el mensaje de modo claro */
}

/* Keyframes for fading out */
@keyframes colorChange {
  0% {
    color: #ffffff;
  }
  66% {
    color: #ffffff;
  }
  100% {
    color: #000000;
    visibility: hidden;
  }
}

@media (max-width: 500px) {
  .switch-container {
    display: none;
  }
}
