@font-face {
  font-family: CeraPro;
  src: url('CeraPro-Light.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

:root {
  --black:    rgba(000, 000, 000, 1.0);
  --shadow:   rgba(000, 000, 000, 0.2);
  --grey:     rgba(075, 075, 075, 1.0);
  --grey50:   rgba(075, 075, 075, 0.5);
  --orange:   rgba(253, 185, 019, 1.0);
  --bone:     rgba(245, 245, 245, 1.0);
  --white:    rgba(255, 255, 255, 1.0);
}

html, body {
  overflow: hidden;
}

body {
  cursor: default;
  min-width: 100vw;
  min-height: 100vh;
  font-family: CeraPro, roboto, helvetica, arial, serif;
  perspective-origin: 50% 50%;
  transform-style: preserve-3d;
  justify-content: center;
  align-items: center;
  perspective: 50rem;
  display: flex;
}

#loading-mask, body {
  background-color: var(--bone);
}

#card {
  transform-style: preserve-3d;
  z-index: 0;
  position: relative;
}

#loading-mask {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  position: fixed;
  z-index: 99;
}

#img-face, #info-face {
  background-color: var(--white);
  backface-visibility: hidden;
  transform-style: preserve-3d;
  text-align: center;
  position: absolute;
  border-radius: 0.625rem;
  color: var(--black);
  justify-content: space-around;
  flex-flow: column wrap;
  align-items: center;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
}

#img-face, #info-face, #info-face__email-text-overlay, .project {
  box-shadow: 0 0.125rem 0.3125rem var(--shadow);
}

#img-face{
  z-index: -2;
}

#img-face::before {
  z-index: -2;
  content: "";
  position: absolute;
  display: block;
  width: 0;
  top: 0;
  right: 0;
  border-width: 0;
  border-style: solid;
  border-color: var(--bone) var(--bone) transparent transparent;
  background: var(--white);
  border-radius: 0 0 0 0.625rem;
}

#img-face::after {
  z-index: -2;
  content: "";
  position: absolute;
  display: block;
  width: 4rem;
  height: 2rem;
  top: -2rem;
  right: -2rem;
  transform: rotate(45deg);
  transform-origin: bottom;
  background: var(--bone);
  pointer-events: none;
}

#img-face__image {
  opacity: 1;
  pointer-events: none;
  position: absolute;
  left: -3rem;
  bottom: 1rem;
  stroke-width: 0.5;
  stroke: var(--grey);
  fill: var(--grey);
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  stroke-opacity: 1;
  fill-opacity: 0;
  width: calc(100% + 2rem);
}

#info-face__name {
  font-size: 1.5rem;
  z-index: 1;
}

#info-face__title {
  font-size: 1rem;
  z-index: 1;
}

#info-face__email {
  transition: transform .3s ease-in-out;
  backface-visibility: hidden;
  transform: scale(0.8);
  position: relative;
  stroke: var(--white);
  stroke-dasharray: 0, 70;
  stroke-dashoffset: 16;
}

#info-face__email-image {
  height: 3.85rem;
  width: auto;
  fill: var(--orange);
}

#info-face__email-text-overlay {
  transition: width .33s ease-in-out;
  background-color: var(--grey);
  border-radius: 0 0.25rem 0.25rem 0;
  position: absolute;
  overflow: hidden;
  height: 1.875rem;
  z-index: -1;
  left: 3.45rem;
  top: 0.95rem;
}

#info-face__email:not(:hover) > #info-face__email-text-overlay {
  width: 0 !important; /* updated via js */
}

#info-face__email-text {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--white);
  white-space: nowrap;
  padding: 0.1875rem 0 0 0.375rem;
  position: absolute;
  font-size: 1.25rem;
  z-index: 1;
}

#info-face__email:hover, #info-face__email:active {
  user-select: none;
  stroke: var(--grey);
}

#info-face__email:hover {
  transform: scale(1);
}

@keyframes dash {
  0% { stroke-dasharray: 0, 70; }
  100% { stroke-dasharray: 70, 0; }
}

#info-face__email:hover {
  animation: dash 0.75s linear forwards;
}

#info-face__email:active {
  transform: scale(0.8);
}

#info-face__hr {
  transition: transform 1s ease-in-out 1.5s;
  transform: scaleX(0);
  background: var(--orange);
  margin: 0.25rem 0;
  height: 0.125rem;
  border: 0;
}

#info-face__wrapper, #info-face__footer {
  height: 4rem;
  width: 100%;
  overflow: hidden;
  text-decoration: none;
  color: var(--black);
}

#info-face__footer {
  display: flex;
  text-decoration: none;
  color: var(--grey);
  font-style: italic;
  align-items: center;
  justify-content: center;
}


.project {
  background-color: var(--white);
  border: solid 0.125rem var(--white);
  transform-style: preserve-3d;
  transition: width .3s ease;
  border-radius: 0.75rem;
  position: absolute;
  overflow: hidden;
  z-index: -1;
  width: 0;
  will-change: all;
}

.project.inactive {
  opacity: 0.5;
}

.project__image {
  display: inline-block;
  position: absolute;
  height: 3.25rem;
  width: auto;
  left: 0;
  overflow: hidden;
  object-fit: contain;
  border-radius: 0.65rem;
}

.project__text {
  text-decoration: inherit;
  text-align: left;
  color: inherit;
  float: right;
  width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}
.project__text-title {
  font-weight: 500;
  margin: 0;
  font-size: 1rem;

}
.project__text-description {
  margin: 1px 0 0 0;
  font-size: 0.8125rem;
}

.project:not(.inactive):hover {
  width: 16.25rem !important;
  z-index: 4 !important;
}

.project:not(.inactive):hover .project__text {
  width: 12.5rem;
}

body.loaded #loading-mask {
  display: none;
}

@keyframes bonsai {
  000% { stroke-dashoffset: 100; }
  100% { stroke-dashoffset: 097; }
}

@keyframes bonsai2 {
  000% { stroke-opacity: 1; fill-opacity: 0; }
  100% { stroke-opacity: 0; fill-opacity: 1; }
}

body.loaded #img-face__image {
  animation: bonsai 5s ease-in forwards, bonsai2 1.5s ease-in 3.5s forwards;
  transition: opacity 0.1s linear 0.9s;
}

@keyframes dogEar {
  0% { border-width: 0; box-shadow: none; }
  100% { border-width: 0 2rem 2rem 0; box-shadow: 0 0.125rem 0.3125rem var(--shadow); }
}

@keyframes dogEarMask {
  0% { transform: rotate(45deg) translateY(0); }
  100% { transform: rotate(45deg) translateY(1.5rem); }
}

/* wait some time before dog-earing card */
body.loaded #img-face::before, body.loaded #img-face::after {
  animation: dogEar 1s ease-in-out 8s forwards;
  transition: opacity 0.1s linear 0.9s;
  opacity: 1;
}

body.loaded #img-face::after {
  animation-name: dogEarMask;
}

/* hide dogear when flipping */
body.flipped #img-face::after, body.flipped #img-face::before {
  opacity: 0;
}

/* hide tree when flipping */
body.flipped #img-face__image {
  opacity: 0;
  animation-play-state: paused;
}

/* animate yellow line after flipping */
body.flipped #info-face__hr {
  transform: scaleX(1);
}
