:root {
  --yangColor: rgb(238, 236, 226);
  --rColor: #383ada;
  --gColor: #28263a;
  --bColor: #054468;
  --yinColor: #686864;
  --borderRadius: 20px;
}

html {
  font-size: 2vmin;
  font-family: 'Roboto', sans-serif;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
}

*,
*::before,
*::after {
  font-size: inherit;
  font-family: inherit;
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}

.canvas {
  position: 100vw;
  height: 100vh;
  background: var(--yinColor);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.container {
  display: flex;
  flex-flow: row wrap;
  justify-content: space-between;
  width: 90vw;
}

.card {
  position: relative;
  display: grid;
  grid-template-columns: 300px;
  grid-template-rows: 210px 240px;
  grid-template-areas: 'image' 'text';
  border-radius: var(--borderRadius);
  background: var(--yinColor);
  text-align: center;
  font-size: 12px;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.rgb::after {
  position: absolute;
  content: '';
  background: linear-gradient(
      45deg,
      #ff0000 0%,
      #ff9a00 10%,
      #181817 20%,
      #4fdc4a 30%,
      #3fdad8 40%,
      #2fc9e2 50%,
      #1c7fee 60%,
      #5f15f2 70%,
      #ba0cf8 80%,
      #fb07d9 90%,
      #ff0000 100%
    )
    repeat 0% 0% / 300% 100%;
  inset: -3px;
  animation: rgb 8s linear infinite;
  border-radius: var(--borderRadius);
  filter: blur(8px);
  z-index: -1;
  transform: translateZ(-1px);
}

.rgb:nth-child(2)::after {
  animation-delay: 2s;
}

.rgb:nth-child(3)::after {
  animation-delay: 4s;
}

.rgb:nth-child(4)::after {
  animation-delay: 6s;
}

@keyframes rgb {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.card-image {
  grid-area: image;
  background-size: cover;
  background-position: 50% 50%;
  background-repeat: no-repeat;
  border-top-left-radius: var(--borderRadius);
  border-top-right-radius: var(--borderRadius);
}

.painting .card-image {
  background-image: url('images/art.jpg');
}

.painting .card-title {
  color: var(--rColor);
}

.code .card-image {
  background-image: url('images/code.jpg');
}

.code .card-title {
  color: var(--gColor);
}

.music .card-image {
  background-image: url('images/ian-anderson.jpg');
}

.music .card-title {
  color: var(--bColor);
}

.maths .card-image {
  background-image: url('images/math.jpg');
}

.penspinning .card-image {
  background-image: url('images/penspinning.jpg');
}

.speedcubing .card-image {
  background-image: url('images/speedcubing.jpg');
}

.card-description {
  grid-area: text;
  color: var(--yangColor);
  margin: 25px;
  transform: translateZ(30px);
}

.card-title {
  font-size: 2em;
  margin-bottom: 15px;
}

.js-tilt-glare {
  border-radius: var(--borderRadius);
}

@media (max-width: 1200px) {
  .canvas {
    height: 100%;
    min-height: 100%;
  }

  .container {
    justify-content: center;
  }

  .card {
    margin: 50px 20px;
  }
}

.btn {
    display: inline-block;
    background-color: #0e301c;
    color: white;
    padding: 8px 15px;
    border-radius: 10px;
    text-decoration: none;
    margin-top: 10px;
}

