/* ============================================
   JJUGGL.com - Blobitecture Circus Undersea
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --abyss: #0B0E2D;
    --deep-current: #0D2B45;
    --bioluminescent-teal: #00D4AA;
    --jellyfish-magenta: #FF2D78;
    --sunlight-surface: #FFB627;
    --foam-white: #E8F0F2;
    --pressure-blue: #1B4965;
    --elastic: cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--abyss);
    color: var(--foam-white);
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6;
}

/* --- Blob Navigation --- */
.blob-nav {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 1000;
}

.blob-nav-trigger {
    cursor: pointer;
    animation: blobPulse 2s var(--elastic) infinite;
    transition: transform 0.4s var(--elastic);
}

.blob-nav-trigger:hover {
    transform: scale(1.15);
}

.nav-blob-path {
    animation: morphBlob1 6s var(--elastic) infinite;
}

@keyframes blobPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.radial-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 240px;
    height: 240px;
    transition: opacity 0.4s var(--elastic), transform 0.4s var(--elastic);
}

.radial-menu.hidden {
    opacity: 0;
    transform: scale(0.3);
    pointer-events: none;
}

.radial-menu:not(.hidden) {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.radial-item {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    transition: transform 0.3s var(--elastic);
}

.radial-item:hover {
    transform: scale(1.2);
}

.radial-item span {
    font-family: 'Righteous', cursive;
    font-size: 11px;
    color: var(--foam-white);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.radial-item:nth-child(1) { top: 70px; left: 75px; }
.radial-item:nth-child(2) { top: 20px; left: 130px; }
.radial-item:nth-child(3) { top: 70px; left: 185px; }
.radial-item:nth-child(4) { top: 140px; left: 160px; }
.radial-item:nth-child(5) { top: 140px; left: 90px; }

/* --- Progress Bar --- */
.progress-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.progress-track {
    width: 200px;
    height: 3px;
    background: rgba(27, 73, 101, 0.5);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 20%;
    background: var(--bioluminescent-teal);
    border-radius: 2px;
    transition: width 0.5s var(--elastic);
}

.progress-dots {
    display: flex;
    gap: 12px;
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--pressure-blue);
    background: transparent;
    cursor: pointer;
    transition: all 0.4s var(--elastic);
}

.progress-dot.active {
    background: var(--bioluminescent-teal);
    border-color: var(--bioluminescent-teal);
    transform: scale(1.4);
}

/* --- Parallax Layers --- */
.parallax-layer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    pointer-events: none;
    will-change: transform;
}

.deep-layer {
    width: 500vw;
    z-index: 1;
    display: flex;
}

.deep-gradient {
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
}

