/* Utilities */
.animate-in {
    animation: animate-in cubic-bezier(0.25, 1, 0.75, 1) both;
    animation-timeline: view();
    animation-range: entry 0% cover 50%;
}

.bottom {
    margin-top: auto !important;
}

/* Banner */
#banner {
    position: relative;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: none;
    min-height: 50svh;
    overflow: hidden;
    background: linear-gradient(135deg, var(--color-cyan), var(--color-yellow), var(--color-pink));
}

#banner::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 8rem;
    background: linear-gradient(to top, var(--color-yellow), transparent);
}

#banner .wave-divider {
    z-index: 3;
}

.banner-video {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-logo {
    position: absolute;
    top: calc(30% - 100px);
    left: calc(30% - 100px);
    z-index: 0;
    width: calc(40% + 200px);
    height: calc(40% + 200px);
    filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.6));
}

.banner-logo img {
    object-fit: contain;
}

/* Buttons */
.button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 8em;
    min-height: 2em;
    padding: 0.25em 2em;
    color: var(--color-yellow);
    background: var(--color-accent);
    border: 0;
    border-radius: 9999px;
    font-family: var(--font-heading-2);
    font-size: 2em;
    font-weight: 500;
    letter-spacing: 1px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.1, 1.25, 0.15, 1.2);
}

.button:hover,
.button-wrap:hover .button {
    animation: button-bounce 0.6s cubic-bezier(0.1, 1.25, 0.15, 1.2);
}

.button:active {
    transform: scale(1.1, 0.9);
}

.button::before,
.button::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: -1;
    width: 0;
    height: 0;
    border-radius: 50%;
    pointer-events: none;
}

.button-wrap:hover .button::before {
    animation: button-particles-a 0.7s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

.button-wrap:hover .button::after {
    animation: button-particles-b 0.7s cubic-bezier(0.2, 0.8, 0.3, 1) 0.05s forwards;
}

.fas,
.fas::before {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 1em !important;
    height: 1em !important;
}

/* Cards */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    overflow: hidden;
    padding: 4rem;
    color: var(--color-gray);
    background: var(--color-cyan);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(100, 0, 0, 0.1);
    border-radius: 2.5rem;
    box-shadow:
        0.25rem 0.25rem 2rem rgba(100, 0, 0, 0.1),
        0.5rem 0.5rem 4rem rgba(100, 0, 0, 0.05);
}

.card > * {
    z-index: 10;
}

.hatch-scroll::before {
    content: "";
    position: absolute;
    inset: -50%;
    z-index: 5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='60'%3E%3Cpath d='M-90 30 Q 0 10 90 30 T 270 30 T 450 30' fill='none' stroke='%239CF1E9' stroke-width='14'/%3E%3C/svg%3E");
    background-size: 360px 60px;
    transform: rotate(205deg);
    transform-origin: center;
    animation: hatch-scroll 8s linear infinite;
}

/* Carousel */
.carousel {
    display: block;
    overflow: hidden;
    isolation: isolate;
}

.carousel__track {
    display: flex;
    height: 100%;
    transition: transform 550ms cubic-bezier(0.22, 0.75, 0.25, 1);
    will-change: transform;
}

.carousel__slide {
    flex: 0 0 100%;
    min-width: 0;
}

.carousel__button {
    position: absolute;
    top: 50%;
    z-index: 20;
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    padding: 0;
    color: var(--color-yellow);
    background: var(--color-accent);
    border: 0;
    border-radius: 50%;
    box-shadow: 0 0.35rem 0.8rem rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transform: translateY(-50%);
    transition:
        transform 400ms cubic-bezier(0.1, 4, 0.15, 1.2),
        box-shadow 180ms ease;
}

.carousel__button:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.25);
    transform: translateY(-50%) scale(1.05);
}

.carousel__button:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel__button:focus-visible {
    outline: 3px solid var(--color-cyan);
    outline-offset: 3px;
}

.carousel__button--previous {
    left: 1.25rem;
}

.carousel__button--next {
    right: 1.25rem;
}

/* Dividers */
.wave-divider {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    overflow: hidden;
    pointer-events: none;
}

.wave-divider svg {
    display: block;
}

.icon-divider {
    position: relative;
    display: block;
    width: 100%;
    overflow-x: clip;
}

