
/* HTML */

html {

  /* Color Variables */
  --form-background: #fcfcfc;
  --brightest: #eaeaea;
    --brightestRGBA: rgba(234,234,234,0.95);

  --bright: #e0e0e0;
  --darkest: #1b1b1b;
    --darkestRGBA: rgba(27,27,27,0.8);

  --blue: #4c78b3;
    --blueRGBA: rgba(76,120,179,0.8);

  /* Font Family */
  --name: 'Open Sans', sans-serif;
  --form-text: 'Noto Sans', sans-serif;
  --jumbotron-heading: 'Montserrat', Verdana, sans-serif;
  --heading: 'Raleway', Verdana, sans-serif;
  --main-text: 'Roboto', Verdana, sans-serif;

  /* Container */
  --container: 80rem; /* 1280px */
  --jumbotron-height: 44.0625rem;

  background-color: var(--darkblue);
  font-size: 16px;
  margin: 0;
}

a {
  color: var(--brightest);
  text-decoration: none;
}

a:visited {
  color: var(--brightest);
}

a:focus,
a:hover {
  color: var(--darkest);
}

h1:hover,
main .buttons a:hover {
  transform: scale(1.2);
}

a,
li,
p {
  font-family: var(--main-text);
}

h1,
h2,
h3,
h4 {
  font-family: var(--heading);
  font-weight: bold;
  text-align: center;
}

h1 {
  background-color: var(--brightest);
  color: var(--darkest);
  font-family: var(--jumbotron-heading);
  font-size: 5.5rem;
  margin: auto;
  opacity: 0.6;
  padding: 0.5rem 1rem 1.1rem 1rem;
  position: relative;
  transition: all 0.2s;
  width: fit-content;
  z-index: 10;
}

h2 {
  font-size: 3.5rem;
  letter-spacing: 0.15rem;
}

h3 {
  font-size: 2.2rem;
  letter-spacing: 0.08rem;
}

h4 {
  font-size: 1.3rem;
  letter-spacing: 0.1rem;
  text-align: left;
}

h1:hover,
h2:hover,
h3:hover,
h4:hover,
p:hover {
  cursor: default;
}

h1,
li,
input,
textarea {
  border-radius: 0.4rem;
}

h1:focus,
h1:hover {
  color: var(--blue);
  opacity: 0.8;
}

@media only screen and (max-width: 1170px) {
  h1 {
    font-size: 4rem;
  }
  h2 {
    font-size: 3rem;
  }
  h3 {
    font-size: 2rem;
  }
  h4 {
    font-size: 1.2rem;
  }
}

@media only screen and (max-width: 800px) {
  h1 {
    font-size: 3rem;
    padding: 0.5rem 1rem 0.8rem 1rem;
  }
  h2 {
    font-size: 2.5rem;
  }
  h3 {
    /* font-size: 1.8rem; */
  }
}

@media only screen and (max-width: 600px) {
  h1 {
    background-color: transparent;
    border-radius: 0;
    color: var(--brightest);
    line-height: 3.5rem;
    opacity: 1;
    padding: 1rem;
    transform: none;
  }
  h1:focus,
  h1:hover {
    color: var(--brightest);
    opacity: 1;
    transform: none;
  }
}

@media only screen and (max-width: 400px) {
  h1 {
    font-size: 2.5rem;
  }
  h2 {
    font-size: 2rem;
  }
  h3 {
    font-size: 1.5rem;
  }
}


/*HEADER*/

header {
  background-color: var(--brightest);
  border-bottom: 1px solid var(--darkest);
  font-size: 1.4rem;
  justify-content: space-between;
  left: 0;
  margin: 0 auto;
  /* padding: 0 1rem; */
  position: fixed;
  right: 0;
  transition: all 0.2s;
  z-index: 15;
}

.navbar-fixed-top {
  padding: 0.5rem;
  transition: all 0.2s;
}

.navbar-shrink {
  padding: 0 0.5rem;
  transition: all 0.2s;
}

header,
header div div,
header ul {
  align-items: center;
  display: flex;
}

header picture {
  height: 3.125rem; /* 50px */
}

#logo-box a:first-child {
  display: flex;
  margin: 0;
}

#logo-box a:last-child {
  font-family: var(--name);
  margin-left: 1rem;
}

nav {
  display: flex;
  font-size: 1.2rem;
}

header a {
  color: var(--darkest);
  display: inline-block;
  margin: 0 0.4rem;
  transition: all 0.2s;

  /* Flickering fix */
    transform: translateZ(0) scale(1.0, 1.0);
    backface-visibility: hidden;
}

.header-text {
  transition: all 0.2s;
}

#logo-box .header-text:hover {
  transform-origin: left;
}

#logo-box .header-text:hover,
nav a:focus,
nav a:hover {
  transform: scale(1.12);
}

header a:visited {
  color: var(--darkest);
}

header a:focus,
header a:hover {
  color: var(--blue);
}

nav a {
  padding: 0.5rem 0.3rem;
}

.desktop {
  display: block;
}

.mobile {
  display: none;
}

