@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400&family=Niconne&display=swap');

:root {

  /* Colors: */
  --color-sub-white: rgb(236, 236, 236);
  --color-dark-grey: rgb(96, 96, 96);
  --color-grey: rgb(136, 136, 136);
  --color-black-glass: rgba(36, 36, 36, 0.376);

  /**Standard Values**/
  --standard-letter-spacing: 1px;
  --standard-transition-fast: 0.316s;
  --standard-transition-medium: 0.716s;
  --standard-transition-slow: 1.216s;
  /*Fonts*/
  --standard-font-family: 'Inter', sans-serif;
  --standard-font-family-cursive: 'Niconne', sans-serif;

  /**Navigational elements**/
  --nav-color: rgb(255, 255, 255);
  --nav-anchor-hover-color: rgb(36, 36, 36);
  --nav-anchor-bg-color: rgba(36, 36, 36, 0);
  --nav-anchor-hover-bg-color: rgba(36, 36, 36, 0);
  --nav-anchor-font-size: clamp(13px, 1.65vh, 18px);
  --nav-anchor-letter-spacing: 1.36ch;
  --nav-anchor-hover-letter-spacing: 1.4ch;
}

body {
  background-image: url("../img/backdrop.webp");
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-position: center;
  background-size:cover;
  font-family: var(--standard-font-family);
  padding: 0;
  margin: 0;
}

nav {
  bottom: 35vh;
  color: var(--nav-color);
  display: flex;
  flex-flow: column wrap;
  justify-content: center;
  left: 5%;
  position: absolute;
  right: 65%;
  top: 43.5vh;
}

.sideline:before {
  background-color: transparent;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  bottom: 100%;
  content: '';
  left: 100%;
  position: absolute;
  right: -1px;
  top: 0;
  transition-duration: var(--standard-transition-medium);
}

.sideline:hover:before {
  bottom: 0;
  box-shadow: 0 0 45px rgba(0, 0, 0, 0.75);
}

.sideline:after {
  background-color: transparent;
  content: '';
  inset: 0 -1px 0 100%;
  position: absolute;
  transform: scaleY(0);
  transform-origin: left;
  transition-duration: var(--standard-transition-medium);
}

.sideline:hover:after {
  background: white;
  transform: scaleY(1);
  transform-origin: center;
  transition-delay: .125s;
}

.sideline:has(a:nth-of-type(1):hover):hover:after {
  transform: scaleY(.45) translateY(0) scaleX(3);
  transform-origin: top;
}

.sideline:has(a:nth-of-type(2):hover):hover:after {
  transform: scaleY(.45) translateY(60%) scaleX(3);
  transform-origin: top;
}

.sideline:has(a:nth-of-type(3):hover):hover:after {
  transform: scaleY(.45) translateY(5%) scaleX(3);
  transform-origin: bottom;
}

nav a {
  align-items: center;
  background-color: var(--nav-anchor-bg-color);
  color: var(--nav-color);
  display: flex;
  font-size: var(--nav-anchor-font-size);
  font-family: var(--standard-font-family);
  height: 5vh;
  justify-content: center;
  letter-spacing: var(--nav-anchor-letter-spacing);
  margin: 5px 0 5px 0;
  position: relative;
  text-decoration: none;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  text-transform: uppercase;
  transition: all var(--standard-transition-fast);
}

nav a:hover,
nav .active {
  background-color: var(--nav-anchor-hover-bg-color);
  color: var(--nav-anchor-hover-color);
  font-size: var(--nav-anchor-font-size);
  letter-spacing: var(--nav-anchor-hover-letter-spacing);
  margin: 5px 0 5px 0;
  text-transform: uppercase;
}

nav a:before,
nav .active:before {
  background-color: white;
  border-radius: 18px 0 0 18px;
  content: "";
  height: 100%;
  inset: 0;
  opacity: 0;
  position: absolute;
  transform: scaleX(0);
  transform-origin: right;
  transition: all var(--standard-transition-slow);
  z-index: -1;
}

nav:not(.sideline):not(.open) a:before,
nav:not(.sideline):not(.open) .active:before {
  border-radius: 8px 0 0 8px;
  transform: scaleX(1);
}

nav:not(.sideline):not(.open) .active:before {
  background: transparent;
  transition: 1.015s;
}

nav a:hover:before,
nav a:focus:before,
nav .active:before {
  background-color: white;
  content: "";
  height: 100%;
  opacity: 1;
  transform: scaleX(1);
}

nav a:after {
  border-radius: 50%;
  content: '';
  inset: calc(50% - 7.5px) 15px calc(50% - 7.5px) auto;
  height: 15px;
  opacity: 0;
  position: absolute;
  transition-delay: 1s;
  transition-duration: var(--standard-transition-fast);
  width: 15px;
}

nav .active:after {
  opacity: 1;
  transition-delay: 0.35s;
  transition-duration: var(--standard-transition-fast);
}

