/*===============
  global styles
===============*/

* {
  padding: 0;
  margin: 0;
  border: 0;
  outline: 0;
  background-color: inherit;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  box-shadow: none;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  line-height: 1.5;
  color: var(--clr-fg);
  background-color: var(--clr-bg);
}

html, body {
  overflow-x: hidden;
}

.light {
  --clr-bg: #f6f6f6;
  --clr-bg-alt: #ffffff;
  --clr-fg: #555555;
  --clr-fg-alt: #444444;
  --clr-primary: #0E5484;
  --shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
}

.dark {
  --clr-bg: #232323;
  --clr-bg-alt: #2c2c2c;
  --clr-fg: #e1e1e1;
  --clr-fg-alt: #d1d1d1;
  --clr-primary: #90a0d9;
  --shadow: rgba(0, 0, 0, 0.16) 0px 10px 36px 0px,
    rgba(0, 0, 0, 0.06) 0px 0px 0px 1px;
}

::-moz-selection {
  background: var(--clr-primary);
  color: var(--clr-bg);
}

::-webkit-selection,
::selection {
  background: var(--clr-primary);
  color: var(--clr-bg);
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  color: var(--clr-fg-alt);
}

h1 {
  font-size: 4rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.3rem;
}

ul {
  list-style-type: none;
}

a {
  text-decoration: none;
}

button {
  cursor: pointer;
}

@media (max-width: 900px) {
  h1 {
    font-size: 2.6rem;
  }
}

/*===================
  buttons and links
===================*/

.link {
  color: var(--clr-primary);
  padding: 0 0 0.3em 0;
  position: relative;
}

.link:hover {
  color: var(--clr-primary);
}

.link::before {
  content: "";
  display: inline;
  width: 0%;
  height: 0.2em;
  position: absolute;
  bottom: 0;
  background-color: var(--clr-primary);
  transition: width 0.2s ease-in;
}

.link:hover::before,
.link:focus::before {
  width: 100%;
}

.link--nav {
  color: var(--clr-fg);
  text-transform: lowercase;
  font-weight: 500;
}

.link--icon {
  color: var(--clr-fg);
  font-size: 1.2rem;
}

.btn {
  display: block;
  padding: 0.8em 1.4em;
  font-weight: 500;
  font-size: 0.9rem;
  text-transform: lowercase;
  transition: transform 0.2s ease-in-out;
  border-radius: 6px;
}

.btn--outline {
  color: var(--clr-primary);
  border: 2px solid var(--clr-primary);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn--outline:focus,
.btn--outline:hover {
  color: var(--clr-bg);
}

.btn--outline:before {
  content: "";
  position: absolute;
  background-color: var(--clr-primary);
  right: 100%;
  bottom: 0;
  left: 0;
  top: 0;
  z-index: -1;
  transition: right 0.2s ease-in-out;
}

.btn--outline:hover::before,
.btn--outline:focus::before {
  right: 0;
}

.btn--plain {
  text-transform: initial;
  background-color: var(--clr-bg);
  border: 2px solid var(--clr-primary);
}

.btn--plain:hover {
  transform: translateY(-4px);
}

.btn--icon {
  padding: 0;
  font-size: 1.2rem;
}

.btn--icon:hover,
.btn--icon:focus {
  color: var(--clr-primary);
}

.btn--icon:active {
  transform: translateY(-5px);
}

.btn--outline i {
  color: inherit;
  background-color: transparent;
}

/*========
  layout
========*/

.center {
  display: flex;
  align-items: center;
}

.avatar-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);

  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 2000;
}

.avatar-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.avatar-modal__content {
  position: relative;

  background-color: var(--clr-bg);
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--clr-primary);
}

.avatar-modal__image {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.avatar-modal__close {
  position: absolute;
  top: -10px;   
  right: -10px;

  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.5rem;
  background-color: var(--clr-bg);
  color: var(--clr-fg);

  display: flex;             
  align-items: center;        
  justify-content: center;    
  line-height: 1;              
  padding: 0;                  
  border: none;                
  cursor: pointer;
}

.header__bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 8em;
  background-color: var(--clr-bg-alt);

  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);

  z-index: 1000;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  height: 8em;
  max-width: 1100px;
  width: 95%;
  margin: 0 auto;
  justify-content: space-between;

  z-index: 1000;
  background-color: transparent;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 0.6em;
}

.header__avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;

  border: 2px solid var(--clr-primary);

  cursor: pointer;
}