.mobile a:focus,
.mobile a:hover {
  transform: scale(1.2);
}

.active {
  background-color: var(--blueRGBA);
  border-radius: 0.3rem;
}

@media only screen and (max-width: 800px) {
  #logo-box .header-text {
    display: none;
  }
  nav {
    font-size: 1rem;
  }
}

@media only screen and (max-width: 600px) {
  nav a {
    margin: 0 0.3rem;
    padding: 0;
  }
  nav a:focus,
  nav a:hover {
    transform: none;
  }
  header {
    padding-left: none;
    padding-right: none;
  }
  .navbar-fixed-top {
    padding: 0;
  }

  .navbar-shrink {
    padding: 0.5rem;
  }
  .desktop {
    display: none;
  }
  .mobile {
    display: flex;
    font-size: 1.8rem;
    justify-content: space-around;
    width: -webkit-fill-available;
  }
}


/* MAIN */

main {
  margin: 0 auto;
  position: relative;
  top: 3.125rem;
}

.container {
  align-items: center;
  flex-direction: row;
  justify-content:space-between;
  margin: 0 auto;
  max-width: var(--container);
  width: 100%;
}

header .container,
#jumbotron .container,
footer .container {
  display: flex;
  max-width: 100%;
}

main a:visited {
  color: inherit;
}
main a:focus {
  color: inherit;
 }

section {
  margin: auto;
  padding: 6rem 0;
}

section:nth-child(odd){
  background-color: var(--brightest);
  color: var(--darkest);
}

footer,
section:nth-child(even){
  background-color: var(--blue);
  color: var(--brightest);
}

ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  padding: 0 2rem;
}

li {
  box-shadow: 1px 1px 15px var(--darkest);
  background-color: var(--darkest);
  color: var(--brightest);
  transition: all 0.2s;
  width: 30rem;
}

li a {
  display: block;
  height: 100%;
}

li:nth-child(odd):focus,
li:nth-child(odd):hover {
  transform: scale(1.1);
  transform-origin: left;
}

li:nth-child(even):focus,
li:nth-child(even):hover {
  transform: scale(1.1);
  transform-origin: right;
}

.box:focus,
.box:hover {
  background-color: var(--bright);
  color: var(--darkest);
}

@media only screen and (max-width: 1170px) {
  li:nth-child(odd):focus,
  li:nth-child(odd):hover,
  li:nth-child(even):focus,
  li:nth-child(even):hover {
    transform-origin: center;
    transform: none;
  }
}

@media only screen and (max-width: 600px) {
  ul {
    padding: 0;
  }
}


/* Jumbotron */

#jumbotron {
  align-items: center;
  display: flex;
  justify-content: center;
  padding-top: 0;
  padding-bottom: 0;
}

#jumbotron > div {
  background-color: var(--darkest);
  display: flex;
  height: var(--jumbotron-height);
  width: 100%;
}

#jumbotron-background {
  background-image: url('../images/jumbotron-1920x938.jpg');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  height: inherit;
  opacity: 0.35;
  position: absolute;
  width: 100%;
  z-index: 5;
}

@media only screen and (max-width: 1170px) {
  #jumbotron > div {
    height: 35rem;
  }
}

@media only screen and (max-width: 800px) {
  #jumbotron > div {
    height: 30rem;
  }
}

@media only screen and (max-width: 600px) {
  #jumbotron > div {
    height: 25rem;
  }
}


/* Projects */

#projects ul {
  line-height: 1.4rem;
}

#projects li {
  margin: 3rem 2rem 2rem 2rem;
}

#projects li:nth-child(n+5) {
  margin-bottom: 0;
}

#projects figure {
  border-radius: 0.4rem;
  height: 20rem;
  overflow: hidden;
}

#projects img {
  opacity: 0.5;
  transition: all 0.4s;
  width: 100%
}

#projects img + figcaption {
  transition: all 0.4s;
}

#projects figure:focus img,
#projects figure:hover img {
  opacity: 1;
}

#projects figure:focus figcaption,
#projects figure:hover figcaption {
  /* bottom: 8.8rem; */
  transform: translatey(-100%);
}

#projects figcaption {
  background-color: var(--darkestRGBA);
  color: var(--brightest);
  padding: 1.2rem;
  position: relative;
  /* bottom: -8.8rem; */
}

#projects h3,
#projects h4 {
  margin-bottom: 0.5rem;
}

#projects p {
  margin-bottom: 1rem;
}

#projects figcaption div {
  display: flex;
}

#projects a {
  background-color: transparent;
  border: 1px solid var(--brightest);
  border-radius: 0.2rem;
  color: var(--brightest);
  margin-right: 1rem;
  padding: 0.15rem 0.6rem;
  transition: all 0.2s;

  /* Flickering fix */
    /* transform: translateZ(0) scale(1.0, 1.0); */
    backface-visibility: hidden;
}

#projects a:focus,
#projects a:hover {
  background-color: var(--brightest);
  color: var(--blue);
}

