/*===== GOOGLE FONTS =====*/
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Roboto:wght@400;500;700&display=swap");
/*===== VARIABLES CSS =====*/
:root {
  --header-height: 3rem;
  --font-semi: 600;
  /*===== Colores =====*/
  /*Moss 85 - Teal 175 - Blue 224 - Purple 260*/
  /* HSL color mode */
  --hue-color: 85;
  --first-color: hsl(var(--hue-color), 38%, 28%);
  --first-color-tint: hsl(var(--hue-color), 34%, 93%);
  --second-color: hsl(var(--hue-color), 30%, 10%);
  /* Darker green, used for the home blob. Raise the last number to lighten. */
  --deep-color: hsl(var(--hue-color), 30%, 18%);
  /*===== Fuente y tipografia =====*/
  --body-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --accent-font: "Roboto", "Segoe UI", Helvetica, Arial, sans-serif;
  --big-font-size: 2.5rem;
  --h2-font-size: 1.25rem;
  --normal-font-size: .938rem;
  --smaller-font-size: .75rem;
  /*===== Margenes =====*/
  --mb-2: 1rem;
  --mb-4: 2rem;
  --mb-5: 2.5rem;
  --mb-6: 3rem;
  /*===== z index =====*/
  --z-back: -10;
  --z-fixed: 100;
}
@media screen and (min-width: 968px) {
  :root {
    --big-font-size: 4.25rem;
    --h2-font-size: 2rem;
    --normal-font-size: 1rem;
    --smaller-font-size: .875rem;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: var(--header-height) 0 0 0;
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  color: var(--second-color);
}

h1, h2, p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  text-decoration: none;
}

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

/*===== CLASS CSS ===== */
.section-title {
  position: relative;
  font-size: var(--h2-font-size);
  color: var(--first-color);
  margin-top: var(--mb-2);
  margin-bottom: var(--mb-4);
  text-align: center;
}
.section-title::after {
  position: absolute;
  content: "";
  width: 64px;
  height: 0.18rem;
  left: 0;
  right: 0;
  margin: auto;
  top: 2rem;
  background-color: var(--first-color);
}

.section {
  padding-top: 3rem;
  padding-bottom: 2rem;
}

/*===== LAYOUT =====*/
.bd-grid {
  max-width: 1180px;
  display: grid;
  margin-left: calc(var(--mb-2));
  margin-right: calc(var(--mb-2));
}

.l-header {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-fixed);
  background-color: #fff;
  box-shadow: 0 1px 4px rgba(146, 161, 176, 0.15);
}

/*===== NAV =====*/
.nav {
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: var(--font-semi);
}
@media screen and (max-width: 1180px) {
  .nav__menu {
    position: fixed;
    top: var(--header-height);
    right: -100%;
    width: 80%;
    height: 100%;
    padding: 2rem;
    background-color: var(--second-color);
    transition: 0.28s;
  }
}
.nav__item {
  margin-bottom: var(--mb-4);
}
.nav__link {
  position: relative;
  color: #fff;
}
.nav__logo {
  color: var(--first-color);
}
.nav__toggle {
  color: var(--second-color);
  font-size: 1.5rem;
  cursor: pointer;
}

/*Active menu*/
/*=== Show menu ===*/
.show {
  right: 0;
}

/*===== HOME =====*/
.home {
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  gap: 1.5rem;
  padding: 4rem 0 5rem;
}
.home__data {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--mb-5);
  text-align: left;
  align-self: center;
}
.home__title {
  font-size: var(--big-font-size);
}
.home__title-color {
  color: var(--first-color);
}
.home__social {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.5rem;
}
.home__social-icon {
  width: max-content;
  font-size: 1.5rem;
  color: var(--second-color);
}
.home__social-icon:hover {
  color: var(--first-color);
}
.home__img {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 260px;
}
.home__blob {
  fill: var(--deep-color);
}
.home__blob-img {
  width: 400px;
}

/*BUTTONS*/
.button {
  display: inline-block;
  background-color: var(--first-color);
  color: #fff;
  padding: 0.75rem 2.5rem;
  font-weight: var(--font-semi);
  border-radius: 0.5rem;
  transition: 0.18s;
}
.button:hover {
  box-shadow: 0px 10px 36px rgba(0, 0, 0, 0.15);
}

/* ===== ABOUT =====*/
.about__container {
  row-gap: 2rem;
  text-align: center;
}
.about__subtitle {
  margin-bottom: var(--mb-2);
}
.about__img {
  justify-self: center;
}
.about__img img {
  width: 200px;
  border-radius: 0.5rem;
}

