/* Fonts */

@import url("https://fonts.googleapis.com/css2?family=Quicksand:wght@300..700&display=swap");

@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

:root {
  --color-bg: #fff;
  --color-bg-dark: #f4f4f4;
  --color-text: #555;
  --color-accent: #333;
  --color-secondary: #aaa;
  --color-terciary: #d4d4d4;
  --color-elements: #474fee;
  --sidebar-width: 220px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Quicksand", Helvetica, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  display: grid;
}

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

/* --------------------
       SIDEBAR
    -------------------- */
aside {
  position: fixed;
  left: -100%;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: var(--sidebar-width);
  background: #fff;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.1);
  transition: left 0.3s ease;
  z-index: 1000;
}

aside.active {
  left: 0;
}

#portrait {
  display: block;
  width: 100%;
  margin-top: 16px;
}

aside h2 {
  /* margin-bottom: 1rem; */
  background-color: var(--color-elements);
  font-size: 32px;
  font-weight: 200;
  color: var(--color-bg);
  text-align: center;
}

nav ul {
  display: flex;
  flex-direction: column;
  list-style: none;
}

nav ul li {
  border-bottom: 1px solid #ccc;
}

nav ul li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 8px 12px 32px;
  cursor: pointer;
}

nav ul li a img {
  width: 32px;
}

nav ul li a span {
  font-weight: 500;
  color: var(--color-accent);
}

/* --------------------
       TOGGLE BUTTON
    -------------------- */
.menu-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--color-elements);
  color: #fff;
  border: none;
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  z-index: 1100;
}

/* --------------------
       MAIN CONTENT
    -------------------- */
main {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-left: 0;
  /* transition: margin-left 0.3s ease; */
}

section {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  min-height: 100vh;
  max-width: 900px;
  margin: 1rem 1rem;
  visibility: hidden;
  height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  scroll-margin-top: 100px; /* Compensa header fijo si lo hay */
}

section.active {
  height: auto;
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
  position: relative;
}

article {
  padding: 2rem 1rem;
}

main h2 {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 3rem;
  font-weight: 900;
  color: var(--color-accent);
}

main h2::after {
  display: block;
  opacity: 1;
  content: "";
  height: 3px;
  width: 50px;
  margin: 10px auto;
  background-color: #e6e7e8;
  z-index: 0;
}

h3 {
  color: var(--color-accent);
}

/* h3::after {
  display: block;
  opacity: 1;
  content: "";
  height: 2px;
  width: 100%;
  margin: 10px auto;
  background-color: #e6e7e8;
  z-index: 0;
} */

h4 {
  font-weight: 800;
  color: var(--color-accent);
}

span {
  color: var(--color-secondary);
}

/* ABOUT ME */

#about {
  display: grid;
}

#who-img {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0rem 1rem;
}

#who-img img {
  width: 80%;
  max-width: 300px;
}

#who-h2 {
  text-align: start;
  font-size: 3rem;
  line-height: 3rem;
  font-weight: 900;
}

#who-h2 span {
  font-weight: 100;
  color: #333;
}

#who-h2::after {
  display: none;
}

.what-card {
  display: grid;
  grid-template-rows: 52px auto;
  grid-template-columns: 52px auto;
  gap: 0rem 1rem;
}

.what-card img {
  grid-column: 1/2;
  width: 34px;
  align-self: center;
  justify-self: center;
}

.what-header {
  grid-column: 2/3;
  align-self: center;
  color: var(--color-accent);
  font-weight: 700;
}

.what-description {
  grid-column: 2/3;
}

/* FORMATION */

.formation-card {
  display: grid;
  grid-template-rows: 25px auto;
  grid-template-columns: 52px auto auto;
  gap: 0rem 1rem;
}

.formation-year {
  grid-column: 1/2;
  grid-row: 2/3;
}

.formation-title,
.formation-name,
.formation-description {
  grid-column: 2/3;
}

.formation-title {
  color: var(--color-secondary);
}

.formation-description {
  grid-column: 2/3;
}

/* SKILLS */

#fundamentals {
  grid-column: 1/3;
}