@media only screen and (max-width: 1170px) {
  /* #projects ul {
    padding: 0;
  } */
  #projects li {
    margin-left: 0;
    margin-right: 0;
    width: 42rem;
  }
  #projects li:nth-child(5) {
    margin-bottom: 2rem;
  }
  #projects figure {
    height: 28rem;
  }
  /* li:nth-child(odd):focus,
  li:nth-child(odd):hover,
  li:nth-child(even):focus,
  li:nth-child(even):hover {
    transform-origin: center;
  } */
}

@media only screen and (max-width: 800px) {
  #projects li {
    width: 30rem;
  }
  #projects figure {
    height: 20rem;
  }
}

@media only screen and (max-width: 600px) {
  li {
    border-radius: 0;
  }
  #projects li {
    width: 100%;
  }
  #projects figure {
    border-radius: 0;
    height: auto;
    height: 25rem;
  }
  #projects img {
    height: inherit;
    object-fit: none;
    object-position: top;
  }
  #projects figcaption {
    bottom: 0;
    position: sticky;
  }
  #projects figure:focus figcaption,
  #projects figure:hover figcaption {
    transform: none;
  }
}

/* Skills */

#skills li {
  display: grid;
  margin: 3rem 2rem 0 2rem;
  padding-top: 2rem;
}

#skills ul div {
  align-items: center;
  display: flex;
  flex-direction: column;
  padding: 2rem 4rem;
}

#skills h4 {
  font-weight: 400;
  margin-bottom: 1rem;
  text-align: center;
  padding: 0.2rem;;
}

#skills h4:focus,
#skills h4:hover {
  animation: color-change 0.25s forwards;
}

@keyframes color-change {

  0% {
    color: var(--darkest);
  }

  25% {
    transform: scale(1.02) rotateZ(4deg);
  }

  50% {
    transform: scale(1.04) rotateZ(-2.5deg);
  }

  75% {
    transform: scale(1.08) rotateZ(1deg);
  }

  100% {
    color: var(--blue);
    transform: scale(1.12) rotateZ(0deg);
    background-color: var(--brightest);
    border-radius: 0.2rem;
    letter-spacing: 0.3rem;
  }
}

#skills h4:last-child {
  margin-bottom: 0;
}

@media only screen and (max-width: 400px) {
  #skills ul {
    /* padding: none; */
  }
}


/* Education */

#education li {
  display: grid;
  margin: 3rem 2rem 0 2rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

#education h3 {
  margin-bottom: 2rem;
  /* Flickering fix */
    transform: translateZ(0) scale(1.0, 1.0);
    backface-visibility: hidden
}

.education-info {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  min-height: 10rem;
  padding: 0 2rem;
}

.certificate-box {
  align-items: center;
  display: flex;
  justify-content: flex-end;
  padding: 0 2rem 0 2rem;
}

#education p {
  font-size: 1.5rem;
}

#education a {
  background-color: var(--darkest);
  border: 1px solid var(--darkest);
  border-radius: 0.2rem;
  color: var(--brightest);
  opacity: 0;
  padding: 0.25rem 0.7rem;
  transition: all 0.2s;
}

#education li:focus a,
#education li:hover a {
  opacity: 1;
}

#education a:focus,
#education a:hover {
  background-color: var(--brightest);
  color: var(--blue)!important;
}



@media only screen and (max-width: 400px) {
  #education li,
  #skills li {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
  }
}



/* Contact */

form {
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  padding-top: 3rem;
  width: 35rem;
}

#name,
#mail,
#message {
  background-color: var(--form-background);
  font-family: var(--form-text);
  margin-bottom: 1rem;
  padding: 0.6rem 1.5rem;
}

input,
textarea {
  border-style: none;
  font-size: 1.5rem;
}

textarea {
  height: 10rem;
  resize: none;
}

input:focus,
textarea:focus,
button:focus {
  outline: none;
}
#send {
  color: var(--brightest);
  font-family: var(--main-text);
  background-color: var(--darkest);
  border: 1px solid var(--darkest);
  height: 2.5rem;
  transition: all 0.2s;
  width: 5.5rem;
}

#send:hover {
  cursor: pointer;
}

#send:focus,
#send:hover {
  background-color: var(--brightest);
  color: var(--blue);
  transform: scale(1.2);
  transform-origin: left top;
}

@media only screen and (max-width: 800px) {
  #send {
    margin: auto;
    margin-top: 2rem;
  }
  #send:focus,
  #send:hover {
    transform-origin: center;
  }
}

@media only screen and (max-width: 600px) {
  form {
    width: 100%;
  }
  #name,
  #mail,
  #message {
    border-radius: 0;
  }
}

/* FOOTER */

footer {
  align-items: center;
  display: flex;
  font-size: 3.5rem;
  height: 10rem;
  justify-content: center;
  position: relative;
}

footer .container {
  justify-content: center;
}

footer i {
  margin: 0 1rem;
  transition: all 0.2s;
}

footer i:focus,
footer i:hover {
  transform: scale(1.2);
  color: var(--bright);
}

footer a,
footer a:visited {
  color: var(--darkest);
}
