/*
 * Animated Gradient Button
 * Inspired by https://codepen.io/ARS
 * Adapted for Hewn Shop
 */

@import url(https://fonts.googleapis.com/css?family=Squada+One);

.gradient-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}

.gradient-button {
    display: block;
    width: 340px;
    height: 70px;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    letter-spacing: 2px;
    line-height: 70px;
    font-family: 'Squada One', cursive;
    font-size: 20px;
    z-index: 1;
    position: relative;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    overflow: hidden;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.gradient-button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.gradient-button:last-child {
    margin-bottom: 0;
}

.gradient-button:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    background: linear-gradient(120deg, #fbfaf8, #f4f1e8, #fbfaf8);
    background-size: 400% 400%;
    clip-path: polygon(0% 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 0% 100%);
    animation: gradient-animation 3s ease-in-out infinite, border-animation 4s ease-in-out 0.5s 1 reverse forwards;
}

.gradient-button > span {
    display: block;
    background: linear-gradient(120deg, #fbfaf8, #f4f1e8, #fbfaf8);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-animation 3s ease-in-out infinite;
}

/* Animations */
@keyframes gradient-animation {
    0%   { background-position: 14% 0%; }
    50%  { background-position: 87% 100%; }
    100% { background-position: 14% 0%; }
}

@keyframes border-animation {
    0% {
        clip-path: polygon(0% 100%, 4px 100%, 4px 4px, calc(100% - 4px) 4px, calc(100% - 4px) calc(100% - 4px), 4px calc(100% - 4px), 4px 100%, 100% 100%, 100% 0%, 0% 0%);
    }
    25% {
        clip-path: polygon(0% 100%, 4px 100%, 4px 4px, calc(100% - 4px) 4px, calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 100% 100%, 100% 0%, 0% 0%);
    }
    50% {
        clip-path: polygon(0% 100%, 4px 100%, 4px 4px, calc(100% - 4px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 4px, 100% 0%, 0% 0%);
    }
    75% {
        clip-path: polygon(0% 100%, 4px 100%, 4px 4px, 4px 4px, 4px 4px, 4px 4px, 4px 4px, 4px 4px, 4px 0%, 0% 0%);
    }
    100% {
        clip-path: polygon(0% 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 0% 100%);
    }
}

@keyframes border-animation-repeat {
    0% {
        clip-path: polygon(0% 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 4px 100%, 0% 100%);
    }
    10% {
        clip-path: polygon(0% 100%, 4px 100%, 4px 4px, 4px 4px, 4px 4px, 4px 4px, 4px 4px, 4px 4px, 4px 0%, 0% 0%);
    }
    20% {
        clip-path: polygon(0% 100%, 4px 100%, 4px 4px, calc(100% - 4px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 4px, 100% 0%, 0% 0%);
    }
    30% {
        clip-path: polygon(0% 100%, 4px 100%, 4px 4px, calc(100% - 4px) 4px, calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 100% 100%, 100% 0%, 0% 0%);
    }
    40%, 100% {
        clip-path: polygon(0% 100%, 4px 100%, 4px 4px, calc(100% - 4px) 4px, calc(100% - 4px) calc(100% - 4px), 4px calc(100% - 4px), 4px 100%, 100% 100%, 100% 0%, 0% 0%);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .gradient-button {
        width: 300px;
        height: 65px;
        line-height: 65px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .gradient-button {
        width: 280px;
        height: 60px;
        line-height: 60px;
        font-size: 16px;
        letter-spacing: 1px;
    }
}
