@keyframes FadeIn {
    from {
        filter: blur(20px);
        opacity: 0;
    }
    to {
        filter: blur(0);
        opacity: 1;
    }
}

.incoming-call {
    align-content: center;
    background-color: #0008;
    display: grid;
    font-family: monospace;
    left: 0;
    height: 100%;
    place-items: center;
    position: absolute;
    opacity: 0;
    top: 0;
    width: 100%;
    z-index: -10000;
}

.incoming-call.is-open {
    animation-duration: 500ms;
    animation-fill-mode: forwards;
    animation-name: FadeIn;
    z-index: 10000;
}

@keyframes Pulsate {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(170, 0, 0, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 20px rgba(170, 0, 0, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(170, 0, 0, 0);
    }
}

.incoming-call__box {
    animation-delay: 500ms;
    animation-duration: 2000ms;
    animation-name: Pulsate;
    animation-iteration-count: infinite;
    background-color: rgb(170, 0, 0);
    font-size: 1.5rem;
    letter-spacing: 0.4rem;
    padding: 2px 4px;
}

@keyframes OpenCodec {
    from {
        border: 4px solid #4aa39a;
    }
    to {
        border: 0px solid #0000;
        left: 0;
        padding: 1rem;
        opacity: 1;
        width: 100%;
    }
}

.codec {
    background: #000;
    color: #4aa39a;
    display: grid;
    height: 100%;
    left: 50%;
    padding: 0;
    place-items: center;
    position: fixed;
    opacity: 0;
    overflow: hidden;
    top: 0;
    width: 0;
    z-index: 100;
}

.codec.is-open {
    animation-duration: 500ms;
    animation-fill-mode: forwards;
    animation-name: OpenCodec;
}

.codec__grid {
    column-gap: 3rem;
    display: grid;
    grid-template: 1fr 1fr / 3fr 5fr 3fr;
    justify-items: center;
    row-gap: 3rem;
}

.codec__frequency {
    border: 1px solid #4aa39a;
    column-gap: 3px;
    display: grid;
    grid-template: repeat(13, 1fr) / repeat(23, 1fr);
    position: relative;
    row-gap: 4px;
    width: 100%;
}

.codec__frequency-bar {
    animation-direction: alternate;
    animation-duration: 2s;
    animation-iteration-count: infinite;
    background-color: #4aa39a;
    grid-column: 3/span 1;
}

.codec__frequency-bar:nth-child(1) {
    grid-area: 2/2/3/3;
    justify-self: end;
    width: 7px;
}

.codec__frequency-bar:nth-child(2) {
    animation-duration: 4s;
    animation-name: GrowBar;
    grid-row: 2/3;
}

.codec__frequency-bar:nth-child(3) {
    grid-area: 3/2/4/3;
    justify-self: end;
    width: 7px;
}

.codec__frequency-bar:nth-child(4) {
    animation-delay: 100ms;
    animation-duration: 1.5s;
    animation-name: GrowBar;
    grid-row: 3/4;
}

.codec__frequency-bar:nth-child(5) {
    grid-area: 4/2/5/3;
    justify-self: end;
    width: 7px;
}

.codec__frequency-bar:nth-child(6) {
    animation-delay: 200ms;
    animation-duration: 2s;
    animation-name: GrowBar;
    grid-row: 4/5;
}

.codec__frequency-bar:nth-child(7) {
    grid-area: 5/2/6/3;
    justify-self: end;
    width: 7px;
}

.codec__frequency-bar:nth-child(8) {
    animation-delay: 400ms;
    animation-duration: 4s;
    animation-name: GrowBar;
    grid-row: 5/6;
}

.codec__frequency-bar:nth-child(9) {
    grid-area: 6/2/7/3;
    justify-self: end;
    width: 7px;
}

.codec__frequency-bar:nth-child(10) {
    animation-delay: 150ms;
    animation-duration: 1.5s;
    animation-name: GrowBar;
    grid-row: 6/7;
}

.codec__frequency-bar:nth-child(11) {
    grid-area: 7/2/8/3;
    justify-self: end;
    width: 7px;
}

.codec__frequency-bar:nth-child(12) {
    animation-delay: 250ms;
    animation-duration: 2s;
    animation-name: GrowBar;
    grid-row: 7/8;
}

.codec__frequency-bar:nth-child(13) {
    grid-area: 8/2/9/3;
    justify-self: end;
    width: 7px;
}

.codec__frequency-bar:nth-child(14) {
    animation-delay: 450ms;
    animation-duration: 4s;
    animation-name: GrowBar;
    grid-row: 8/9;
}

.codec__frequency-bar:nth-child(15) {
    grid-area: 9/2/10/3;
    justify-self: end;
    width: 7px;
}

.codec__frequency-bar:nth-child(16) {
    animation-delay: 350ms;
    animation-duration: 1.5s;
    animation-name: GrowBar;
    grid-row: 9/10;
}

.codec__frequency-bar:nth-child(17) {
    grid-area: 10/2/11/3;
    justify-self: end;
    width: 7px;
}

.codec__frequency-bar:nth-child(18) {
    animation-delay: 550ms;
    animation-duration: 2s;
    animation-name: GrowBar;
    grid-row: 10/11;
}

.codec__frequency-num {
    font-size: clamp(1.5rem, 3vw, 3vw);
    letter-spacing: 0.25rem;
    position: absolute;
    right: 1vw;
    top: 50%;
    transform: translateY(-50%);
}

.codec__frequency-toolbar {
    border-top: 1px solid #4aa39a;
    grid-area: 12/1/14/24;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.codec__message {
    border: 1px solid #4aa39a;
    display: grid;
    font-family: sans-serif;
    font-size: 2rem;
    font-weight: bold;
    grid-column: 1/4;
    letter-spacing: 0.25rem;
    padding: 1rem;
    place-items: center;
    width: 100%;
}

.codec__actions {
    align-self: end;
    font-size: 1rem;
}

@keyframes GrowBar {
    0%   { grid-column: 3/span 1; }
    12%  { grid-column: 3/span 2; }
    25%  { grid-column: 3/span 3; }
    37%  { grid-column: 3/span 4; }
    50%  { grid-column: 3/span 5; }
    62%  { grid-column: 3/span 6; }
    75%  { grid-column: 3/span 7; }
    87%  { grid-column: 3/span 8; }
    100% { grid-column: 3/span 9; }
}

@media (max-width: 768px) {
    .codec__grid {
        column-gap: 1rem;
        grid-template: 1fr 1fr / 1fr 5fr 1fr;
    }
    .codec__sender > img,
    .codec__receiver > img {
        height: 64px;
    }
}

@media (min-width: 769px) {
    .codec__grid {
        min-width: 82%;
        max-width: 1024px;
    }
    .codec__sender > img,
    .codec__receiver > img {
        transform: scale(1.35) translateY(-10px);
    }
}