


/*===== GOOGLE FONTS - Updated for a more sleek, premium look =====*/
@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Montserrat:wght@400;500;600;700&display=swap");

/*===== VARIABLES CSS - Dark Theme & Gold Accent =====*/
:root {
  --header-height: 3rem;
  --font-semi: 600;
  
  /*===== Colores - Deep Dark & Gold Accent =====*/
  --hue-color: 240; /* Blue/Navy base for deep dark feel */
  --first-color: hsl(40, 70%, 55%); /* Muted Gold/Bronze */
  --second-color: hsl(240, 15%, 12%); /* Very Dark Navy/Near-Black */
  --third-color: hsl(240, 10%, 25%); /* Dark Grey for elements */
  --text-color: hsl(0, 0%, 90%); /* Light text for dark background */
  --text-color-light: hsl(0, 0%, 70%); /* Lighter text */
  --body-bg-color: hsl(240, 10%, 15%); /* Slightly lighter dark background */

  /*===== Fuente y tipografia =====*/
  --title-font: "Playfair Display", serif; /* For titles - luxury feel */
  --body-font: "Montserrat", sans-serif; /* For body - modern, clean */
  --big-font-size: 2.5rem;
  --h2-font-size: 1.5rem;
  --normal-font-size: 1rem;
  --smaller-font-size: .85rem;
  
  /*===== 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: 4rem;
    --h2-font-size: 2.5rem;
    --normal-font-size: 1rem;
    --smaller-font-size: .875rem;
  }
}

/*===== BASE - General Reset and Dark Mode Body =====*/
*, ::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(--text-color);
  background-color: var(--body-bg-color);
}

/* ⭐️ FIX: Stops the body from horizontally overflowing when the mobile menu is open */
.menu-open {
    **overflow-x: hidden;** } 
/* --------------------------------------------------------------------------------- */

h1, h2, p {
  margin: 0;
}

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

a {
  text-decoration: none;
  transition: color 0.3s ease;
}

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

/*===== CLASS CSS - Titles & Sections ===== */
.section-title {
  position: relative;
  font-family: var(--title-font);
  font-size: var(--h2-font-size);
  color: var(--first-color);
  margin-top: var(--mb-2);
  margin-bottom: var(--mb-4);
  text-align: center;
  letter-spacing: 0.1em;
}
.section-title::after {
  position: absolute;
  content: "";
  width: 80px;
  height: 0.1rem;
  left: 0;
  right: 0;
  margin: auto;
  top: 2.5rem;
  background-color: var(--first-color);
  opacity: 0.7;
}

.section {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

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

.l-header {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-fixed);
  background-color: transparent; /* Start with transparent or light background */
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); 
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

/*===== NAV =====*/
.nav {
  height: calc(var(--header-height) + 1.5rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: var(--font-semi);
}
@media screen and (max-width: 767px) {
  .nav__menu {
    top: calc(var(--header-height) + 1.5rem);
    right: -100%;
    width: 80%;
    height: 100vh;
    padding: 3rem 2rem;
    background-color: var(--second-color);
    transition: right 0.6s cubic-bezier(0.86, 0, 0.07, 1);
  }
}
.nav__item {
  margin-bottom: var(--mb-4);
}
.nav__link {
  position: relative;
  color: var(--text-color); /* Light links on dark background */
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: color 0.3s ease;
}
.nav__link:hover {
  color: var(--first-color);
}
.nav__link:hover::after {
  position: absolute;
  content: "";
  width: 100%;
  height: 0.1rem;
  left: 0;
  top: 1.8rem;
  background-color: var(--first-color);
}
.nav__logo {
  color: var(--first-color);
  font-family: var(--title-font);
  font-size: 1.5rem;
  transition: color 0.3s ease;
}
.nav__toggle {
  color: var(--text-color);
  font-size: 2rem;
  cursor: pointer;
}

/*Active menu*/
.active-link {
  color: var(--first-color);
}
.active-link::after {
  position: absolute;
  content: "";
  width: 100%;
  height: 0.1rem;
  left: 0;
  top: 1.8rem;
  background-color: var(--first-color);
}

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

/*===== HEADER SCROLL EFFECT (NEW!) =====*/
.scroll-header {
  background-color: var(--second-color); /* Dark background when scrolled */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); 
}
.scroll-header .nav__link {
    color: var(--text-color); /* Ensure text is light/white when scrolled */
}


/*===== HOME =====*/
.home {
  position: relative;
  row-gap: 5rem;
  padding: 6rem 0 5rem;
}
.home__data {
  align-self: center;
}
.home__title {
  font-family: var(--title-font);
  font-size: var(--big-font-size);
  margin-bottom: var(--mb-5);
  line-height: 1.2;
}
.home__title-color {
  color: var(--first-color);
  font-weight: 700;
}
.home__social {
  display: flex;
  flex-direction: column;
}
.home__social-icon {
  width: max-content;
  margin-bottom: var(--mb-2);
  font-size: 1.8rem;
  color: var(--text-color-light);
  transition: color 0.3s ease, transform 0.3s ease;
}
.home__social-icon:hover {
  color: var(--first-color);
  transform: translateY(-2px);
}
.home__img {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 280px;
}
.home__blob {
  fill: var(--third-color);
}
.home__blob-img {
  width: 380px;
}