.deep-gradient-1 {
    background: radial-gradient(ellipse at 30% 50%, #0D2B45 0%, #0B0E2D 70%);
}

.deep-gradient-2 {
    background: radial-gradient(ellipse at 60% 40%, #0D2B45 0%, #0B0E2D 65%);
}

.deep-gradient-3 {
    background: radial-gradient(ellipse at 40% 60%, #0D2B45 0%, #0B0E2D 60%);
}

.deep-gradient-4 {
    background: radial-gradient(ellipse at 50% 30%, #1B4965 0%, #0B0E2D 55%);
}

.deep-gradient-5 {
    background: radial-gradient(ellipse at 50% 50%, #1B4965 0%, #0D2B45 50%, #0B0E2D 80%);
}

.mid-layer {
    width: 500vw;
    z-index: 2;
}

/* --- Jellyfish Decorations --- */
.jelly {
    position: absolute;
    animation: jellyFloat 8s ease-in-out infinite;
}

.jelly-1 { top: 10%; left: 8%; animation-delay: 0s; animation-duration: 9s; }
.jelly-2 { top: 60%; left: 25%; animation-delay: -2s; animation-duration: 7s; }
.jelly-3 { top: 20%; left: 55%; animation-delay: -4s; animation-duration: 10s; }
.jelly-4 { top: 70%; left: 72%; animation-delay: -1s; animation-duration: 8s; }
.jelly-5 { top: 15%; left: 140%; animation-delay: -3s; animation-duration: 11s; }
.jelly-6 { top: 55%; left: 180%; animation-delay: -5s; animation-duration: 7.5s; }

.jelly-body {
    animation: morphBlob1 7s var(--elastic) infinite;
}

.jelly-tentacle {
    animation: tentacleSway 4s ease-in-out infinite;
}

@keyframes jellyFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(3deg); }
    50% { transform: translateY(5px) rotate(-2deg); }
    75% { transform: translateY(-10px) rotate(1deg); }
}

@keyframes tentacleSway {
    0%, 100% { transform: rotate(0deg); }
    33% { transform: rotate(5deg); }
    66% { transform: rotate(-5deg); }
}

/* --- Scroll Container --- */
.scroll-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    z-index: 10;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

.acts-rail {
    display: flex;
    width: 500vw;
    height: 100vh;
}

/* --- Acts (Sections) --- */
.act {
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.act-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* --- Halftone Backgrounds --- */
.halftone-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* --- ACT 1: The Splash --- */
.orbit-container {
    position: relative;
    width: 80vw;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20vw;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--foam-white);
    transform: scaleX(1.15);
    position: relative;
    z-index: 5;
    line-height: 0.9;
    text-shadow: 0 0 60px rgba(0, 212, 170, 0.3), 0 0 120px rgba(255, 45, 120, 0.15);
}

.hero-title .letter {
    display: inline-block;
    transform: scale(0);
    animation: letterBounceIn 0.6s var(--elastic) forwards;
}

.hero-title .letter:nth-child(1) { animation-delay: 0.1s; }
.hero-title .letter:nth-child(2) { animation-delay: 0.15s; }
.hero-title .letter:nth-child(3) { animation-delay: 0.2s; }
.hero-title .letter:nth-child(4) { animation-delay: 0.25s; }
.hero-title .letter:nth-child(5) { animation-delay: 0.3s; }
.hero-title .letter:nth-child(6) { animation-delay: 0.35s; }

@keyframes letterBounceIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Orbiting blobs */
.orbit-blob {
    position: absolute;
    z-index: 4;
}

.orbit-blob-1 {
    animation: orbit1 8s var(--elastic) infinite;
}

.orbit-blob-2 {
    animation: orbit2 10s var(--elastic) infinite;
}

.orbit-blob-3 {
    animation: orbit3 9s var(--elastic) infinite;
}

@keyframes orbit1 {
    0% { transform: translate(-35vw, -10vh) rotate(0deg); }
    25% { transform: translate(-10vw, -25vh) rotate(90deg); }
    50% { transform: translate(30vw, -5vh) rotate(180deg); }
    75% { transform: translate(10vw, 20vh) rotate(270deg); }
    100% { transform: translate(-35vw, -10vh) rotate(360deg); }
}

@keyframes orbit2 {
    0% { transform: translate(30vw, 15vh) rotate(0deg); }
    25% { transform: translate(15vw, -20vh) rotate(-90deg); }
    50% { transform: translate(-25vw, 10vh) rotate(-180deg); }
    75% { transform: translate(-5vw, 25vh) rotate(-270deg); }
    100% { transform: translate(30vw, 15vh) rotate(-360deg); }
}

@keyframes orbit3 {
    0% { transform: translate(5vw, 25vh) rotate(0deg); }
    25% { transform: translate(35vw, -5vh) rotate(120deg); }
    50% { transform: translate(-15vw, -20vh) rotate(240deg); }
    75% { transform: translate(-30vw, 15vh) rotate(300deg); }
    100% { transform: translate(5vw, 25vh) rotate(360deg); }
}

/* Motion lines */
.motion-lines {
    position: absolute;
    z-index: 3;
    opacity: 0;
    animation: motionFade 3s ease-in-out infinite;
}

.motion-lines-1 {
    bottom: 20%;
    left: 10%;
    animation-delay: 0s;
}

.motion-lines-2 {
    top: 15%;
    right: 15%;
    animation-delay: 1.5s;
}

@keyframes motionFade {
    0%, 100% { opacity: 0; transform: translateX(-20px); }
    50% { opacity: 0.7; transform: translateX(20px); }
}

/* --- ACT 2: The Juggle --- */
.act-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 10vw;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transform: scaleX(1.12);
    color: var(--foam-white);
    margin-bottom: 2vh;
    text-shadow: 0 0 40px rgba(0, 212, 170, 0.2);
    position: relative;
    z-index: 5;
}

.act-title-stagger {
    opacity: 0;
    transform: scaleX(1.12) translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s var(--elastic);
}

.act-title-stagger.visible {
    opacity: 1;
    transform: scaleX(1.12) translateY(0);
}

.juggle-stage {
    position: relative;
    width: 60vw;
    height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.juggle-arc {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.juggle-blob {
    position: absolute;
    z-index: 3;
}

.juggle-blob-1 {
    animation: juggle1 2.4s var(--elastic) infinite;
}

.juggle-blob-2 {
    animation: juggle2 2.4s var(--elastic) infinite;
    animation-delay: -0.8s;
}

.juggle-blob-3 {
    animation: juggle3 2.4s var(--elastic) infinite;
    animation-delay: -1.6s;
}

@keyframes juggle1 {
    0% { transform: translate(-12vw, 8vh); }
    25% { transform: translate(-5vw, -15vh) scale(1.1); }
    50% { transform: translate(5vw, 8vh); }
    75% { transform: translate(12vw, -10vh) scale(0.95); }
    100% { transform: translate(-12vw, 8vh); }
}

@keyframes juggle2 {
    0% { transform: translate(5vw, 8vh); }
    25% { transform: translate(12vw, -15vh) scale(1.1); }
    50% { transform: translate(-12vw, 8vh); }
    75% { transform: translate(-5vw, -10vh) scale(0.95); }
    100% { transform: translate(5vw, 8vh); }
}

@keyframes juggle3 {
    0% { transform: translate(-5vw, -10vh) scale(0.95); }
    25% { transform: translate(-12vw, 8vh); }
    50% { transform: translate(12vw, -15vh) scale(1.1); }
    75% { transform: translate(5vw, 8vh); }
    100% { transform: translate(-5vw, -10vh) scale(0.95); }
}

.speed-lines {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    opacity: 0.4;
    animation: speedPulse 2.4s ease-in-out infinite;
}

@keyframes speedPulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.5; }
}

.act-body {
    font-family: 'Nunito', sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--foam-white);
    max-width: 500px;
    text-align: center;
    margin-top: 3vh;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 0.3s, transform 0.6s var(--elastic) 0.3s;
    position: relative;
    z-index: 5;
}

.act-body.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- ACT 3: The Deep Dive --- */
.deep-content {
    display: flex;
    gap: 3vw;
    align-items: center;
    padding: 0 4vw;
    position: relative;
    z-index: 5;
}

.blob-frame {
    position: relative;
    width: 28vw;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: scale(0.8) translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s var(--elastic);
}

.blob-frame.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.blob-frame-1 { transition-delay: 0s; }
.blob-frame-2 { transition-delay: 0.2s; }
.blob-frame-3 { transition-delay: 0.4s; }

.blob-clip-svg {
    width: 100%;
    height: auto;
    position: absolute;
    top: 0;
    left: 0;
}

.blob-frame-text {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 50px 40px;
}

.blob-heading {
    font-family: 'Righteous', cursive;
    font-size: 24px;
    font-weight: 400;
    color: var(--bioluminescent-teal);
    margin-bottom: 12px;
}

.blob-body {
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--foam-white);
    opacity: 0.9;
}

