/* VARIABLES CSS */
:root {
  --header-height: 3rem;
  --font-semi: 600;
}

/* COLOR*/
:root {
  --first-color: #45b3e7;
  --second-color: #0e2431;
}

/* FONT */
:root {
  --body-font: 'Poppins', sans-serif;
  --big-font-size: 2rem;
  --h2-font-size: 1.25rem;
  --normal-font-size: 0.938rem;
}

@media screen and (min-width: 768px) {
  :root {
    --big-font-size: 3.5rem;
    --h2-font-size: 2rem;
    --normal-font-size: 1rem;
  }
}

/* Margin */
:root {
  --mb-1: 0.5rem;
  --mb-2: 1rem;
  --mb-3: 1.5rem;
  --mb-4: 2rem;
  --mb-5: 2.5rem;
  --mb-6: 3rem;
  --mb-7: -5rem;
}

/* Z index */
:root {
  --z-back: -10;
  --z-normal: 1;
  --z-tooltip: 10;
  --z-fixed: 100;
}
/* 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;
}

/* VITALITY */
.vitality__container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: center;
  gap: 2rem;
}

.vitality__img-container {
  display: flex;
  justify-content: center;
}

.vitality__img {
  width: 100%;
  max-width: 180px; /* reduce from 400px to something smaller */
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 25px var(--first-color);
  display: block;
  margin: 0 auto; /* centers the image */
}

.vitality__data {
  line-height: 1.7;
}

.vitality__text {
  margin-bottom: var(--mb-3);
}

.vitality__list {
  margin-bottom: var(--mb-3);
  padding-left: 1rem;
  list-style-type: none; /* removes default bullets since icons replace them */
}

.vitality__list li {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}

.vitality__list i {
  color: var(--first-color); /* matches theme blue */
  margin-right: 8px;
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 3px;
}

.vitality__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* 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 {
  padding-top: 3rem;
  padding-bottom: 2rem;
}

/* LAYOUT */
.bd-grid {
  max-width: 1024px;
  display: grid;
  grid-template-columns: 100%;
  grid-column-gap: 2rem;
  width: calc(100% - 2rem);
  margin-left: var(--mb-2);
  margin-right: 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: 414px) {
  .nav__menu {
    position: fixed;
    top: var(--header-height);
    right: -100%;
    width: 100%;
    height: 100%;
    padding: 2rem;
    background-color: var(--second-color);
    transition: 0.5s;
  }

  .home__title {
    margin-top: -10rem;
  }

  .home__subtitle {
    margin-top: -10rem;
  }
}

.nav__item {
  margin-bottom: var(--mb-4);
}
.nav__link {
  position: relative;
  color: #fff;
}
.nav__link:hover {
  position: relative;
}
.nav__link:hover::after {
  position: absolute;
  content: '';
  width: 100%;
  height: 0.18rem;
  left: 0;
  top: 2rem;
  background-color: var(--first-color);
}
.nav__logo {
  height: 70px;
  margin-top: -15px;
}
.nav__toggle {
  color: var(--second-color);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ACTIVE MENU */
.active::after {
  position: absolute;
  content: '';
  width: 100%;
  height: 0.18rem;
  left: 0;
  top: 2rem;
  background-color: var(--first-color);
}

/* SHOW HOME */
.show {
  right: 0;
}

/* HOME */
.home {
  height: calc(100vh - 3rem);
  row-gap: 1rem;
}
.home__data {
  align-self: center;
}
.home__title {
  margin-bottom: var(--mb-5);
}

.home__subtitle {
  margin-bottom: var(--mb-2);
}

.home__title-color {
  color: var(--first-color);
}

.home__social {
  display: flex;
  flex-direction: column;
}
.home__social-icon {
  width: max-content;
  margin-bottom: 5rem;

  font-size: 1.5rem;
  color: var(--second-color);
}
.home__social-icon:hover {
  color: var(--first-color);
}

/*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;
}
.button:hover {
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.15);
}

/* ABOUT */

.about__subtitle {
  margin-bottom: var(--mb-2);
}

/* WORK */
.work__container {
  row-gap: 2rem;
}
.work__img {
  box-shadow: 0 4px 25px var(--first-color);
  border-radius: 0.5rem;
  overflow: hidden;
  position: relative;
}

.project__img {
  display: block;
  width: 100%;
}

.image__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;

  transition: opacity 0.25s;
  -webkit-transition: opacity 0.25s;
  -moz-transition: opacity 0.25s;
  -ms-transition: opacity 0.25s;
  -o-transition: opacity 0.25s;
}