section {
  align-items: center;
  background-color: rgb(0, 0, 0);
  background-color: rgba(0, 0, 0, 0.9);
  color: rgb(235, 235, 235);
  display: flex;
  flex-flow: column nowrap;
  inset: 0 0 0 calc(35% + 5px);
  display: none;
  opacity: 0;
  overflow-y: auto;
  padding: 5vh 1vw 15px 1vw;
  position: absolute;
  text-align: center;
  transform-origin: top;
  transition-duration: var(--standard-transition-slow);
}

.viewable {
  display: flex;
  opacity: 1;
  transition-delay: .236s;
  transition-duration: var(--standard-transition-slow);
}

section article {
  background: rgba(236, 236, 236, .736);
  backdrop-filter: none;
  display: flex;
  flex-flow: column nowrap;
  font-size: 2vh;
  line-height: clamp(45px, 3.95vh, 50px);
  margin: max(5vw, 36px) 5vw;
  padding: 5vw;
  position: relative;
}

section .content {
  background-color: white;
  color: rgb(36, 36, 36);
}

em {
  font-family: var(--standard-font-family-cursive);
  font-size: clamp(3.5vh, 2rem, 5vh);
}

h1 {
  font-family: var(--standard-font-family);
  font-size: clamp(15px, 3vh, 32px);
  font-weight: 300;
  letter-spacing: 1.95vw;
  margin-left: 2.95vw;
  margin-top: 5vh;
  text-transform: uppercase;
}

article {
  backdrop-filter: blur(8px);
  font-family: var(--standard-font-family);
  font-size: clamp(13px, 3vh, 18px);
  font-weight: 300;
  line-height: 2.95rem;
  padding: 3vw;
  margin: 3vh 5vw 1vh 5vw;
}

footer {
  background-color: rgb(35, 35, 35);
  background-color: rgba(45, 45, 45, 0.5);
  border: 1px solid rgb(255, 255, 255);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  bottom: 3.435vh;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
  color: white;
  display: flex;
  font-family: var(--standard-font-family-cursive);
  left: auto;
  right: 3.145vw;
  padding: 0.635vw 3vw 0.735vw 3vw;
  position: absolute;
}

/**Animated close button appearing**/
@keyframes close-button-anim {
  0% {
    top: -50px;
  }
  100% {
    top: 0;
  }
}

@keyframes close-button-anim2 {
  0% {
    display: flex;
    top: 0;
  }
  95% {
    top: -50px;
  }
  100% {
    display: none;
  }
}

.hidden {
  display: none;
}

.close-button {
  align-items: center;
  animation-name: close-button-anim;
  animation-duration: 1.395s;
  animation-iteration-count: 1;
  animation-timing-function: ease-in-out;
  animation-delay: 0.5s;
  animation-fill-mode: forwards;
  background-color: rgb(35, 35, 35);
  border: none;
  border-bottom-left-radius: 45%;
  color: rgb(235, 235, 235);
  display: flex;
  font-size: clamp(5px, 2vh, 15px);
  height: clamp(35px, 5vh, 50px);
  justify-content: center;
  position: absolute;
  right: 0;
  text-transform: uppercase;
  top: -50px;
  width: clamp(35px, 5vh, 50px);
  transition: var(--standard-transition-fast);
}

.x-closed {
  align-items: center;
  animation-name: close-button-anim2;
  animation-duration: 0.935s;
  animation-iteration-count: 1;
  animation-timing-function: ease-in-out;
  animation-delay: 0.45s;
  animation-fill-mode: both;
  height: clamp(35px, 5vh, 50px);
}

.x-closed:hover,
.x-closed:focus {
  height: clamp(35px, 5vh, 50px);
}

/**Porfolio section**/

.portfolio-container {
  align-items: center;
  flex-flow: row wrap;
  justify-content: center;
}

.portfolio-img-container {
  align-items: center;
  border: 3px solid rgba(235, 235, 235, 0.1);
  display: flex;
  justify-content: center;
  height: auto;
  margin: 0.35vw;
  width: 45%;
}

.portfolio-img-container img {
  filter: saturate(5%);
  height: 100%;
  transition: var(--standard-transition-slow);
  width: 100%;
}

.portfolio-img-container:hover img {
  filter: saturate(100%);
  height: 100%;
  width: 100%;
}