.tentacle {
    position: absolute;
    z-index: 1;
    opacity: 0.6;
    animation: tentacleWave 5s ease-in-out infinite;
}

.tentacle-1 {
    bottom: -30px;
    left: -40px;
    transform: rotate(-10deg);
    animation-delay: 0s;
}

.tentacle-2 {
    bottom: -25px;
    right: -35px;
    transform: rotate(8deg);
    animation-delay: -1.5s;
}

.tentacle-3 {
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%) rotate(-5deg);
    animation-delay: -3s;
}

@keyframes tentacleWave {
    0%, 100% { transform: rotate(-10deg) scaleX(1); }
    50% { transform: rotate(5deg) scaleX(1.05); }
}

/* --- ACT 4: The Glow --- */
.act-4 {
    background: radial-gradient(ellipse at 30% 40%, rgba(0, 212, 170, 0.1) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 60%, rgba(255, 45, 120, 0.1) 0%, transparent 50%);
}

.glow-highlights {
    display: flex;
    gap: 4vw;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 5;
}

.badge-frame {
    position: relative;
    width: 260px;
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5) rotate(-15deg);
    transition: opacity 0.8s ease, transform 0.8s var(--elastic);
}

.badge-frame.visible {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.badge-frame-1 { transition-delay: 0s; }
.badge-frame-2 { transition-delay: 0.2s; }
.badge-frame-3 { transition-delay: 0.4s; }

.badge-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.badge-text {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 20px;
}

.badge-number {
    display: block;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 48px;
    color: var(--sunlight-surface);
    letter-spacing: 0.02em;
}

.badge-label {
    display: block;
    font-family: 'Righteous', cursive;
    font-size: 18px;
    color: var(--foam-white);
    margin-top: 4px;
    margin-bottom: 8px;
}

.badge-desc {
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--foam-white);
    opacity: 0.85;
    max-width: 180px;
}

/* Glow orbs */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 1;
}

.glow-orb-teal {
    width: 300px;
    height: 300px;
    background: var(--bioluminescent-teal);
    opacity: 0.12;
    top: 10%;
    left: 15%;
    animation: glowPulse 5s ease-in-out infinite;
}

.glow-orb-magenta {
    width: 250px;
    height: 250px;
    background: var(--jellyfish-magenta);
    opacity: 0.1;
    bottom: 15%;
    right: 20%;
    animation: glowPulse 6s ease-in-out infinite;
    animation-delay: -2s;
}

@keyframes glowPulse {
    0%, 100% { transform: scale(1); opacity: 0.1; }
    50% { transform: scale(1.3); opacity: 0.18; }
}