.icon-divider__track,
.icon-divider__set {
    display: flex;
    align-items: center;
}

.icon-divider__track {
    width: max-content;
    opacity: 0.66;
    animation: icon-divider-left 180s linear infinite;
    will-change: transform;
}

.icon-divider--right .icon-divider__track {
    animation-name: icon-divider-right;
}

.icon-divider__set {
    gap: 32px;
    padding-right: 32px;
}

.icon-divider__item {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
    font-size: 2rem;
    line-height: 1;
}

.icon-divider__item.is-hopping i {
    animation: icon-divider-hop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Navbar */
header {
    position: fixed;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 5rem;
    padding: 0 2rem;
    background: var(--color-yellow);
    box-shadow:
        0.25rem 0.25rem 2rem rgba(100, 0, 0, 0.2),
        0.5rem 0.5rem 4rem rgba(100, 0, 0, 0.1);
    font-size: 1.25rem;
    transition: transform 0.2s ease-in-out;
}

header.hidden {
    transform: translateY(-100%);
}

.navbar-main,
header nav {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 1rem;
}

header .logo,
header .logo img {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

header .logo {
    transition: transform 0.4s cubic-bezier(0.05, 4, 0.25, 1);
}

header .logo:hover {
    transform: rotate(-3deg);
}

header .link {
    padding: 0.5rem 1rem;
    color: var(--color-accent);
    border: 2px solid var(--color-accent);
    border-radius: 9999px;
    font-size: 1em;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition:
        color 0.3s ease,
        background-color 0.3s ease,
        transform 0.4s cubic-bezier(0.05, 4, 0.25, 1);
}

header .link:hover {
    color: var(--color-yellow);
    background: var(--color-accent);
    transform: rotate(-3deg);
}

header .icon-link {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0.25em;
    color: var(--color-accent);
    border-radius: 9999px;
    font-size: 1.25em;
    text-decoration: none;
    transition: transform 0.4s cubic-bezier(0.05, 6, 0.25, 1);
}

header .icon-link::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--color-accent);
    border-radius: inherit;
    scale: 0;
    transition: scale 0.3s cubic-bezier(0.25, 1, 0.25, 1);
}

header .icon-link:hover {
    color: var(--color-yellow);
    transform: rotate(-3deg);
}

header .icon-link:hover::before {
    scale: 1;
    transition-timing-function: cubic-bezier(0.05, 2, 0.25, 1);
}

/* Footer */
footer {
    position: relative;
    display: flex;
    justify-content: center;
    width: 100%;
    height: clamp(250px, 20em, 400px);
    padding: 2rem 4rem;
    gap: 2rem;
    color: var(--color-text-light);
    background: var(--color-gray);
}

footer::before,
footer::after {
    content: "";
    position: absolute;
    top: -24rem;
    left: 0;
    z-index: 1;
    width: 100%;
}

footer::before {
    height: 24rem;
    background: var(--color-gray);
}

footer::after {
    height: 4rem;
    background: var(--color-yellow);
    border-radius: 0 0 4rem 4rem;
}

footer > div {
    display: flex;
    flex: 1;
    flex-direction: column;
    height: 100%;
    gap: 0.5rem;
}

.footer-contact {
    justify-content: space-between;
}

.footer-contact > div {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: inherit;
    opacity: 0.8;
    font-size: 1.5rem;
    font-weight: 600;
    text-decoration: none;
    transition:
        gap 0.5s cubic-bezier(0.11, 1.29, 0.73, 1),
        opacity 0.5s ease,
        color 0.5s ease;
}

.footer-link:hover {
    gap: 1.5rem;
    color: var(--color-yellow);
    opacity: 1;
}

.footer-link i {
    transition:
        transform 0.5s cubic-bezier(0.11, 1.29, 0.73, 1),
        scale 0.5s cubic-bezier(0.11, 1.29, 0.73, 1);
}

.footer-link:hover i {
    scale: 1.5;
    transform: rotate(360deg);
}

.footer-info {
    margin-top: auto;
}

.footer-info p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
}

.footer-info a {
    position: relative;
    display: inline-block;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 700;
    text-decoration: none;
    transition:
        color 250ms ease,
        scale 500ms cubic-bezier(0.2, 2.4, 0.2, 1);
}

.footer-info a:hover {
    color: #fff;
    scale: 1.05;
}

