@font-face {
    font-family: 'Anta';
    src: url('/fonts/Anta-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@property --angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

.works {
    height: auto;
    margin: 0;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    padding: 10px;
}

.works-tittle {
    padding: 20px;
    display: flex;
    justify-content: center;

}


.works-tittle h2 {
    font-size: 45px;
    font-weight: 900;
    font-family: 'Anta';
    background-color: #95cde6;
    border-radius: 10px;
    width: 60%;
    padding: 20px;

    --border-size: 0.2rem;
    border: var(--border-size) solid transparent;

    /* Paint an image in the border */
    border-image: conic-gradient(from var(--angle),
            #ffffff 0deg 90deg,
            #95cde6 90deg 180deg,
            #ffffff 180deg 270deg,
            #95cde6 270deg 360deg) 1 stretch;
    background: rgb(255 255 255 / var(--opacity));
}

@property --opacity {
    syntax: "<number>";
    initial-value: 0.5;
    inherits: false;
}

@property --angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@keyframes opacityChange {
    to {
        --opacity: 0.9;
    }
}

@keyframes rotate {
    to {
        --angle: 360deg;
    }
}

.rainbow {
    animation: rotate 15s linear infinite, opacityChange 3s infinite alternate;
}


.works-subcontainer {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(5, 1fr);
    row-gap: 30px;
    column-gap: 20px;
}

.works-subcontainer img {
    grid-column: 1/3;
    grid-row: 1/6;
}

.works-subcontainer p {
    background-color: #d9d9d9;
    padding: 10px;
    border-radius: 10px;
    color: #000;
    font-weight: 500;
    font-size: 25px;
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.6s ease,
        transform 0.6s ease;
}

.works-subcontainer p.show {
    opacity: 1;
    transform: translateY(0);
}

.works-subcontainer p:first-child {
    grid-column: 2/4;
    grid-row: 1/2;
    justify-self: start;
    z-index: 2;
}

.works-subcontainer p:nth-child(2) {
    grid-column: 2/4;
    grid-row: 2/3;
    justify-self: center;
}

.works-subcontainer p:nth-child(3) {
    grid-column: 3/4;
    grid-row: 3/4;
    justify-self: start;
}

.works-subcontainer p:nth-child(4) {
    grid-column: 2/4;
    grid-row: 4/5;
    justify-self: center;
}

.works-subcontainer p:nth-child(5) {
    grid-column: 2/3;
    grid-row: 5/6;
    justify-self: center;
}

/* RESPONSIVE FOR TABLETS */
@media (min-width: 641px) and (max-width: 1023px) {
    .works-subcontainer {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(3, 1fr);
        row-gap: 30px;
    }

    .works-tittle h2{
        width: auto;
    }

    .works-subcontainer img {
        grid-row: 1/2;
        grid-column: 1/2;
        width: 400px;
        height: 300px;
        justify-self: center;
    }

    .works-subcontainer p {
        text-align: center;
        height: auto;
        color: #000;
        width: 100%;
        border-radius: 0;
        background-color: #ffffff;
    }

    .works-subcontainer p:first-child {
        grid-column: 1/2;
        grid-row: 2/3;
        justify-self: center;
        align-self: self-start;
    }

    .works-subcontainer p:nth-child(2) {
        grid-row: 2/3;
        grid-column: 1/2;
        align-self: center;
    }

    .works-subcontainer p:nth-child(3) {
        grid-row: 2/3;
        grid-column: 1/2;
        justify-self: center;
        align-self: self-end;
    }

    .works-subcontainer p:nth-child(4) {
        grid-row: 3/4;
        grid-column: 1/2;
        align-self: self-start;
    }

    .works-subcontainer p:nth-child(5) {
        grid-row: 3/4;
        grid-column: 1/2;
        justify-self: center;
        align-self: center;
    }
}

/* RESPONSIVE FOR SMARTHPHONES*/
@media (320px <= width <= 640px) {
    .works-tittle h2 {
        font-size: 20px;
    }

    .works-subcontainer {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(3, 1fr);
        row-gap: 30px;
    }

    .works-subcontainer img {
        grid-row: 1/2;
        grid-column: 1/2;
        width: 300px;
        height: 200px;
        justify-self: center;
    }

    .works-subcontainer p {
        text-align: center;
        font-size: 15px;
        height: auto;
        color: #000;
        width: 100%;
        border-radius: 0;
    }

    .works-subcontainer p:first-child {
        grid-column: 1/2;
        grid-row: 2/3;
        justify-self: center;
        align-self: self-start;
    }

    .works-subcontainer p:nth-child(2) {
        grid-row: 2/3;
        grid-column: 1/2;
        align-self: center;
    }

    .works-subcontainer p:nth-child(3) {
        grid-row: 2/3;
        grid-column: 1/2;
        justify-self: center;
        align-self: self-end;
    }

    .works-subcontainer p:nth-child(4) {
        grid-row: 3/4;
        grid-column: 1/2;
        align-self: self-start;
    }

    .works-subcontainer p:nth-child(5) {
        grid-row: 3/4;
        grid-column: 1/2;
        justify-self: center;
        align-self: center;
    }
}