main {
  max-width: 1100px;
  width: 95%;
  margin: 0 auto;
}

.section__bg,
.section__bg__alt {
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  width: 100vw;
  box-sizing: border-box;
  padding: 5em 0.6em;
}

.section__bg {
  background-color: var(--clr-bg);
}

.section__bg__alt {
  background-color: var(--clr-bg-alt);
}

.section {
  padding-top: 5em;
}

.section {
  scroll-margin-top: 8em;
}

.section__title {
  text-align: center;
  margin-bottom: 1em;
  text-transform: uppercase;
}

.nav__list {
  margin-right: 1.5em;
  display: flex;
}

.nav__list-item {
  margin-left: 1.5em;
}

.nav__hamburger {
  display: none;
  width: 1em;
}

.about {
  position: relative;
  padding-top: 5em;
  flex-direction: column;
  margin-top: 2em;
  max-width: 1100px;
  width: 95%;
  margin-left: auto;
  margin-right: auto;
}


.about__name {
  color: var(--clr-primary);
}

.about__role {
  margin-top: 0.8em;
}

.about__desc {
  font-size: 1rem;
  max-width: 600px;
}

.about__desc,
.about__contact {
  margin-top: 2.4em;
}

.about .link--icon {
  margin-right: 0.8em;
}

.about .btn--outline {
  margin-right: 1em;
}

.about__grid {
  display: grid;
  align-items: center;
  grid-template-columns: 1fr 1fr;
  gap: 3em;
  max-width: 1100px;
  margin: 0 auto;
}

.about__content {
  min-width: 730px;
}

.about__image {
  margin-bottom: -8em;
}

.about__image img {
  height: 700px;
  object-fit: cover;
  transform: translateX(-7.5em) translateY(-2em);
}

.about h1 > *:not(.about__image) {
  position: relative;
  z-index: 1;
}

.projects__scroll {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-top: 1em;
  padding-bottom: 1em;
}

/* Chrome, Edge, Safari */
.projects__scroll::-webkit-scrollbar {
  height: 6px; 
}

.projects__scroll::-webkit-scrollbar-track {
  background: var(--clr-bg-alt); 
  border-radius: 3px;
}

.projects__scroll::-webkit-scrollbar-thumb {
  background-color: var(--clr-primary); 
  border-radius: 3px;
  border: 1px solid var(--clr-bg); 
}

/* Firefox */
.projects__scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--clr-primary) var(--clr-bg-alt);
}

.projects__grid {
  display: flex;
  gap: 2em;
}

.project {
  flex: 0 0 calc((100% - 4em) / 3);
  scroll-snap-align: start;          
  padding: 2em;
  text-align: center;
  border: 2px solid var(--clr-primary);
  background-color: var(--clr-bg-alt);
  border-radius: 6px;
  transition: transform 0.2s linear;
}

.project {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}


.project:hover {
  transform: translateY(-7px);
}

.project__description {
  margin-top: 1em;
}

.project__stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 1.2em 0;
}

.project__stack-item {
  margin: 0.5em;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--clr-fg-alt);
}

.project .link--icon {
  margin-right: 0.4em;
  margin-left: 0.5em;
}

.project__pinned-icon {
  position: absolute;
  top: 0.2em;
  right: 0.5em;
  rotate: 45deg;
  color: var(--clr-primary);
  font-size: 1.3rem;
  background-color: transparent;
  border-radius: 50%;
  padding: 0.2em;
}

.skills__list {
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
}

.skills__list-item {
  margin-right: 1em;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.contact {
  flex-direction: column;
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 1em;
  max-width: 500px;
  width: 95%;
  margin: 0 auto;
}

.contact__input,
.contact__textarea {
  background-color: var(--clr-bg); 
  color: var(--clr-fg);
  border: 2px solid var(--clr-primary);
  border-radius: 6px;
  padding: 0.8em 1em;
  font-size: 0.9rem;
  font-family: "Poppins", sans-serif;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.contact__input:focus,
.contact__textarea:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 2px rgba(41, 120, 181, 0.2);
  outline: none;
}

.contact__textarea {
  resize: vertical;
  min-height: 120px;
}

.contact__btn {
  margin-top: 1.6em;
  align-self: center;
}

.footer {
  padding: 0;
  margin-top: 3em;
  margin-bottom: 3em;
  text-align: center;
}

.footer__link {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--clr-fg);
}

.scroll-top {
  display: none;
  position: fixed;
  bottom: 1.3em;
  right: 2em;
  background-color: transparent;
  font-size: 1.8rem;
  transition: transform 0.2s ease-in-out;
}

