/*===============
  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);
}

.light {
  --clr-bg: #fafafa;
  --clr-bg-alt: #fff;
  --clr-btn: #ebebeb;
  --clr-fg: #555;
  --clr-fg-alt: #444;
  --clr-primary: #2978b5;
  --shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
}

.dark {
  --clr-bg: #1c2133;
  --clr-bg-alt: #48527a;
  --clr-btn: #333b57;
  --clr-fg: #ffffff;
  --clr-fg-alt: #ffffff;
  --clr-primary: #d9cdfc;
  --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 0;
  position: relative;
}

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

.link::before {
  content: "";
  display: inline;
  width: 0%;
  height: 0em;
  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.5rem;
}

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

.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-btn);
  box-shadow: rgba(0, 0, 0, 0.15) 0px 3px 3px 0px;
  border: 0;
}

.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);
}

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

.theme {
  position: fixed;
  top: 30px;
  right: 40px;
}

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

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

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

.section {
  margin-top: 3.2em;
}

.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;
}

.opening {
  flex-direction: row;
  gap: 3em;
}

.photo {
  width: 250px;
  height: 250px;
  border-radius: 15px;
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 15px;
}

.about {
  flex-direction: column;
  margin-top: 0em;
}

.about__name {
  background-image: linear-gradient(to right, var(--clr-primary), #28a745);
  background: linear-gradient(
    to right,
    var(--clr-primary),
    #28a745,
    var(--clr-primary)
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-flow 3s linear infinite;
}

.about__role {
  margin-top: 0em;
}

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

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

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

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

.projects__grid {
  max-width: 1500px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20em, 1fr));
  grid-gap: 2em;
}

.project {
 position: relative;
 padding: 0;
 margin: 0 auto;
 text-align: center;
 box-shadow: var(--shadow);
 transition: transform 0.2s linear;
 overflow: hidden;
 background-color: var(--clr-bg-alt);
 border-radius: 10px;
 max-width: 420px;
 display: flex;
 flex-direction: column;
 height: 100%;
}

.project__image-container {
 position: relative;
 width: 100%;
 height:155px;
 overflow: hidden;
 flex-shrink: 0;
 display: flex;
 align-items: flex-start;
 justify-content: center;
 background-color: var(--clr-bg-alt);
}

.project__image-container img {
 display: block;
 max-width: 100%;
 max-height: 100%;
 width: auto;
 height: auto;
 object-fit: contain;
 object-position: center;
}

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

.project h3 {
  align-items: flex-start;
  padding: 0.8em 1em 0.5em 1em;
  margin: 0;
  flex-shrink: 0;
}

.project__description {
  margin: 0.5em 1em;
  font-size: 0.9rem;
  text-align: left;
  flex-grow: 0;
}

.project__description__items {
  list-style-type: square;
  margin: 0.5em 1em;
  padding-left: 1.5em;
  font-size: 0.9rem;
  text-align: left;
  flex-grow: 1;
}

.project__description__items li {
  margin-bottom: 0.5em;
}

.project__stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 1em 1em 0.5em 1em;
  gap: 0.5em;
  flex-shrink: 0;
}

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

.project .link--icon {
  margin: 0 0.5em;
  flex-shrink: 0;
}

.project > .link--icon:first-of-type {
  margin-left: 0;
}

.project > .link--icon:last-of-type {
  margin-right: 0;
}

.project__links {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5em 0 1em 0;
  flex-shrink: 0;
  gap: 0.5em;
}

.skills__sep {
  max-width: 1800px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3em;
  margin: 0 auto;
}

.skills__subsection {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5em;
  padding: 1.5em;
  background-color: var(--clr-bg-alt);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.skills__subsection h4 {
  font-weight: 600;
  margin-bottom: 0.5em;
  width: 100%;
  text-align: center;
  color: var(--clr-fg-alt);
}

.skills__list {
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.8em;
}

.skills__list-item {
  margin: 0;
  border-radius: 5px;
  padding: 0.5em 1em;
  font-size: 0.9rem;
}

.timeline {
  position: relative;
  max-width: 1200px;
  margin: 3em auto;
  padding: 2em 0 4em 0;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--clr-primary), var(--clr-primary));
  border-radius: 2px;
  z-index: 1;
}

.timeline__item {
  position: relative;
  margin-bottom: 4em;
  display: flex;
  align-items: center;
  width: 100%;
}

.timeline__item:last-child {
  margin-bottom: 0;
}

.timeline__item:nth-child(odd) {
  flex-direction: row;
}

.timeline__item:nth-child(even) {
  flex-direction: row-reverse;
}

.timeline__item:nth-child(odd) .timeline__content {
  margin-right: auto;
  text-align: right;
  padding-right: 3em;
  padding-left: 2em;
}

.timeline__item:nth-child(even) .timeline__content {
  margin-left: auto;
  margin-right: 0;
  text-align: left;
  padding-left: 3em;
  padding-right: 0;
}

.timeline__marker {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  background-color: var(--clr-primary);
  border: 4px solid var(--clr-bg);
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 0 0 4px var(--clr-primary), var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline__item:hover .timeline__marker {
  transform: translateX(-50%) scale(1.3);
  box-shadow: 0 0 0 6px var(--clr-primary), var(--shadow);
}

.timeline__content {
  width: 45%;
  max-width: calc(50% - 30px);
  background-color: var(--clr-bg-alt);
  padding: 1.5em;
  border-radius: 10px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  z-index: 0;
}

.timeline__item:hover .timeline__content {
  transform: translateY(-5px);
  box-shadow: rgba(100, 100, 111, 0.3) 0px 10px 35px 0px;
}

.timeline__date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--clr-primary);
  margin-bottom: 0.5em;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.timeline__title {
  font-size: 1.3rem;
  margin: 0.3em 0;
  color: var(--clr-fg-alt);
}

.timeline__company {
  font-size: 1rem;
  font-weight: 500;
  color: var(--clr-fg);
  margin: 0.3em 0 0.8em 0;
  font-style: italic;
}

.timeline__description {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--clr-fg);
  margin: 0;
}

.contact {
  flex-direction: column;
}

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

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

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

@media (max-width: 600px) {
  .header {
    height: 6em;
  }

  .section {
    margin-top: 4em;
  }

  .nav__list {
    flex-direction: column;
    padding: 4em 0;
    position: absolute;
    right: 0;
    left: 0;
    top: 5em;
    background-color: var(--clr-bg);
    width: 0;
    overflow: hidden;
    transition: width 0.2s ease-in-out;
  }

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

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

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

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

  .skills__sep {
    grid-template-columns: 1fr;
    gap: 2em;
  }

  .timeline::before {
    left: 20px;
  }

  .timeline__item {
    flex-direction: row !important;
    padding-left: 3em;
  }

  .timeline__item:nth-child(odd) .timeline__content,
  .timeline__item:nth-child(even) .timeline__content {
    width: 100%;
    margin: 0;
    text-align: left;
    padding-left: 0;
    padding-right: 0;
  }

  .timeline__marker {
    left: 20px;
    transform: translateX(-50%);
  }

  .timeline__item:hover .timeline__marker {
    transform: translateX(-50%) scale(1.2);
  }

  .footer {
    padding: 2em;
    margin-top: 3em;
  }

  .scroll-container {
    display: none;
  }
}

@keyframes gradient-flow {
  to {
    background-position: 200% center;
  }
}