#fundamentals .tech {
  background-color: var(--color-elements);
  border: none;
}

#fundamentals span {
  color: var(--color-bg);
}

.tech-container {
  grid-column: 2;
}

.skill-group {
  min-width: 350px;
  display: grid;
  grid-template-rows: 52px auto;
  grid-template-columns: 52px auto;
  gap: 0rem 1rem;
}

.skill-group img {
  width: 34px;
  align-self: center;
  justify-self: center;
}

.skill {
  grid-column: 2;
  margin-bottom: 0.8rem;
}

.skill-bar {
  width: 100%;
  height: 6px;
  background: var(--color-terciary);
  overflow: hidden;
}

.skill-level {
  height: 6px;
  background: var(--color-elements);
}

/* PROJECTS */

/* card */

.card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.3rem;
}

.github-link img {
  width: 1.5rem;
}

.live-link {
  height: auto;
  width: 100%;
}

.live-link img {
  width: 100%;
  border: 1px solid var(--color-secondary);
  border-radius: 0.5rem;
}

.project-tech {
  margin: 0.5rem 0;
}

.tech {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  margin: 0.2rem;
  border: 1px solid var(--color-secondary);
  border-radius: 12px;
  font-size: 0.8rem;
  background: #fff;
  color: var(--color-accent);
}

/* CONTACT */

.contact-card {
  margin: 1rem;
  border: 1px solid var(--color-secondary);
  border-radius: 0.5rem;
}

#contact-card-map {
  padding: 0;
}

.contact-icon {
  display: block;
  justify-self: center;
}

.contact-card h4 {
  text-align: center;
}

#contact-form {
  margin: 1rem 0rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  row-gap: 1.2rem;
  column-gap: 1.2rem;
}

#contact-form input {
  grid-column: 1/3;
  width: 100%;
  height: 2.5rem;
  border: 1px solid var(--color-secondary);
  border-radius: 0.3rem;
  padding: 1rem 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
}

#contact-form textarea {
  grid-column: 1/3;
  width: 100%;
  border: 1px solid var(--color-secondary);
  border-radius: 0.3rem;
  padding: 1rem 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
}

#contact-form button {
  height: 3rem;
  border: none;
  background-color: var(--color-elements);
  color: var(--color-bg);
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 500;
}

#contact-footer {
  width: 100%;
  margin-top: auto;
  padding: 16px 0px;
  background-color: var(--color-bg-dark);
}

#contact-footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
}

#copy-right {
  font-size: 12px;
  text-align: center;
}

/* --------------------
       TABLET LAYOUT
    -------------------- */
@media (min-width: 768px) {
  section {
    display: grid;
    grid-template-areas:
      "header header"
      "card-1 card-2"
      "card-3 card-4";
    grid-template-columns: 1fr 1fr;
    align-content: start;
  }

  section > h2 {
    grid-area: header;
  }
  article {
    padding: 2rem;
  }

  #about {
    grid-template-areas:
      "who-img who-text"
      "what what";
    grid-template-columns: 1fr 1fr;
  }

  #who-text {
    grid-area: who-text;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
  }

  #what {
    grid-area: what;
  }

  #what-div {
    display: flex;
    gap: 1rem;
  }

  #contact-form-article {
    grid-column: 1/3;
  }

  #contact-form input {
    grid-column: 1/2;
  }

  #contact-form textarea {
    grid-row: 1/4;
    grid-column: 2/3;
  }
}

/* --------------------
       DESKTOP LAYOUT
    -------------------- */
@media (min-width: 992px) {
  html {
    /* font-size: 18px; */
  }

  body {
    grid-template-columns: var(--sidebar-width) 1fr;
  }

  main {
    grid-column: 2/3;
  }

  aside {
    /* position: absolute; */
    top: 0;
    left: 0;
  }

  .menu-toggle {
    display: none;
  }

  #about {
    grid-template-areas:
      "who-text who-text"
      "what what";
    grid-template-rows: 300px auto;
    grid-template-columns: 1fr 1fr;
  }

  #who-img {
    display: none;
  }

  #who-text {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 2rem 4rem;
  }
}