.footer-info a::before,
.footer-info a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    border-radius: 9999px;
}

.footer-info a::before {
    width: 100%;
    background: rgba(255, 255, 255, 0.25);
}

.footer-info a::after {
    width: 0;
    background: var(--color-yellow);
    transition: width 250ms ease-out;
}

.footer-info a:hover::after {
    width: 100%;
}

.footer-social {
    justify-content: space-between;
}

.footer-to-top {
    flex: 0.5;
}

#to-top {
    display: flex;
    justify-content: flex-end;
    height: 100%;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    transform-origin: top right;
    transition: transform 400ms cubic-bezier(0.1, 1.25, 0.15, 1.2);
}

#to-top:hover {
    transform: scale(1.02) rotate(-2deg);
}

#to-top:focus-visible {
    outline: 3px solid var(--color-yellow);
    outline-offset: 3px;
}

#to-top img {
    width: auto;
    border-radius: 0;
    object-fit: contain;
}

/* Animation definitions */
@keyframes animate-in {
    from {
        opacity: 0;
        transform: translateY(4rem) scale(0.9);
    }
}

@keyframes button-bounce {
    30% {
        transform: scale(1.1, 0.9);
    }

    50% {
        transform: scale(0.975, 1.025);
    }

    75% {
        transform: scale(1.025, 0.975);
    }
}

@keyframes button-particles-a {
    from {
        box-shadow:
            0 0 0 0 var(--color-pink),
            0 0 0 0 var(--color-pink),
            0 0 0 0 var(--color-pink),
            0 0 0 0 var(--color-pink),
            0 0 0 0 var(--color-pink),
            0 0 0 0 var(--color-pink),
            0 0 0 0 var(--color-pink),
            0 0 0 0 var(--color-pink);
    }

    to {
        box-shadow:
            71px 3px 0 3.8px transparent,
            102px 33px 0 5px transparent,
            46px 58px 0 4.3px transparent,
            41px 70px 0 4.5px transparent,
            11px 79px 0 4.9px transparent,
            -32px 74px 0 4.8px transparent,
            -54px 45px 0 5.4px transparent,
            -82px 28px 0 3.5px transparent;
    }
}

@keyframes button-particles-b {
    from {
        box-shadow:
            0 0 0 0 var(--color-pink),
            0 0 0 0 var(--color-pink),
            0 0 0 0 var(--color-pink),
            0 0 0 0 var(--color-pink),
            0 0 0 0 var(--color-pink),
            0 0 0 0 var(--color-pink),
            0 0 0 0 var(--color-pink),
            0 0 0 0 var(--color-pink);
    }

    to {
        box-shadow:
            -86px -12px 0 3.3px transparent,
            -108px -30px 0 4.8px transparent,
            -68px -82px 0 4.6px transparent,
            -22px -86px 0 4.7px transparent,
            10px -100px 0 5.6px transparent,
            43px -96px 0 3.1px transparent,
            55px -64px 0 3.2px transparent,
            67px -34px 0 3.8px transparent;
    }
}

@keyframes hatch-scroll {
    to {
        background-position: 0 60px;
    }
}

@keyframes icon-divider-left {
    to {
        transform: translateX(-50%);
    }
}

@keyframes icon-divider-right {
    from {
        transform: translateX(-50%);
    }
}

@keyframes icon-divider-hop {
    15% {
        transform: translateY(5%) scale(1.15, 0.85) rotate(-4deg);
    }

    60% {
        transform: translateY(-45%) scale(0.9, 1.15) rotate(8deg);
    }

    85% {
        transform: translateY(10%) scale(1.05, 0.95) rotate(-2deg);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card {
        padding: 2rem;
    }

    .footer-to-top {
        display: none;
    }
}

@media (max-width: 640px) {
    header {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    header .logo,
    header .social-links {
        display: none;
    }

    .navbar-main,
    header .nav-links {
        width: 100%;
    }

    header .nav-links .link {
        flex: 1;
    }

    footer {
        flex-direction: column;
        height: auto;
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    header {
        height: auto;
        padding: 1rem;
    }

    .card {
        padding: 1rem;
    }

    .carousel__button {
        width: 3rem;
        height: 3rem;
    }

    .carousel__button--previous {
        left: 0.75rem;
    }

    .carousel__button--next {
        right: 0.75rem;
    }
}