/**General animations**/
@keyframes unfold-anim {
  from {
    opacity: 0;
    transform: scaleY(0.95);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

/**General animations**/
@keyframes unfold-flip {
  from {
    opacity: 0;
    transform: scaleX(0.95);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

.unfold {
  animation-name: unfold-flip;
  animation-duration: .35s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
  opacity: 0;
  transform: scaleY(.95);
  transform-origin: 0 0%;
}

.unfold[data-content='about'] {
  animation-delay: 0.95s;
}

.unfold[data-content='contact'] {
  animation-delay: 0.65s;
}

/**Info button**/
.infobutton {
  align-items: center;
  background-color: rgb(45, 45, 45);
  background-color: rgba(35, 35, 35, 0.1);
  border: 1px solid rgb(135, 135, 135);
  border: 1px solid rgba(235, 235, 235, 0.3);
  border-radius: 100%;
  bottom: 3.235vh;
  color: rgb(235, 235, 235);
  color: rgba(235, 235, 235, 0.5);
  display: flex;
  font-size: 18px;
  font-weight: lighter;
  justify-content: center;
  left: 3.235vw;
  position: absolute;
  transition-duration: var(--standard-transition-medium);
  height: 32px;
  width: 32px;
}

.infobutton:hover {
  background-color: rgb(85, 85, 85);
  background-color: rgba(35, 35, 35, 0.8);
  color: rgba(235, 235, 235, 0.8);
  transform: scale(1.235);
}

.infobutton:active {
  background-color: rgb(85, 85, 85);
  background-color: rgba(95, 95, 95, 0.8);
  color: rgba(235, 235, 235, 0.8);
}

.infobutton .info {
  display: none;
}

.infobutton:hover .info {
  bottom: 0.135vh;
  display: flex;
  left: 3.935vw;
  max-width: 35vw;
  min-width: 15vw;
  position: absolute;
}

.hide-info:hover .info {
  display: none;
}

.infobutton .plus {
  display: flex;
  transition-duration: var(--standard-transition-medium);
  transition-timing-function: ease-in-out;
}

.infobutton:hover .plus,
.infobutton:focus .plus {
  transform: scale(1.235);
}

/**Nav menu - only shows on mobile**/
nav .menu {
  align-items: center;
  background-color: rgba(236, 236, 236, .176);
  border: none;
  color: white;
  display: none;
  height: 80%;
  justify-content: center;
  margin-left: auto;
  position: relative;
  margin-right: 5px;
  width: 50px;
  transition: var(--standard-transition-medium);
}

nav .menu div {
  inset: calc(50% - 1px) 33.6% calc(50% - 1px) 33.6%;
  position: absolute;
  transition-duration: var(--standard-transition-fast);
}

nav .menu div,
nav .menu div::after,
nav .menu div::before {
  background: rgba(248, 248, 248, .736);
}

nav .menu div::after,
nav .menu div::before {
  border-radius: 3px;
  content: '';
  inset: 0;
  position: absolute;
}

nav .menu div::after {
  transform: translateY(7px);
}

nav .menu div::before {
  transform: translateY(-7px);
}

form {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

form > div {
  margin: 2vh 0;
}

form > label {
  font-size: .85rem;
  letter-spacing: .76ch;
  margin: 2vh 0 0 0;
  text-transform: uppercase;
}

input[type=text] {
  padding: 15px;
  margin: 0 0 1vh 0;
}

input[type=reset],
input[type=submit],
section button {
  background-color: var(--color-black-glass);
  border: 1px solid var(--color-sub-white);
  color: var(--color-sub-white);
  letter-spacing: .5ch;
  margin: 2ch 1ch;
  padding: 2ch 5ch;
  text-transform: uppercase;
  transition: all .235s ease-in-out;
}

input[type=reset]:hover,
input[type=submit]:hover,
section button:hover {
  background-color: var(--color-sub-white);
  color: var(--color-dark-grey);
}

input[type=reset]::before,
input[type=submit]::before {
  content: ' ';
}

article button {
  margin-top: 35px;
}

@media only screen and (max-width: 768px) {
  :root {
    --nav-anchor-font-size: clamp(15px, 1.65vh, 18px);
  }

  .close-button {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 45%;
    left: 0;
    right: auto;
    z-index: 1000;
  }

  nav .menu {
    display: flex;
  }

  nav .menu-items {
    background-color: rgb(35, 35, 35);
    background-color: rgba(35, 35, 35, 0.5);
    box-shadow: -2px 3px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-flow: column nowrap;
    height: auto;
    left: auto;
    min-width: 35vw;
    position: absolute;
    right: 0;
    top: 50px;
  }

  nav .menu-state {
    display: none;
  }

  nav {
    position: fixed;
    align-items: center;
    background-color: transparent;
    flex-flow: row nowrap;
    height: 50px;
    justify-content: space-around;
    inset: 0 0 auto 0;
    padding: 0;
    z-index: 100;
  }

  nav::after {
    display: none;
  }

  nav::before {
    display: none;
  }

  nav a {
    flex: auto;
    height: 75px;
    margin: 0;
    padding: 1vh 48px 1vh 72px;
    width: auto;
  }

  nav a:hover,
  nav .active {
    background-color: white;
    height: 75px;
    letter-spacing: var(--nav-anchor-letter-spacing);
    margin: 0;
    text-shadow: none;
  }

  nav .egnc-social-icons a:hover,
  nav .active {
    height: 100%;
  }

  nav a:before,
  nav .active:before {
    display: none;
  }

  .viewable {
    transform: translateY(50px);
  }
}