/* ===== SKILLS =====*/
.skills__container {
  row-gap: 2rem;
  text-align: center;
}
.skills__subtitle {
  margin-bottom: var(--mb-2);
}
.skills__text {
  margin-bottom: var(--mb-4);
}
/* ===== WORK =====*/
.work__container {
  row-gap: 2rem;
}
.work__img {
  box-shadow: 0px 4px 25px rgba(14, 36, 49, 0.15);
  border-radius: 0.5rem;
  overflow: hidden;
}
.work__img img {
  transition: 0.35s;
}
.work__img img:hover {
  transform: scale(1.1);
}

/* ===== CONTACT =====*/
.contact__input {
  width: 100%;
  font-size: var(--normal-font-size);
  font-weight: var(--font-semi);
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1.5px solid var(--second-color);
  outline: none;
  margin-bottom: var(--mb-4);
}
.contact__button {
  display: block;
  border: none;
  outline: none;
  font-size: var(--normal-font-size);
  cursor: pointer;
  margin-left: auto;
}

/* ===== FOOTER =====*/
.footer {
  background-color: var(--second-color);
  color: #fff;
  text-align: center;
  font-weight: var(--font-semi);
  padding: 2rem 0;
}
.footer__title {
  font-size: 2rem;
  margin-bottom: var(--mb-4);
}
.footer__social {
  margin-bottom: var(--mb-4);
}
.footer__icon {
  font-size: 1.5rem;
  color: #fff;
  margin: 0 var(--mb-2);
}
.footer__copy {
  font-size: var(--smaller-font-size);
}

/* ===== MEDIA QUERIES=====*/
@media screen and (max-width: 320px) {
  .home {
    row-gap: 2rem;
  }
  .home__img {
    width: 200px;
  }
}
@media screen and (min-width: 576px) {
  .home {
    padding: 4rem 0 2rem;
  }
  .home__social {
    padding-top: 0;
    padding-bottom: 0;
    flex-direction: row;
    align-self: flex-start;
  }
  .home__social-icon {
    margin-bottom: 0;
    margin-right: var(--mb-4);
  }
  .home__img {
    width: 300px;
    bottom: 25%;
  }
  .about__container {
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
    text-align: initial;
  }
  .skills__container {
    grid-template-columns: 0.7fr;
    justify-content: center;
    column-gap: 1rem;
  }
  .work__container {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 2rem;
    padding-top: 2rem;
  }
  .contact__form {
    width: 360px;
    padding-top: 2rem;
  }
  .contact__container {
    justify-items: center;
  }
}
@media screen and (min-width: 768px) {
  body {
    margin: 0;
  }
  .section {
    padding-top: 4rem;
    padding-bottom: 3rem;
  }
  .section-title {
    margin-bottom: var(--mb-6);
  }
  .section-title::after {
    width: 80px;
    top: 3rem;
  }
  .nav {
    height: calc(var(--header-height) + 1.5rem);
  }
  .nav__list {
    display: flex;
    padding-top: 0;
  }
  .nav__item {
    margin-bottom: 0;
  }
  .nav__toggle {
    display: none;
  }
  .nav__link {
    color: var(--second-color);
  }
  .home {
    padding: 8rem 0 2rem;
  }
  .home__img {
    width: 400px;
    bottom: 10%;
  }
  .about__container {
    padding-top: 2rem;
  }
  .about__img img {
    width: 300px;
  }
  .skills__container {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 2rem;
    align-items: center;
    text-align: initial;
  }
  .work__container {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 2rem;
  }
}
@media screen and (min-width: 992px) {
  .bd-grid {
    margin-left: auto;
    margin-right: auto;
  }
  .home {
    padding: 10rem 0 2rem;
  }
  .home__img {
    width: 450px;
  }
}

/* ===== ADDITIONS =====*/
/* Everything below is mine, not the original template. */

.experience__date,
.extras__date,
.extras__list-year,
.about__facts-year {
  font-family: var(--accent-font);
  font-variant-numeric: tabular-nums;
}

/* ----- home ----- */
.home__subtitle {
  font-family: var(--accent-font);
  font-size: var(--normal-font-size);
  color: var(--first-color);
  font-weight: 500;
  margin-bottom: var(--mb-4);
  letter-spacing: 0.02em;
}

