@import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro');

$color-black: #000;
$color-white: #fff;
$color-silver: #cdcdcd;
$color-friar-gray: #787877;
$color-amulet: #7fa684;
$color-sea-mist: #cadbc8;
$color-everglade: #215433;
$color-emperor: #505050;
$color-mine-shaft: #3e3e3e;
$grid-gap: 0;
$grid-max-width: 680px;
$item-height: calc(#{$grid-max-width} / 5);
$grid-max-width-small: 75vw;
$item-height-small: calc(90vw / 5);
$small: $grid-max-width + 320px;

* {
  box-sizing: border-box;
}

html {
  display: flex;
  height: 100%;
  width: 100%;
}

body {
  position: relative;
  margin: auto;
}

main {
  position: relative;
  padding: 4rem;
  
  .shadow,
  .cylinder,
  .chessboard {
    transition: 0.45s all 0.45s;
  }
  
  &.active {
    .shadow,
    .cylinder,
    .chessboard {
      opacity: 0;
      transition: 0.45s;
    }
    
    .cylinder {
      transform: translateY(-15%);
    }
    
    .shadow {
      transform: translateY(-15%) skew(10deg);
    }
    
    .chessboard-transparent {
      transform: scale(1.35);
      transition: 0.45s transform 0.95s;
      
      .same {
        color: $color-mine-shaft;
        transition: 0.45s color 0.45s;
      }
      
      .cell-a {
        transform: translateY(200%);
        transition: 0.45s transform 0.45s, 0.45s color 0.45s;
      }
    }
  }
}

.container {
  position: relative;
  margin: 0 auto;
  width: $grid-max-width;
  
  @media screen and (max-width: $small) {
    width: $grid-max-width-small;
  }
}

.text {
  text-align: center;
  font-size: 1.75rem;
  margin: 4.25rem 0 0;
  letter-spacing: 2px;
  font-family: 'Source Sans Pro', sans-serif;
  
  .button-reveal {
    cursor: pointer;
    font-size: 1rem;
    padding: 0.75rem 1rem;
  }
}

.chessboard,
.chessboard-transparent {
  position: relative;
  transform: perspective(2040px) rotateX(50deg) rotate(30deg);
}

.chessboard {
  /*
  box-shadow: $color-emperor 1px 1px 0,
    $color-emperor 2px 2px 0,
    $color-emperor 3px 3px 0,
    $color-emperor 4px 4px 0,
    $color-emperor 5px 5px 0,
    $color-emperor 6px 6px 0,
    rgba($color-black, 0.15) 20px 20px 25px;
  */
  
  .cell {
       
    &:nth-child(even) {
      .item {
        background: $color-friar-gray;
      }
    }
    
    .item {
      background: $color-silver;
    }
  }
}

.chessboard-transparent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: 0.45s transform;
 
  .cell {
    transition: 0.45s;
    
    &.cell-a {
      color: $color-emperor;
    }
    
    &.cell-b {
      color: $color-mine-shaft;
    }
    
    &.same {
      text-align: center;
      font-size: 3rem;
      line-height: $item-height;
      background: $color-friar-gray;
      
      @media screen and (max-width: $small) {
        font-size: 2rem;
        line-height: $item-height-small;
      }
      
    }
  }
}

.shadow {
  position: absolute;
  top: 38%;
  left: 0%;
  height: 29%;
  width: 94%;
  border-radius: 100%;
  transform: rotate(-10deg);
  filter: blur(22px);
  background: rgba($color-black, 0.425);
  z-index: 0;
}

.cylinder {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 28%;
  
  .circle {
    position: relative;
    height: 14%;
    border-radius: 100%;
    background: $color-amulet;
    z-index: 1;
  }
  
  .rectangle {
    position: relative;
    height: 38%;
    transform: translateY(-17%); 
    background: linear-gradient(to right, $color-everglade 58%, $color-sea-mist 100%);
    
    &::after {
      position: absolute;
      content: "";
      left: 0;
      right: 0;
      bottom: -20%;
      height: 40%;
      border-radius: 100%;
      background: linear-gradient(to right, $color-everglade 58%, $color-sea-mist 100%);
    }
  }
}

.row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-gap: $grid-gap;
  max-width: $grid-max-width;
  margin: 0 auto;
  grid-template-columns: repeat(5, 1fr);
  
  @media screen and (max-width: $small) {
    max-width: $grid-max-width-small;
  }
  
  .cell {
    position: relative;
    grid-column: span 1;
    
    .item {
      height: $item-height;
      
      @media screen and (max-width: $small) {
        height: $item-height-small;
      }
    }
  }
}
