:root {
  --font-color: #042f2e;
  --font-highlight-color: #0f766e;
  --card-link-hover-color: #66aca4;
  --background-color1: #d5eee7;
  --background-color2: #bce4d9;
  --card-color: #f1f9f7;
  --dark-mode: 0;
  --brightness: 1;
}

[data-theme="dark"] {
  --font-color: #f1f9f7;
  --font-highlight-color: #66aca4;
  --card-link-hover-color: #bce4d9;
  --background-color1: #292929;
  --background-color2: #333333;
  --card-color: #3f3f3f;
  --dark-mode: 1;
  --brightness: 1.25;
}

* {
  margin: 0;
  padding: 0;
  color: var(--font-color);
  font-family: sans-serif;
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-snap-type: y proximity;
  scroll-behavior: smooth;
}

body {
  width: 100%;
  height: 100%;

  display: flex;
  flex-direction: column;
}

header {
  background-color: var(--background-color1);
  width: 100%;
  height: 7.5vh;
  min-height: 60px;
  box-shadow: 0 3px 10px rgb(0 0 0 / 0.2);
  position: fixed;
  z-index: 1;

  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}

input {
  display: none;
}

nav {
  width: 40%;
  padding-top: 15px;

  display: flex;
  flex-direction: row;
  justify-content: left;
  align-items: flex-start;
}

nav ul {
  width: 100%;

  display: flex;
  flex-direction: row;
  justify-content: left;
}

nav ul li {
  display: inline-block;
  margin-left: 20px;
}

a {
  text-decoration: none;
  font-weight: 550;
}

h1 {
  font-size: 3em;
  margin: 10px;
}

em {
  color: var(--font-highlight-color);
  font-style: normal;
}

.config {
  width: 10%;

  display: flex;
  flex-direction: row;
  justify-content: right;
  align-items: center;
}

.icon {
  padding: 0;
  height: 24px;
  width: auto;
  margin: 5px;
}

#mode {
  border-radius: 50%;
  width: 34px;
  height: 34px;
  transition: 0.5s;
}

#mode:hover {
    background-color: var(--card-color);
}

#mode > img {
  filter: invert(var(--dark-mode));
}

button {
  background-color: transparent;
  border: none;
  margin: 5px;
}

button:hover {
  cursor: pointer;
}

h2 {
  font-size: 1.6em;
  width: 50%;
  margin-top: 20px;
  margin-bottom: 10px;
}

main {
  padding: 0;
  margin: 0%;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
}

main section {
  scroll-snap-align: end;
  position: relative;
  min-height: 100vh;
  width: 100%;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

main section:nth-child(1) {
  background-color: var(--background-color1);

  flex-direction: row;
}

main section:nth-child(2n) {
  background-color: var(--background-color2);
}

main section:nth-child(2n + 3) {
  background-color: var(--background-color1);
}

/* Primera sección */

section:first-of-type article {
  max-width: 30%;
  text-align: center;
}

section article p {
  font-size: 1.2em;
}

article ul {
  margin-top: 10px;
  width: 100%;
  list-style: none;

  display: flex;
  flex-direction: row;
  justify-content: center;
}

li a img {
  width: 60px;
  height: auto;
  padding: 5px;
  margin-left: 10px;
  margin-right: 10px;
  transition: padding 0.3s;
}

li a img:hover {
  padding: 0px;
}

#psocial {
  min-height: calc(1em + 2px);
  font-size: 1em;
  margin: 0;
  padding: 0;
}

a > img {
  padding-top: 10px;
  margin-bottom: 10px;
}

/* Resto de secciones */

section:nth-child(n + 2):nth-last-child(n + 3) article {
  background-color: var(--card-color);
  margin-top: 10px;
  margin-bottom: 10px;
  width: 50%;
  min-height: 200px;
  border-radius: 15px;
  overflow: hidden;

  display: grid;
  grid-template-areas:
    "t i"
    "p i"
    "l i";
  grid-auto-rows: min-height auto;
  grid-template-columns: 1fr 200px;
}

