*{
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-display: optional;
}

html, body{
    height: 100%;
}

main{
    height: 100%;
    background-color: #2C3034;
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes expandCal {
    from{
        transition: all 1s ease;
        height: 20px;
        min-height: 20px;
        z-index: -1;
    }
    to{
        height: 600px;
        min-height: 620px;
        z-index: 1;
    }
}

@keyframes fade-in {
    from{
        opacity: 0;
    }
    to{
        opacity: 1;
    }
}

.container{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px;
    background: linear-gradient(180deg, #4e5357, #2C3034 70%);
    width: 300px;
    height: 600px;
    min-width: 320px;
    min-height: 620px;
    border-radius: 20px;
    box-shadow: 4px 2px 15px 0px #212325;
    position: relative;
    animation: expandCal 1.5s ease;
    animation-fill-mode: both;
}

h1::after{
    content: '';
    inset: 0;
    background-color: #444649;
    -webkit-mask-image: linear-gradient(to right, black 10%, transparent 100%);
    mask-image: linear-gradient(to right, black -1%, transparent 100%);
    border-radius: 20px 0px 0px 0px;
    height: 30vh;
    position: absolute;
}

#third-display::after{
    content: '';
    position: absolute;
    top: 0px;
    left: 0px;
    border-radius: 10px 10px 0px 0px;
    background-color: #4e5357;
    -webkit-mask-image: linear-gradient(to bottom, black 90%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 5%, transparent 100%);
    width: 100%;
    height: 10vh; 
    z-index: 1;
    border-radius: 20px;
    transition: all 0.5s ease;
}

.btn-container{
    width: 100%;
    display: grid;
    align-items: end;
    justify-items: end;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr 1fr 1fr;
    gap: 10px;
}

button{
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 3px;
    height: 64px;
    width: 64px;
    color: rgb(174, 174, 174);
    border-radius: 100%;
    border: none;
    background: linear-gradient(300deg,  #444649,#3f4346 50%);
    box-shadow: 2px 2px 4px 0px #212121;
    isolation: isolate;
    position: relative;
    font-size: x-large;
    animation: fade-in 1.5s ease-in-out 1.5s, all 0.5s ease;
    animation-fill-mode: both;
    transition: all 0.5s ease;
}

button::after{
    content: '';
    height: 100%;
    width: 100%;
    border-radius: inherit;
    box-shadow: -1px -1px 0px 0px #687077;
    position: absolute;
    inset: 0;
    z-index: -1;
    transition: all 0.5s ease;
}

button:hover{
    transform: scale(1.1);
    animation-fill-mode: forward;
}

button:hover::after{
    box-shadow: 0px 0px 5px 0px #212121;
}

h1, p{
    text-align: right;
    width: 100%;
    align-self: self-start;
    font-size: xx-large;
    white-space: nowrap;
    scrollbar-width: none;
    overflow: auto;
}

h1::-webkit-scrollbar{
    display: none;
}

p::-webkit-scrollbar{
    display: none;
}

h1{
    min-height: 0;
    flex-grow: 2;
    font-size: 50px;
    color: rgb(202, 202, 202);
}

p{
    min-height: 0;
    flex-grow: 1;
    color: rgb(146, 146, 146);
}

.equal{
    grid-row: 5/7;
    grid-column: 4/5;
    height: 100%;   
    border-radius: 10px;
    font-size: 2.5em;
    background: linear-gradient(0deg, rgb(103, 1, 162) 5%, rgb(94, 0, 112) 80%);
    animation: fade-in 1.5s ease-in-out 1.5s;
    animation-fill-mode: both;
}

.equal::after{
    content: '';
    inset: 0;
    position: absolute;
    box-shadow: -1px -1px 2px 0px rgb(68, 68, 68);
}

.add{
    grid-column: 4/5;
    grid-row: 4/5;
    animation: fade-in 1.5s ease-in-out 1.6s;
    animation-fill-mode: both;
}

.del{
    grid-column: 3/4;
    grid-row: 5/7; 
    padding-right: 3px;
    animation: fade-in 1.5s ease-in-out 1.7s;
    animation-fill-mode: both;
}

.dot{
    grid-column: 1/2;
    grid-row: 6/7;
    animation: fade-in 1.5s ease-in-out 1.8s;
    animation-fill-mode: both;
}

.clear{
    font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
    color: white;
    background: linear-gradient(0deg, orange);
    text-shadow: 0px 0px 10px white;
    font-weight: bold;
    grid-column: 1/2;
    grid-row: 2/3;
    animation: fade-in 1.5s ease-in-out 1.9s;
    animation-fill-mode: both;
}

.left-par{
    grid-column: 2/3;
    grid-row: 2/3;
    background: linear-gradient(0deg, rgba(255, 166, 0, 0.157));
    backdrop-filter: blur(5px);
    color: rgba(218, 157, 45, 0.811);
    animation: fade-in 1.5s ease-in-out 2s;
    animation-fill-mode: both;
}   

.right-par{
    grid-column: 3/4;
    grid-row: 2/3;
    background: linear-gradient(0deg, rgba(255, 166, 0, 0.157));
    color: rgba(218, 157, 45, 0.811);
    animation: fade-in 1.5s ease-in-out 2.1s;
    animation-fill-mode: both;
}

.add, .subtract, .divide, .multiply{
    transition: all 0.5s ease;
    background: linear-gradient(0deg, rgba(255, 26, 251, 0.157));
    color: rgba(255, 26, 251, 0.556);
}

button:active{
    color: rgb(244, 243, 243);
    background: linear-gradient(300deg,  #444649,#3f4346 50%);
    box-shadow: 1px 1px 2px 0px #212121;
    transition: all 0.1s ease-in-out;
    transform: scale(1);
}

.add{
    grid-column: 4/5;
    grid-row: 4/5;
    animation: fade-in 1.5s ease-in-out 2.2s;
    animation-fill-mode: both;
}

.subtract{
    grid-column: 4/5;
    grid-row: 3/4;
    animation: fade-in 1.5s ease-in-out 2.3s;
    animation-fill-mode: both;
}

.divide{
    grid-column: 4/5;
    grid-row: 2/3;
    animation: fade-in 1.5s ease-in-out 2.4s;
    animation-fill-mode: both;
}

.multiply{
    grid-column: 4/5;
    grid-row: 1/2;
    animation: fade-in 1.5s ease-in-out 2.5s;
    animation-fill-mode: both;
}

@keyframes errAnimation {
    from{
        opacity: 0;
        color: rgb(136, 0, 0);
    }
    to{
        opacity: 1;
    }
}

#error-display{
    padding-right: 15%;
    font-family: 'science gothic', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 25px;
    font-weight: bold;
    background-color: none;
    color: rgb(255, 0, 0);
    height: 79%;
    display: block;
    width: 120%;
    grid-column: 2/4;
    grid-row: 1/2;
    animation: errAnimation 0.3s ease, all 0.5s ease;
}

#error-display2{
    padding-right: 15%;
    padding-bottom: -10%;
    font-family: 'science gothic', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 22px;
    font-weight: bold;
    background-color: none;
    color: rgb(255, 204, 0);
    height: 50%;
    display: block;
    width: 200%;
    grid-column: 2/4;
    grid-row: 1/2;
    animation: errAnimation 0.3s ease, all 0.5s ease;
}

.button0{
    grid-column: 2/3;
    grid-row: 6/7;
    animation: fade-in 1.5s ease-in-out 2.6s;
    animation-fill-mode: both;
}

.button1{
    grid-column: 1/2;
    grid-row: 5/6;
    animation: fade-in 1.5s ease-in-out 2.7s;
    animation-fill-mode: both;
}

.button2{
    grid-column: 2/3;
    grid-row: 5/6;
    animation: fade-in 1.5s ease-in-out 2.8s;
    animation-fill-mode: both;
}

.button3{
    grid-column: 3/4;
    grid-row: 5/6;
    animation: fade-in 1.5s ease-in-out 2.9s;
    animation-fill-mode: both;
}

.button4{
    grid-column: 1/2;
    grid-row: 4/5;
    animation: fade-in 1.5s ease-in-out 3s;
    animation-fill-mode: both;
}

.button5{
    grid-column: 2/3;
    grid-row: 4/5;
    animation: fade-in 1.5s ease-in-out 3.1s;
    animation-fill-mode: both;
}

.button6{
    grid-column: 3/4;
    grid-row: 4/5;
    animation: fade-in 1.5s ease-in-out 3.2s;
    animation-fill-mode: both;
}

.button7{
    grid-column: 1/2;
    grid-row: 3/4;
    animation: fade-in 1.5s ease-in-out 3.3s;
    animation-fill-mode: both;
}

.button8{
    grid-column: 2/3;
    grid-row: 3/4;
    animation: fade-in 1.5s ease-in-out 3.4s;
    animation-fill-mode: both;
}

.button9{
    grid-column: 3/4;
    grid-row: 3/4;
    animation: fade-in 1.5s ease-in-out 3.5s;
    animation-fill-mode: both;
}

@media (min-width: 1440px) {

    .container{
        min-width: 375px;
    }

    .btn-container{
        gap: 16px;
    }

    h1{
        font-size: 70px;
    }
    
    @keyframes expandCal {
    from{
        transition: all 1s ease;
        height: 20px;
        min-height: 20px;
        z-index: -1;
    }
    to{
        height: 600px;
        min-height: 720px;
        z-index: 1;
    }
}

button{
    height: 75px;
    width: 75px;
    font-size: 27px;
}
}