html {
    scroll-behavior: smooth;
}

body {
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

::selection {
    background: #ffe8df;
    color: #172033;
}

.hero-grid {
    background-image:
        linear-gradient(rgba(15, 23, 42, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, .035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, black 25%, transparent 95%);
}

.float-a {
    animation: floatA 5s ease-in-out infinite;
}

.float-b {
    animation: floatB 6s ease-in-out infinite;
}

.float-c {
    animation: floatC 5.5s ease-in-out infinite;
}

@keyframes floatA {

    0%,
    100% {
        transform: translateY(0) rotate(-3deg);
    }

    50% {
        transform: translateY(-8px) rotate(-1deg);
    }
}

@keyframes floatB {

    0%,
    100% {
        transform: translateY(0) rotate(3deg);
    }

    50% {
        transform: translateY(-12px) rotate(5deg);
    }
}

@keyframes floatC {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-7px);
    }
}

.browser-shadow {
    box-shadow: 0 35px 80px rgba(15, 23, 42, .14);
}

/* ================= DANCING CRAB ================= */
#crab-track {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 36px;
    z-index: 20;
    pointer-events: none;
}

#crab {
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 52px;
    height: 36px;
    cursor: pointer;
    pointer-events: auto;
    will-change: transform;
}

#crab .crab-flip,
#crab .crab-hop {
    width: 100%;
    height: 100%;
    transform-origin: 50% 100%;
}

#crab svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

#crab .legs-a,
#crab .legs-b {
    transform-origin: 32px 33px;
}

#crab .claw-l {
    transform-origin: 17px 25px;
    transform: rotate(-8deg);
}

#crab .claw-r {
    transform-origin: 47px 25px;
    transform: rotate(8deg);
}

.crab-run .legs-a {
    animation: crab-legs-a .16s linear infinite;
}

.crab-run .legs-b {
    animation: crab-legs-b .16s linear infinite;
}

.crab-run .crab-hop {
    animation: crab-scuttle .16s ease-in-out infinite;
}

.crab-dance .crab-hop {
    animation: crab-hop .7s ease-in-out infinite;
}

.crab-dance .legs-a {
    animation: crab-legs-a .35s ease-in-out infinite;
}

.crab-dance .legs-b {
    animation: crab-legs-b .35s ease-in-out infinite;
}

.crab-dance .claw-l {
    animation: claw-wave-l .35s ease-in-out infinite;
}

.crab-dance .claw-r {
    animation: claw-wave-r .35s ease-in-out infinite;
}

.crab-note {
    position: absolute;
    bottom: 30px;
    font-size: 14px;
    font-weight: 800;
    color: #ff6542;
    opacity: 0;
    pointer-events: none;
}

.crab-note.n1 {
    left: -8px;
}

.crab-note.n2 {
    right: -8px;
}

.crab-dance .crab-note {
    animation: note-float 1.4s ease-out infinite;
}

.crab-dance .crab-note.n2 {
    animation-delay: .6s;
}

@keyframes crab-legs-a {

    0%,
    100% {
        transform: rotate(-7deg)
    }

    50% {
        transform: rotate(7deg)
    }
}

@keyframes crab-legs-b {

    0%,
    100% {
        transform: rotate(7deg)
    }

    50% {
        transform: rotate(-7deg)
    }
}

@keyframes crab-scuttle {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-1.5px)
    }
}

@keyframes crab-hop {

    0%,
    100% {
        transform: translateY(0) rotate(-6deg) scale(1.03, .94);
    }

    25%,
    75% {
        transform: translateY(-9px) rotate(0) scale(.97, 1.05);
    }

    50% {
        transform: translateY(0) rotate(6deg) scale(1.03, .94);
    }
}

@keyframes claw-wave-l {

    0%,
    100% {
        transform: rotate(-30deg)
    }

    50% {
        transform: rotate(25deg)
    }
}

@keyframes claw-wave-r {

    0%,
    100% {
        transform: rotate(30deg)
    }

    50% {
        transform: rotate(-25deg)
    }
}

@keyframes note-float {
    0% {
        opacity: 0;
        transform: translateY(6px) rotate(-10deg);
    }

    20% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateY(-18px) rotate(12deg);
    }
}

@media (prefers-reduced-motion: reduce) {

    #crab,
    #crab * {
        animation: none !important;
    }
}