h3 {
  font-size: 1.3em;
  padding: 30px 30px 0px 30px;
  grid-area: t;
}

article p {
  align-self: start;
  height: 100%;
  padding: 0px 15px 30px 30px;
  grid-area: p;
}

article img {
  grid-area: i;
  max-height: 200px;
  max-width: 200px;
}

#portfolio article p {
  padding-bottom: 10px;
}

.social-links {
  grid-area: l;
  width: 100%;
  gap: 10px;
  padding: 10px 30px 10px 30px;

  display: flex;
  justify-content: flex-start;
}

.social-links a {
  font-size: 24px;
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

article a {
  color: var(--font-highlight-color);
}

article a:hover {
  color: var(--card-link-hover-color);
}

section:nth-child(n + 2) article img {
  float: right;
}

a:hover {
  color: var(--font-highlight-color);
}

#skills h2, #hobbies h2 {
  text-align: center;
}

pre {
  margin: 0;
  padding: 0;
}

pre img {
  margin-bottom: 0;
}

footer {
  scroll-snap-align: end;
  background-color: var(--background-color1);
  border-top: 4px solid var(--font-highlight-color);
  text-align: center;
  padding: 20px;
  height: 10vh;
  min-height: 140px;
  width: 100%;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

@media (max-width: 1500px) {
  section:first-of-type article {
    max-width: 45%;
  }

  section:not(:first-child) article,
  h2 {
    min-width: 65%;
  }

  nav {
    min-width: 55%;
  }
}

@media (max-width: 1300px) {
  section:first-of-type article {
    max-width: 50%;
  }

  section:not(:first-child) article,
  h2 {
    min-width: 70%;
  }

  nav {
    min-width: 60%;
  }
}

@media (max-width: 1100px) {
  main section:nth-child(1) {
    flex-direction: column;
  }

  .flip-box {
    margin-top: 70px;
  }

  section:not(:last-child) article,
  section:not(:last-child) h2 {
    min-width: 80%;
  }

  nav {
    min-width: 70%;
  }
}

@media (max-width: 900px) {
  section:not(:last-child) article,
  h2 {
    min-width: 95%;
  }

  nav {
    min-width: 85%;
  }
}

@media (max-width: 750px) {

  section:nth-child(n + 2):nth-last-child(n + 3) article,
  h2 {
    min-width: 95%;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  
  section:not(:last-child) article > img {
    padding: 10px;
  }

  section {
    display: flex;
    flex-direction: column;
  }

  nav > ul {
    position: fixed;
    top: 60px;
    right: -100%;
    background-color: var(--background-color2);
    height: 100vh;
    width: 100%;
    display: block;
    text-align: center;
    transition: all 0.3s ease;
  }

  #menu-cb:not(:checked) ~ ul {
    left: -100%;
  }

  #menu-cb:checked ~ ul {
    left: 0%;
  }

  .nav-links li {
    display: block;
    margin-top: 30px;
  }

  .menu-btn {
    display: inline-block;
  }

  label > span {
    display: block;
    position: relative;
    width: 25px;
    height: 10px;
    border-top: 2.5px solid var(--font-color);
    border-radius: 2px;

    transition-duration: 0.5s;
  }

  label > span:nth-child(1) {
    top: 0px;
  }

  label > span:nth-child(2) {
    top: 0px;
  }

  label > span:nth-child(3) {
    bottom: 0px;
  }

  #menu-cb:hover ~ label > span {
    transform: scaleY(0.95);
    border-color: var(--font-highlight-color);
  }

  #menu-cb:checked ~ label > span:nth-child(1) {
    transform: rotate(45deg);
    top: 12px;
  }

  #menu-cb:checked ~ label > span:nth-child(2) {
    width: 0px;
  }

  #menu-cb:checked ~ label > span:nth-child(3) {
    transform: rotate(135deg);
    bottom: 13px;
  }

  h3 {
    padding-top: 20px;

    text-align: center;
  }

  article>p {
    padding-bottom: 20px;
  }
}