/* --- ACT 5: The Surface --- */
.act-5 {
    background: radial-gradient(ellipse at 50% 80%, #1B4965 0%, #0D2B45 40%, #0B0E2D 80%);
}

.surface-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.surface-blob-frame {
    position: relative;
    width: 50vw;
    max-width: 500px;
}

.surface-blob-frame .blob-clip-svg {
    width: 100%;
    height: auto;
    position: absolute;
    top: 0;
    left: 0;
}

.surface-text {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 60px 50px;
}

.surface-heading {
    font-family: 'Righteous', cursive;
    font-size: 36px;
    font-weight: 400;
    color: var(--sunlight-surface);
    margin-bottom: 16px;
}

.surface-body {
    font-family: 'Nunito', sans-serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.7;
    color: var(--foam-white);
    margin-bottom: 30px;
}

.surface-contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.contact-label {
    font-family: 'Righteous', cursive;
    font-size: 14px;
    color: var(--bioluminescent-teal);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.contact-link {
    font-family: 'Nunito', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--jellyfish-magenta);
    text-decoration: none;
    transition: color 0.3s var(--elastic), transform 0.3s var(--elastic);
    display: inline-block;
}

.contact-link:hover {
    color: var(--sunlight-surface);
    transform: scale(1.1);
}

/* Bubble trails */
.bubble-trail {
    position: absolute;
    z-index: 3;
    animation: bubbleRise 6s ease-in-out infinite;
}

.bubble-trail-1 {
    left: 15%;
    bottom: 5%;
    animation-delay: 0s;
}

.bubble-trail-2 {
    right: 20%;
    bottom: 10%;
    animation-delay: -2s;
    animation-duration: 7s;
}

.bubble-trail-3 {
    left: 60%;
    bottom: 0%;
    animation-delay: -4s;
    animation-duration: 8s;
}

@keyframes bubbleRise {
    0% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(-20px); opacity: 0.9; }
    100% { transform: translateY(0); opacity: 0.6; }
}

/* --- Blob Morphing Keyframes --- */
@keyframes morphBlob1 {
    0%, 100% {
        d: path("M50,10 Q80,15 90,50 Q80,85 50,90 Q20,85 10,50 Q20,15 50,10Z");
    }
    33% {
        d: path("M50,8 Q85,20 92,50 Q85,80 50,92 Q15,80 8,50 Q15,20 50,8Z");
    }
    66% {
        d: path("M50,12 Q75,10 88,50 Q75,90 50,88 Q25,90 12,50 Q25,10 50,12Z");
    }
}

@keyframes morphBlob2 {
    0%, 100% {
        d: path("M45,10 Q78,18 88,50 Q78,82 45,88 Q22,82 12,50 Q22,18 45,10Z");
    }
    33% {
        d: path("M55,8 Q82,15 90,50 Q82,85 55,92 Q18,85 10,50 Q18,15 55,8Z");
    }
    66% {
        d: path("M50,14 Q80,22 85,50 Q80,78 50,86 Q20,78 15,50 Q20,22 50,14Z");
    }
}

/* --- Elastic Wobble Grid --- */
.act::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--pressure-blue) 1px, transparent 1px),
        linear-gradient(90deg, var(--pressure-blue) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.06;
    pointer-events: none;
    z-index: 0;
}

/* --- Scroll-based Blob Curtains Between Acts --- */
.act::after {
    content: '';
    position: absolute;
    top: 0;
    right: -40px;
    width: 80px;
    height: 100%;
    background: radial-gradient(ellipse at center, var(--abyss) 0%, transparent 70%);
    z-index: 6;
    pointer-events: none;
}

.act:last-child::after {
    display: none;
}

/* --- Morph blob generics --- */
.morph-blob {
    animation: morphBlob1 6s var(--elastic) infinite;
}

.blob-frame-2 .morph-blob {
    animation: morphBlob2 7s var(--elastic) infinite;
    animation-delay: -1.5s;
}

.blob-frame-3 .morph-blob {
    animation: morphBlob1 8s var(--elastic) infinite;
    animation-delay: -3s;
}

/* Orbit blob morphing */
.orbit-blob-1 .morph-blob {
    animation: morphBlob1 5s var(--elastic) infinite;
}

.orbit-blob-2 .morph-blob {
    animation: morphBlob2 6s var(--elastic) infinite;
    animation-delay: -1s;
}

.orbit-blob-3 .morph-blob {
    animation: morphBlob1 7s var(--elastic) infinite;
    animation-delay: -2s;
}

/* Juggle blob morphing */
.juggle-blob .morph-blob {
    animation: morphBlob2 4s var(--elastic) infinite;
}

.juggle-blob-2 .morph-blob {
    animation-delay: -1.3s;
}

.juggle-blob-3 .morph-blob {
    animation-delay: -2.6s;
}

/* Surface blob morphing */
.surface-blob-frame .morph-blob {
    animation: morphBlob1 9s var(--elastic) infinite;
}