/*BUTTONS*/
.button {
  display: inline-block;
  background-color: var(--first-color);
  color: var(--second-color);
  padding: 0.8rem 3rem;
  font-weight: 700;
  border-radius: 5px;
  transition: all 0.4s ease;
  letter-spacing: 0.05em;
  border: 2px solid var(--first-color);
}
.button:hover {
  background-color: transparent;
  color: var(--first-color);
  box-shadow: 0px 8px 25px rgba(255, 180, 0, 0.2);
}

/* ===== ABOUT =====*/
.about__container {
  row-gap: 3rem;
  text-align: center;
}
.about__subtitle {
  font-family: var(--title-font);
  color: var(--first-color);
  margin-bottom: var(--mb-2);
}
.about__text {
  color: var(--text-color-light);
  line-height: 1.7;
}
.about__img {
  justify-self: center;
}
.about__img img {
  width: 250px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 3px solid var(--third-color);
}

/* ===== SKILLS =====*/
.skills__container {
  row-gap: 3rem;
  text-align: center;
}
.skills__subtitle {
  font-family: var(--title-font);
  color: var(--first-color);
  margin-bottom: var(--mb-2);
}
.skills__text {
  color: var(--text-color-light);
  margin-bottom: var(--mb-4);
  line-height: 1.6;
}
.skills__data {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  margin-bottom: var(--mb-4);
  border-radius: 8px;
  background-color: var(--second-color);
  box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.skills__icon {
  font-size: 2.2rem;
  margin-right: var(--mb-2);
  color: var(--first-color);
}
.skills__names {
  display: flex;
  align-items: center;
  color: var(--text-color);
}
.skills__percentage {
  color: var(--first-color);
  font-weight: 700;
}
.skills__bar {
  position: absolute;
  left: 0;
  bottom: 0;
  background: linear-gradient(to right, var(--first-color), hsl(40, 80%, 45%));
  height: 0.35rem;
  border-radius: 0;
  z-index: var(--z-back);
  transition: width 1.5s ease-in-out;
}
.skills__html { width: 95%; }
.skills__css { width: 85%; }
.skills__js { width: 65%; }
.skills__ux { width: 85%; }

.skills__img {
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* ===== WORK =====*/
.work__container {
  row-gap: 2.5rem;
}
.work__img {
  box-shadow: 0px 6px 20px rgba(0, 0, 0, 0.5);
  border-radius: 5px;
  overflow: hidden;
  display: block;
}
.work__img img {
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.work__img img:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

/* ===== CONTACT =====*/
.contact__input {
  background-color: var(--second-color);
  color: var(--text-color);
  font-size: var(--normal-font-size);
  font-weight: 400;
  padding: 1rem;
  border-radius: 5px;
  border: 1px solid var(--third-color);
  outline: none;
  margin-bottom: var(--mb-4);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.contact__input:focus {
  border-color: var(--first-color);
  box-shadow: 0 0 0 2px rgba(255, 180, 0, 0.1);
}
.contact__button {
  display: block;
  border: none;
  outline: none;
  font-size: var(--normal-font-size);
  cursor: pointer;
  margin-left: auto;
}
.contact__form {
  padding-top: 1rem;
}

/* ===== FOOTER =====*/
.footer {
  background-color: var(--second-color);
  color: var(--text-color);
  text-align: center;
  font-weight: 500;
  padding: 3rem 0;
  border-top: 1px solid var(--third-color);
}
.footer__title {
  font-family: var(--title-font);
  font-size: 2.5rem;
  color: var(--first-color);
  margin-bottom: var(--mb-4);
}
.footer__social {
  margin-bottom: var(--mb-4);
}
.footer__icon {
  font-size: 1.8rem;
  color: var(--text-color);
  margin: 0 var(--mb-2);
  transition: color 0.3s ease;
}
.footer__icon:hover {
  color: var(--first-color);
}
.footer__copy {
  font-size: var(--smaller-font-size);
  color: var(--text-color-light);
}

/*===== SCROLL UP (NEW!) =====*/
.scrollup {
    position: fixed;
    right: 1.5rem;
    bottom: -20%; /* Hidden initially */
    background-color: var(--first-color);
    opacity: 0.9;
    padding: 0 .3rem;
    border-radius: .4rem;
    z-index: var(--z-fixed);
    transition: .4s;
}

.scrollup:hover {
    background-color: var(--first-color);
    opacity: 1;
}

.scrollup__icon {
    font-size: 1.5rem;
    color: var(--second-color);
}

/* Show scroll */
.show-scroll {
    bottom: 3rem; /* Visible on scroll */
}


/* ===== MEDIA QUERIES=====*/
@media screen and (max-width: 320px) {
  .home {
    row-gap: 2rem;
  }
  .home__img {
    width: 200px;
  }
}
@media screen and (min-width: 576px) {
  .home {
    padding: 6rem 0 2rem;
  }
  .home__social {
    padding-top: 0;
    padding-bottom: 2.5rem;
    flex-direction: row;
    align-self: flex-end;
  }
  .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: 5rem;
    padding-bottom: 4rem;
  }
  .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-left: var(--mb-6);
    margin-bottom: 0;
  }
  .nav__toggle {
    display: none;
  }
  .nav__link {
    color: var(--text-color);
  }
  .home {
    padding: 10rem 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(3, 1fr);
    column-gap: 2rem;
  }
}
@media screen and (min-width: 992px) {
  .bd-grid {
    margin-left: auto;
    margin-right: auto;
  }
  .home {
    padding: 12rem 0 4rem;
  }
  .home__img {
    width: 500px;
  }
}


