:root {
  --primary-color: rgb(9, 151, 197);
  --primary-color-darker: rgb(12, 102, 132);
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: 'Helvetica', 'Arial', 'sans-serif';
  overflow-x: hidden;
  line-height: 1.5;
}

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

a {
  color: var(--primary-color);
  text-decoration: none;
  font-family: inherit;
  font-size: inherit;
}

a:hover {
  color: var(--primary-color-darker);
}

a:focus {
  outline: 1px solid var(--primary-color);
  border-radius: 4px;
}

.grid {
  height: 100%;
  min-height: 100%;
  min-width: 100%;
  display: grid;
  grid-template-columns: 25% 50% 25%;
  grid-template-rows: 35% 1fr 8%;
  justify-items: center;
}

/* Header */

header {
  grid-row: 1 / 2;
  grid-column: 2 / 3;
  align-self: center;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: 100%;
  height: 100%;
}

.background-image {
  grid-row: 1 / 2;
  grid-column: 1 / 3;
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 35%;
  cursor: default;
  background-image: url('../assets/images/me_bromo_centered.jpg');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: 46.47% 50%;
  z-index: -1;
  animation: fadeIn 0.8s ease-in-out;
}

.profile-pic {
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: url('../assets/images/me_indo_500px_sepia.png');
  background-color: #fcfcfc;
  background-repeat: no-repeat;
  background-size: cover;
  width: 120px;
  height: 120px;
  border-radius: 100%;
  border: 4px solid white;
  margin-bottom: -60px;
  cursor: default;
  transition: background-image 0.25s, width 0.25s, height 0.25s;
  transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: blob 8.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile-pic lottie-player {
  display: none;
}
.profile-pic lottie-player.active {
  display: block;
}

/* Main */

main {
  position: relative;
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 1.25rem;
  color: #b2b2b2;
  text-align: left;
  margin-top: 80px; /* Profile Pic is half in main */
}

#typewriter {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  font-family: 'Courier New';
}
#typewriter::after {
  content: '|';
  animation: blink 500ms linear infinite alternate;
}

.string-highlight, a.string-highlight {
  font-weight: bold;
  color: var(--primary-color);
}

.about-key {
  margin-left: 30px;
}

.fact,
a.fact {
  display: block;
  padding: 5px 0;
  transition: all 0.2s;
  margin-left: 60px;
  font-family: "Courier New";
  cursor: pointer;
}

.fact:hover,
a.fact:hover, .fact:active,
a.fact:active, a.fact.active {
  line-height: 1.9;
  padding: 8px 0;
  filter: brightness(1.4);
}
.fact:active,
a.fact:active, a.fact.active {
  border-left: 3px solid var(--primary-color);
  padding-left: 8px;
}

.fact-description section {
  display: none;
  justify-content: center;
  flex-direction: column;
  position: absolute;
  right: 0;
  top: 50%;
  width: 100%;
  transform: translate(calc(100% + 40px), calc(-50% - 60px));
  max-width: 300px;
  font-size: 1.1rem;
  padding: 16px;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(0,0,0,0.2);
  opacity: 1;
  transition: opacity 0.25s ease-in-out;
  animation: fadeIn 0.25s;
}
.fact-description section::after{
  content: '';
  position: absolute;
  border: 15px solid transparent;
  border-top: 15px solid white;
  top: 0px;
  left: -15px;
}
.fact-description section.active {
  display: flex;
}

.fact-description section button.close-fact-description {
  display: flex;
  justify-content: center;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: transform 0.25s ease-in-out;
  outline: none;
}
.fact-description section button.close-fact-description:hover {
  transform: translateY(-5px);
}
.fact-description section button.close-fact-description:focus > lottie-player, .fact-description section button.close-fact-description:active > lottie-player {
  outline: none;
  border: 1px solid var(--primary-color);
  border-radius: 50%;
}


/* Footer */

footer {
  grid-column: 1 / end;
  grid-row: 3 / end;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.link-list {
  flex: 0 1 200px;
  margin-left: 30px;
  margin-top: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  animation: blob 8s;
}

.link-list > li > * {
  width: 20px;
  height: 20px;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0.75;
  display: block;
  transition: transform 0.25s;
}

.link-list > li > *:hover {
  color: var(--primary-color-darker);
  transform: scale(1.1);
}

.github {
  background-image: url('../assets/images/social-media2/github.svg');
  animation: blob 9s;
}

.behance {
  background-image: url('../assets/images/social-media2/behance.svg');
  animation: blob 9.2s;
}

.instagram {
  background-image: url('../assets/images/social-media2/instagram.svg');
  animation: blob 9.4s;
}

.linkedin {
  background-image: url('../assets/images/social-media2/linkedin.svg');
  animation: blob 9.6s;
}

@keyframes blob {
  0% {
    transform: scale(0);
  }
  96% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}

.imprint {
  margin-right: 30px;
}

@media (max-width: 1120px) {
  .grid {
    grid-template-rows: 28% 1fr 8%;
    grid-template-columns: 15% 70% 15%;
  }

  main #typewriter {
    margin: 0 auto;
    font-size: 0.9rem;
  }

  main {
    grid-column: 1 / end;
    width: 100%;
    margin-top: 20px;
  }

  .fact-description {
    width: 100%;
  }

  .fact-description section {
    width: 100%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  .fact-description section::after {
    border: none;
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* TYPEWRITER Animations */
@-webkit-keyframes blink {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@-moz-keyframes blink {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes blink {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