/* ----- about ----- */
.about__text {
  margin-bottom: var(--mb-2);
  line-height: 1.7;
}
.about__facts {
  margin-top: var(--mb-4);
  text-align: left;
}
.about__facts li {
  display: flex;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--first-color-tint);
  font-size: var(--smaller-font-size);
}
.about__facts li:last-child {
  border-bottom: 1px solid var(--first-color-tint);
}
.about__facts-year {
  flex: 0 0 2.75rem;
  color: var(--first-color);
  font-weight: 500;
}

/* ----- skills ----- */
/* ----- experience ----- */
.experience__container,
.extras__container {
  row-gap: 1.5rem;
}
.experience__item,
.extras__item {
  position: relative;
  padding: 1.5rem;
  border-radius: 0.5rem;
  background-color: #fff;
  box-shadow: 0px 4px 25px rgba(14, 36, 49, 0.15);
  text-align: left;
}
.experience__item::before,
.extras__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.5rem;
  bottom: 1.5rem;
  width: 3px;
  border-radius: 3px;
  background-color: var(--first-color);
}
.experience__date,
.extras__date {
  display: block;
  font-size: var(--smaller-font-size);
  color: var(--first-color);
  font-weight: 500;
  margin-bottom: 0.35rem;
}
.experience__role,
.extras__role {
  font-size: var(--normal-font-size);
  font-weight: var(--font-semi);
  margin: 0;
}
.experience__org,
.extras__org {
  display: block;
  font-size: var(--smaller-font-size);
  opacity: 0.7;
  margin-bottom: 0.75rem;
}
.experience__text,
.extras__text {
  font-size: var(--smaller-font-size);
  line-height: 1.7;
}

/* ----- work ----- */
.work__img {
  background-color: #fff;
}
.work__caption {
  padding: 1.25rem;
  text-align: left;
}
.work__title {
  font-size: var(--normal-font-size);
  font-weight: var(--font-semi);
  margin: 0 0 0.4rem;
}
.work__text {
  font-size: var(--smaller-font-size);
  line-height: 1.7;
  margin-bottom: 0.6rem;
}
.work__tags {
  font-family: var(--accent-font);
  font-size: var(--smaller-font-size);
  color: var(--first-color);
  font-weight: 500;
}

/* ----- contact ----- */
.contact__container {
  row-gap: 2.5rem;
}
.contact__info {
  text-align: left;
}
.contact__subtitle {
  font-size: var(--normal-font-size);
  font-weight: var(--font-semi);
  color: var(--first-color);
  margin: 0 0 0.5rem;
}
.contact__text {
  font-size: var(--smaller-font-size);
  margin-bottom: var(--mb-2);
  line-height: 1.7;
}
.contact__link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  color: var(--second-color);
  font-size: var(--smaller-font-size);
  word-break: break-word;
}
.contact__link i {
  font-size: 1.25rem;
  color: var(--first-color);
}
.contact__link:hover {
  color: var(--first-color);
}

/* ----- footer ----- */
.footer__copy a {
  color: #fff;
  text-decoration: underline;
}

/* ----- focus visibility, missing from the template ----- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--first-color);
  outline-offset: 3px;
}

@media screen and (min-width: 768px) {
  .experience__container,
  .extras__container {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 2rem;
  }
  .contact__container {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 3rem;
    align-items: start;
    justify-items: start;
  }
  .contact__form {
    width: 100%;
  }
}

/* ----- skills: two columns of cards ----- */
.skills__groups {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
.skills__group {
  padding: 1.35rem 1.5rem;
  border-radius: 0.5rem;
  background-color: #fff;
  box-shadow: 0px 4px 25px rgba(14, 36, 49, 0.15);
  text-align: left;
}
.skills__group-title {
  font-family: var(--accent-font);
  font-size: var(--smaller-font-size);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--first-color);
  margin: 0 0 0.75rem;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.4rem;
}
.chips li {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background-color: var(--first-color-tint);
  font-size: var(--smaller-font-size);
  line-height: 1.5;
}

@media screen and (min-width: 576px) {
  .skills__groups {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (min-width: 768px) {
  /* Nothing sits beside the chips now, so the container gives them the full
     width and the cards run two across. */
  .skills__container {
    grid-template-columns: 100%;
  }
}

/* ----- work cards: zoomable image and a repo link ----- */
.work__zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  line-height: 0;
}
.work__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
  color: var(--first-color);
  font-size: var(--smaller-font-size);
  font-weight: var(--font-semi);
}
.work__link i {
  font-size: 1.1rem;
}
.work__link:hover {
  text-decoration: underline;
}
.work__caption .work__tags {
  display: block;
}