@media (max-width: 900px) {
  .contact__form {
    width: 100%;
  }

  .header__bg {
    height: 6em;
  }

  .header {
    height: 6em;
  }

  .section {
    padding-top: 4em;
    scroll-margin-top: 6em;
  }

  .project {
    flex: 0 0 100%;
  }

  .nav__list {
    flex-direction: column;
    padding: 4em 1em; 
    position: fixed; 
    top: 6em;       
    left: 0;
    width: 100vw;    
    background-color: var(--clr-bg-alt);
    overflow-y: auto; 
    transform: translateX(-100%); 
    transition: transform 0.3s ease-in-out;
    z-index: 1500;
    box-shadow: 0 4px 8px -4px rgba(0, 0, 0, 0.15);
  }

  .nav__list.display-nav-list {
    transform: translateX(0);
    box-shadow: 0 4px 8px -4px rgba(0, 0, 0, 0.15);
  }

  .nav__list-item {
    margin: 1em 0; 
    text-align: center;
  }

  .display-nav-list {
    width: 100%;
  }

  .nav__list-item {
    margin: 0.5em 0;
  }

  .nav__hamburger {
    display: flex;
    margin-left: 0.8em;
  }

  .about {
    padding-top: 4em;
    align-items: flex-start;
    margin-top: 2em;
  }

  .footer {
    margin-top: 2em;
    margin-bottom: 2em;
  }

  .scroll-container {
    display: none;
  }

  .about__image {
    display: none;
  }

  .about__content {
    min-width: auto;
  }
}

.about__info p {
  font-size: 1rem;
  margin-bottom: 1.5em;
  max-width: 500px;
}

.about__details {
  list-style: none;
  padding: 0;
}

.about__details li {
  margin-bottom: 0.6em;
  color: var(--clr-fg);
}

.about__details strong {
  color: var(--clr-fg-alt);
}

@media (max-width: 900px) {
  .about__grid {
    grid-template-columns: 1fr;
    margin: 0 0.1em;
  }
}

.education__timeline {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2em;
}

.education__item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1.5em;
  padding: 1.8em;
  background-color: var(--clr-bg);
  border: 2px solid var(--clr-primary);
  border-radius: 6px;
  transition: transform 0.2s ease;
}

.education__item:hover {
  transform: translateY(-4px);
}

.education__date {
  font-weight: 600;
  color: var(--clr-primary);
  font-size: 0.9rem;
}

.education__content h3 {
  margin-top: -0.3em;
}

.education__grade {
  font-size: 0.9rem;
  color: var(--clr-fg);
}

.education__school {
  font-weight: 500;
  display: inline-block;
  margin-bottom: 0.3em;
}

.education__program {
  font-style: italic;
  margin-bottom: 0.8em;
}

.education__desc {
  margin-bottom: 0.8em;
}

.education__topics {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
}

.education__topics li {
  font-size: 0.8rem;
  padding: 0.3em 0.6em;
  background-color: var(--clr-bg-alt);
  border-radius: 4px;
  color: var(--clr-fg-alt);
}

@media (max-width: 900px) {
  .education__item {
    grid-template-columns: 1fr;
  }

  .education__date {
    text-align: left;
  }
}

.education__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1em;
}

.education__school {
  white-space: nowrap;
  font-weight: 500;
}

@media (max-width: 900px) {
  .education__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .education__school {
    white-space: normal;
  }
}

.cv-download {
  position: relative;
  display: inline-block;
}

.cv-download__btn {
  display: flex;
  align-items: center;
  gap: 0.5em;
  cursor: pointer;
}

.cv-download__menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--clr-bg-alt);
  border: 2px solid var(--clr-primary);
  border-radius: 6px;
  list-style: none;
  padding: 0.5em 0;
  margin: 0;
  display: none;
  min-width: 115px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  z-index: 100;
}

.cv-download__menu li {
  margin: 0;
}

.cv-download__menu li a {
  display: block;
  padding: 0.8em 1.4em;
  font-weight: 500;         
  font-size: 0.9rem;         
  text-transform: lowercase; 
  font-family: "Poppins", sans-serif;
  color: var(--clr-primary);
  transition: all 0.2s ease-in-out;
}

.cv-download__menu li a:hover {
  background-color: var(--clr-primary);
  color: var(--clr-bg);
}

.cv-download.active .cv-download__menu {
  display: block;
}