:root {
    --bpm: 30;
    --beat-ms: calc(60000ms / var(--bpm));
    --jiggle-angle: 2deg;
}

@keyframes jiggle {
    0% {
        transform: rotate(var(--jiggle-angle));
    }
    50% {
        transform: rotate(calc(var(--jiggle-angle) * -1));
    }
    100% {
        transform: rotate(var(--jiggle-angle));
    }
}

.jiggle {
    animation: jiggle var(--beat-ms) ease-in-out infinite;
    display: inline-block;
    transform-origin: center bottom;
}

.jiggle:nth-child(2n) {
    animation-delay: calc(var(--beat-ms) * -0.18);
}
.jiggle:nth-child(3n) {
    animation-delay: calc(var(--beat-ms) * -0.33);
}
.jiggle:nth-child(4n) {
    animation-delay: calc(var(--beat-ms) * -0.51);
}
.jiggle:nth-child(5n) {
    animation-delay: calc(var(--beat-ms) * -0.65);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Nunito", sans-serif;
    overflow-x: hidden;
    background: #1a0a00;
}

.hidden-content {
    display: none;
}

/* ─── SECTION BASE ─── */
section {
    width: 100%;
    min-height: 100svh;
    height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* ─── CARTOON CORNER BRACKETS ─── */
.corner {
    position: absolute;
    z-index: 10;
    pointer-events: none;
    width: 52px;
    height: 52px;
}

.corner-tl {
    top: 16px;
    left: 16px;
    border-top: 4px solid rgba(255, 210, 55, 0.7);
    border-left: 4px solid rgba(255, 210, 55, 0.7);
    border-radius: 14px 0 0 0;
}

.corner-tr {
    top: 16px;
    right: 16px;
    border-top: 4px solid rgba(255, 210, 55, 0.7);
    border-right: 4px solid rgba(255, 210, 55, 0.7);
    border-radius: 0 14px 0 0;
}

.corner-bl {
    bottom: 16px;
    left: 16px;
    border-bottom: 4px solid rgba(255, 210, 55, 0.7);
    border-left: 4px solid rgba(255, 210, 55, 0.7);
    border-radius: 0 0 0 14px;
}

.corner-br {
    bottom: 16px;
    right: 16px;
    border-bottom: 4px solid rgba(255, 210, 55, 0.7);
    border-right: 4px solid rgba(255, 210, 55, 0.7);
    border-radius: 0 0 14px 0;
}

/* ─── STARS ─── */
.stars-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.star {
    position: absolute;
    border-radius: 50%;
    background: #fff;
    animation: twinkle var(--d, 2s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

@keyframes twinkle {
    0%,
    100% {
        opacity: 0.1;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(2.2);
    }
}

/* ─── FLOATING DECO STARS ─── */
.deco-star {
    position: absolute;
    pointer-events: none;
    z-index: 1;
    font-size: var(--sz, 22px);
    opacity: 0.6;
    animation: floatStar var(--fd, 4s) ease-in-out infinite;
    animation-delay: var(--fdelay, 0s);
}

@keyframes floatStar {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-14px) rotate(20deg);
    }
}

/* ─── SCROLL NUDGE ─── */
.scroll-nudge {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    animation: boing 1.8s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite;
}

.scroll-nudge span {
    font-family: "Fredoka One", cursive;
    font-size: 10px;
    letter-spacing: 3px;
    color: rgba(255, 225, 80, 0.75);
    text-transform: uppercase;
}

.scroll-nudge .arrow-dn {
    width: 18px;
    height: 18px;
    border-right: 3px solid rgba(255, 225, 80, 0.75);
    border-bottom: 3px solid rgba(255, 225, 80, 0.75);
    transform: rotate(45deg);
    border-radius: 0 0 3px 0;
}

@keyframes boing {
    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(9px);
    }

    60% {
        transform: translateX(-50%) translateY(3px);
    }
}