/* ----- lightbox ----- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  place-items: center;
  padding: 3rem 1rem;
  background-color: rgba(11, 16, 8, 0.92);
}
.lightbox.is-open {
  display: grid;
}
.lightbox__img {
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  border-radius: 0.5rem;
  box-shadow: 0px 10px 45px rgba(0, 0, 0, 0.45);
}
.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.75rem;
  cursor: pointer;
}
.lightbox__close:hover {
  background-color: rgba(255, 255, 255, 0.22);
}
body.has-lightbox {
  overflow: hidden;
}

/* ----- extracurriculars: CTF placement list ----- */
.extras__list {
  margin-top: 0.25rem;
}
.extras__list li {
  display: flex;
  gap: 0.7rem;
  padding: 0.3rem 0;
  color: var(--second-color);
  font-size: var(--smaller-font-size);
  line-height: 1.6;
}
.extras__list-year {
  flex: 0 0 2.5rem;
  color: var(--first-color);
  font-weight: 500;
}

@media screen and (min-width: 768px) {
  /* Seven nav items need tighter spacing before the wide breakpoint. */
  .nav__item {
    margin-left: 0.75rem;
  }
}

@media screen and (min-width: 992px) {
  .nav__item {
    margin-left: 1.5rem;
  }
}

/* ----- language switcher ----- */
.lang {
  display: flex;
  gap: 0.15rem;
}
.lang__btn {
  padding: 0.3rem 0.45rem;
  border: none;
  border-radius: 4px;
  background: none;
  color: var(--second-color);
  font-family: var(--accent-font);
  font-size: var(--smaller-font-size);
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.5;
  cursor: pointer;
}
.lang__btn:hover {
  opacity: 1;
}
.lang__btn.is-active {
  opacity: 1;
  color: var(--first-color);
  background-color: var(--first-color-tint);
}

@media screen and (max-width: 1180px) {
  /* The menu is off canvas here, so the switcher sits beside the toggle. */
  .lang {
    margin-left: auto;
    margin-right: 1rem;
  }
}

/* ----- nav links: pale moss on hover and on the current section ----- */
/* Appended so it outranks the .nav__link colour set at the 768 breakpoint. */
.nav__link {
  display: inline-block;
  padding: 0.35rem 0.4rem;
  border-radius: 5px;
  transition: background-color 0.18s, color 0.18s;
}
.nav__link:hover,
.nav__link.active-link {
  background-color: var(--first-color-tint);
  color: var(--first-color);
}

/* ----- about: the cutout on a dark green panel ----- */
.about__img {
  justify-self: center;
  width: 220px;
  border-radius: 1rem;
  background-color: var(--first-color);
  overflow: hidden;
  box-shadow: 0px 4px 25px rgba(14, 36, 49, 0.15);
}
.about__img img {
  width: 100%;
  border-radius: 0;
}

/* ----- home fills the first screen ----- */
/* Phones: body already has a header-height top margin, so subtract it.
   svh keeps mobile browser toolbars from pushing the next section in. */
.home {
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
  align-content: center;
}
@media screen and (min-width: 768px) {
  .home {
    /* body margin is 0 here, the fixed header overlaps the top padding */
    min-height: 100vh;
    min-height: 100svh;
    padding: calc(var(--header-height) + 1.5rem) 0 2rem;
  }
  .home__img {
    /* Vertically centred on the text block rather than pinned near the
       bottom, which left it low once home became full height. Nudged a
       little above true centre. */
    top: calc(50% - 1.5rem);
    bottom: auto;
    /* translate, not transform: ScrollReveal writes an inline transform. */
    translate: 0 -50%;
  }
}

/* ----- home on phones: stack the blob above the text ----- */
@media screen and (max-width: 767px) {
  .home {
    grid-template-columns: 100%;
    justify-items: center;
    row-gap: 1.75rem;
    padding: 2rem 0 3rem;
  }
  .home__img {
    /* Static, so it takes a row of its own instead of floating over the
       heading. order pulls it above the text block. */
    position: static;
    order: -1;
    width: min(210px, 52vw);
  }
  .home__data {
    /* Left aligned on desktop, centred once the blob sits above it. */
    width: 100%;
    align-items: center;
    text-align: center;
  }
}

@media screen and (min-width: 768px) {
  .about__img {
    width: 300px;
  }
}
