*,
*::before,
*::after {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

body {
    background-color: #252432;
}

.container{
    width: 400px;
    height:400px;
    background-color: #2b294d;
    position: absolute;
    transform: translate(-50%, -50%);
    top: 50%;
    left: 50%;
    border-radius: 8px;
    box-shadow: 0 0 45px rgba(18, 9, 104, 0.4);

}

.cake {
    width: 100%;
    position: absolute;
    bottom: 60px;
}

.bottom-layer, .top-layer, .middle-layer {
    height: 80px;
    width: 240px;
    position: relative;
    margin: auto;
    background-repeat: repeat;
    background-size: 100% 100%, 60px 100px;
    background-position: 28px 0;
    background-image: linear-gradient(
        transparent 50px,
        #e3a953 50px,
        #e3a953 60px,
        transparent 60px
    ),
    radial-gradient(circle at 30px 5px, #713e16 30px, #eac284 31px);
}

.middle-layer {
    transform: scale(0.85);
    top: 72px;
    animation: rise-1 2s forwards;
}

@keyframes rise-1 {
    100% {
        top: 7px;
    }
}

.top-layer {
    transform: scale(0.7);
    top: 144px;
    animation: rise-2 2s 1s forwards;
}

@keyframes rise-2 {
    100% {
        top: 26px;
    }
}

.candle {
    background: repeating-linear-gradient(
        45deg, 
        #fd3018 0,
        #fd3018 5px,
        #ffa89e 5px,
        #ffa89e 10px
    );
    height: 45px;
    width: 15px;
    position: absolute;
    margin: auto;
    left: 0;
    right: 0;
    bottom: 0;
    animation: rise-3 1s 2.7s forwards;
}

@keyframes rise-3 {
    100% {
        bottom: 202px;
    }
}

.candle:after {
    content: "";
    position: absolute;
    height: 16px;
    width: 16px;
    background-color: #ffee54;
    border-radius: 0 50% 50% 50%;
    transform: scale(0) rotate(45deg);
    bottom: 50px;
    animation: flame 1.5s 3.5s forwards;
    box-shadow: 0 0 15px 5px rgba(255, 200, 0, 0.6);
}

@keyframes flame{
    100% {
        transform: scale(1) rotate(45deg);
    }
}

@keyframes flicker {
  0% {
    transform: scale(1) rotate(45deg);
    background-color: #ffee54;
    box-shadow: 0 0 15px 5px rgba(255, 200, 0, 0.6);
  }
  50% {
    transform: scale(1.1) rotate(45deg);
    background-color: #ffae00;
    box-shadow: 0 0 18px 7px rgba(255, 150, 0, 0.7);
  }
  100% {
    transform: scale(0.9) rotate(45deg);
    background-color: #ff6a00;
    box-shadow: 0 0 12px 4px rgba(255, 100, 0, 0.6);
  }
}

.text {
    color: #d1d1d1;
    font-family: "Lato", sans-serif;
    font-weight: 300;
    font-style: italic;
    text-align: center;
    position: absolute;
    bottom: 900px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
}

.text h1, .text p {
    display: block;           
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid #d1d1d1;
    width: 0;                  
    margin: 0 auto;            
    animation-fill-mode: forwards;
}


.text h1 {
    font-size: 1.4em;
    margin-bottom: 10px;
    animation: typing 3s steps(20, end) forwards, blink 0.75s step-end 4;
}

.text p {
    font-size: 1.2em;
    margin-top: 5px;
    animation: typingName 2s steps(15, end) forwards, blink 0.75s step-end 3;
    animation-delay: 3.2s;   
    border-right: 3px solid #d1d1d1;
    display: block;
}

.text h1::after,
.text p::after {
    content: "";
}

@keyframes typing {
    from {width: 0;}
    to {width: 14ch; border-right: none;}
}

@keyframes typingName {
    from {width: 0;}
    to {width: 14ch; border-right: none;}   
}

@keyframes blink {
    50% {border-color: transparent;}
}

