:root {
  --multiplier: 2;
  --ratio: 1.5;
}

* {
  box-sizing: border-box;
  user-select: none;
  font-family: "Cormorant Garamond", Times, serif;
}

body {
  margin: 0;
  width: 100%;
  height: 100%;
}

a {
  text-underline-offset: 0.1em;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
}

.title {
  font-family: "Raleway", Arial, Helvetica, sans-serif;
  font-weight: 700;
  font-size: 2.5em;
}

.subtitle {
  text-align: center;
  padding-bottom: 0.25em;
  font-weight: 400;
}

p {
  line-height: 1.2;
  font-weight: 500;
}

a {
  color: black;
}

.root {
  font-size: min(
    16pt,
    calc(var(--multiplier) * min(1vw, calc(1vh * var(--ratio))))
  );
  position: absolute;
  height: 100%;
  width: 100%;
  background-color: #deab90;
}

#card {
  --width: calc(95em / var(--multiplier));
  width: var(--width);
  height: calc(var(--width) / var(--ratio));
  position: absolute;
  margin: auto;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  box-shadow: 0.05em 0.05em 2em -0.5em rgba(0, 0, 0, 0.5);
  cursor: pointer;
  background: #fbf8f0;
  will-change: transform;
}

#card:after {
  content: "flip me over";
  position: absolute;
  right: 0;
  top: calc(100%);
  margin-top: 0.5em;
  transition: opacity 0.2s;
  opacity: 1;
}

#card:not(.unflipped):after {
  opacity: 0;
}

.card-contents {
  padding: 1.5em;
  width: 100%;
  height: 100%;
  position: absolute;
  transition: opacity 0.2s;
}

#card.flip > #front,
#card:not(.flip) > #back {
  opacity: 0;
  transition-delay: 0.2s;
  pointer-events: none;
}
#card.flip.flipping > #back,
#card:not(.flip).flipping > #front {
  opacity: 0;
  transition-delay: 0.1s;
}

#card.flip:not(.flipping) {
  transform: perspective(2000px) rotateX(180deg) rotateY(0deg);
}

#front {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#front-name {
  margin-bottom: 0.5em;
}

#back {
  transform: scaleY(-1);
}

#back-grid {
  height: 100%;
  display: grid;
  grid-template-areas:
    "info pic"
    "contact pic";
  grid-template-columns: 1.618fr 1fr;
  grid-template-rows: 1fr auto;
  grid-gap: 1em 2em;
}

#back .pic {
  grid-area: pic;
  background-image: url(me.jpg);
  height: 100%;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  background-repeat: no-repeat;
}

#back .info {
  grid-area: info;
}

#back .info > p {
  text-align: justify;
}

#back .info > p:first-of-type {
  margin-top: 0;
}

#back .contact {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