.image__overlay > * {
  transform: translateY(20px);
  transition: transform 0.25s;
  -webkit-transform: translateY(20px);
  -moz-transform: translateY(20px);
  -ms-transform: translateY(20px);
  -o-transform: translateY(20px);
  -webkit-transition: transform 0.25s;
  -moz-transition: transform 0.25s;
  -ms-transition: transform 0.25s;
  -o-transition: transform 0.25s;
}

.image__overlay:hover {
  opacity: 1;
}

.image__overlay:hover > * {
  transform: translateY(0px);
  -webkit-transform: translateY(0px);
  -moz-transform: translateY(0px);
  -ms-transform: translateY(0px);
  -o-transform: translateY(0px);
}

.image__title {
  font-size: 1.5em;
  font-weight: bold;
  cursor: pointer;
  color: #fff;
}

/* 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;
}

/* 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__icon:hover {
  color: var(--first-color);
}

/* MEDIA QUERIES */
@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) + 1rem);
  }
  .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(--second-color);
  }

  .home__social-icon {
    margin: 2rem;
    margin-top: -13rem;
  }

  .home {
    height: 100vh;
  }
  .home__data {
    align-self: flex-end;
  }
  .home__social {
    padding-top: 0;
    padding-bottom: 2.5rem;
    flex-direction: row;
    align-self: flex-end;
  }

  .home__subtitle {
    margin-bottom: var(--mb-2);
  }

  .skills__container {
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
    text-align: initial;
  }

  .work__container {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    column-gap: 2rem;
  }
  .contact__form {
    width: 360px;
  }
  .contact__container {
    justify-items: center;
  }
}

@media screen and (max-width: 768px) {
  .home {
    margin-top: 10rem;
  }

  .home__social-icon {
    margin-top: -4rem;
  }
}

@media screen and (min-width: 1024px) {
  .bd-grid {
    margin-left: auto;
    margin-right: auto;
  }

  .home__subtitle {
    margin-top: -5rem;
  }

  .home__social-icon {
    margin-top: -6rem;
  }
}

@media screen and (max-width: 1024px) {
  /* .home__title {
    margin-top: 5rem;
  } */

  .about.section {
    margin-top: -5rem;
  }

  .home__social-icon {
    margin-top: -2rem;
  }

  .image__overlay {
    opacity: 1;
  }

  .image__overlay > * {
    transform: translateY(0px);
    -webkit-transform: translateY(0px);
    -moz-transform: translateY(0px);
    -ms-transform: translateY(0px);
    -o-transform: translateY(0px);
  }
}

/* ============ MOBILE FIXES ============ */
@media screen and (max-width: 768px) {
  /* HERO */
  .home {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4rem 1.5rem;
    height: auto;
    margin-top: 5rem;
  }

  .home__title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    line-height: 1.3;
  }

  .home__data .button {
    width: 80%;
    margin: 0.5rem auto;
    display: block;
  }

  .home__social {
    flex-direction: row;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
  }

  .home__social-icon {
    margin: 0;
    font-size: 1.8rem;
  }

  .home__subtitle {
    margin-top: 2rem;
    font-size: 1rem;
    text-align: center;
  }

  .home__text {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-top: 0.5rem;
    text-align: center;
  }

  /* VITALITY */
  .vitality__container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: left;
    gap: 1.5rem;
    padding: 0 1rem;
  }

  .vitality__img {
    max-width: 220px;
  }

  .vitality__list {
    font-size: 0.95rem;
  }

  .vitality__links {
    flex-direction: column;
    width: 100%;
  }

  .vitality__links .button {
    width: 100%;
    text-align: center;
  }

  /* ABOUT */
  .about__text {
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.6;
    padding: 0 1rem;
  }

  /* PROJECTS */
  .work__container {
    grid-template-columns: 1fr;
    gap: 2rem;
    justify-items: center;
  }

  .work__img {
    width: 90%;
  }

  /* FOOTER */
  .footer__title {
    font-size: 1.5rem;
  }

  .footer__social {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
  }
}

/* ============ SMALL SCREENS ============ */
@media screen and (max-width: 420px) {
  .home__title {
    font-size: 1.5rem;
  }
  .button {
    padding: 0.6rem 1.8rem;
    font-size: 0.9rem;
  }
  .vitality__img {
    max-width: 180px;
  }
}
