A Gilded Cage
I think the next week was the worst for me. I finally found my way back to the spot where I'd first appeared, but never caught sight of the Nightmare. Mind magic is hard for the targeted pony to dispel for obvious reasons, but I knew a few techniques. None of them worked. I tried mental clarity spells and meditation, but I couldn't rid myself of missing Luna.
I kept busy by exploring the limits of my magic. I couldn't really teleport anything; when I tried object-specific requests, the magic around me responded by providing me with wild, uncooked food, water, or even rocks and wood: things that might reasonably have been in contact with the earth, but not animals. It's just as well that experiment failed; I don't know what I would have done with a badger if one had appeared.
When I tried teleporting myself, nothing happened unless I picked a target area inside this world that I knew well. In that case, my perception was that I traveled along the route I knew at high velocity as a point of consciousness. There was no interstitial lapse at all. Still, it provided me with a quick escape technique, and I spent some time seeking out places that made good refuges.
I tried phasing through thin walls, but it seemed that was another ability lost to me. I was well and truly imprisoned. By the third day after I was healthy enough to be trotting around, my shame and embarrassment had waned to the point where I was willing to consider what I would do when I faced Luna again. The Nightmare had been able to dreamwalk while trapped here, so I was certain that Luna would be able to contact me, but I didn't dare leave my mind open when I slept.
And that was the thing that hurt the most; knowing Luna was so close but still unreachable. Unvisited, my dreams were the usual mundane jumble of subconscious processing that signified nothing of importance.
I discovered several large open spaces roomy enough to fly in. Exercising my wings felt bad in a good way. Soreness and fatigue kept my mind off of less immediate matters.
My explorations and exercises led me to some interesting discoveries about the nature of the magical mechanism I was bound up in. They were evidently much the same as the cosmological structures, but more dense and slow, less amenable to outside influence. I could call up springs of water easily, and I could even cause veins of various metals to slowly shift and flow to the surface of the rock in some areas. I entirely coated the inside of one small space with gold just to see if I could do it.
But my biggest discovery came when I lost my temper.
I had been searching for the Nightmare after locating the melted magic circle and found no trace of her nearby. Based on what I'd explored to that point, the magical mechanism was so huge, I'd never find her if she didn't want me to.
I vented my frustration by flying loops and circles around a large cavern, blasting away at a jagged outcrop at its center. Childish, I know, but it was better than leaning against a wall and blubbering. I'd had quite enough of that.
When I finally flopped to the ground panting and sweating, I noticed something happening to the ragged rock spire I'd been hammering with bolts of magic: It was growing.
I flapped to the cave's entrance and prepared for a speedy escape in case I'd triggered something dangerous, but the pillar simply grew smoother and taller, magical sigils lighting briefly on its surface as it changed. I couldn't be sure of many of the symbols, but there were several that were similar to the celestial ones I was familiar with, and I'm sure I saw node and flow among them.
Evidently, I'd re-energized a structure that had... well, withered away, for lack of a better description. With that possibility in mind, I began looking for other places where the World Mechanism wasn't functioning correctly, and was appalled at how many I found in the first hour of my search.
The great crystalline spheres, cycles, and epicycles of the heavens all meshed and moved with oiled perfection; there were no spare or non-functioning parts. But within the world, things were different. Meddling with a magical structure of such size without knowing exactly what one was doing was a road to disaster, but if I could work with the parts of it that were non-functional, perhaps I could rebuild them to serve my own purposes.
I hadn't studied the creation of artifacts with a huge amount of enthusiasm. When introduced to the subject at school, I had thought that dependence on such things as amulets, charms, and foci were signs of laziness. I'd decided that creating such objects was tacit approval of such. Remembering holding such a naive attitude while wearing my armor, which was one of the most beautiful and useful artifacts I'd ever encountered, was just another drop in the ocean of my chagrin.
My disdain didn't mean I hadn't done well in my classes; I had a thing about getting perfect grades, even in subjects I didn't care for, if you can believe that. My knowledge might be rusty, but it was sound and extensive. So I began approaching my problem from a different direction. I was surrounded by an enormous mechanism of nearly unlimited magical energy; if I could learn to control it, at least in some part, I might be able to use it to escape.
Sombra had created a portal trap, no doubt designed to banish an enemy into the heart of the world, sealing them away forever. He had the prodigious power of dark magic to power his trap, but I'm no slouch myself, and anything that malign stallion could figure out shouldn't be beyond my capability. I set to work.
= = =
One of the first things I found out was that work is a great treatment for grief. I didn't dwell on my situation while I was concentrating on escaping it. It was only in the down times before falling asleep or during a hasty meal that I had the leisure to be miserable. When I became mentally exhausted or discouraged, I would switch to pure physical exercise to keep the unwelcome thoughts away.
Once or twice, I foolishly tried to motivate myself with the goal of seeing my friends and family again, but that always brought up thoughts of Luna, and the crushing, pointless anticipation of how that meeting would go. I worked better when considering the whole thing as an abstract problem.
Within another week, I was able to manipulate dormant parts of the World Mechanism and had begun constructing a preliminary power ring at the spot where I had first appeared. That's about when I realized the Nightmare must have gained the same ability to manipulate the mechanism, and given what was left of the runes, she was not only the source of the monsters, but the tendrils that had ensnared me as well.
That nearly threw me into another fit of depression. All that knowledge and power she had commanded, and yet she had still been unable to break free. But then I mentally smacked myself. What was an immortal spirit of darkness compared to Twilight Sparkle with a puzzle in front of her? A shadow in a dunce hat, that's what! I snorted contemptuously and got back to work.
 But not before I had taken a chunk of gypsum and carefully written on the black basalt wall: N.B., Do not begin speaking or thinking of yourself in the third person. You're in enough trouble as it is without going full-Trixie.
= = =
It was hard to keep track of the time. There was no day or night, and the uneven lighting of the place never grew brighter or dimmer. I kept track of the number of times I slept and counted those as days. It was only a few "days" later that I sensed the presence of something lurking nearby.
The timing made me almost certain that it was the Nightmare. It was the first time I'd fully shed my armor, and I seemed at my most vulnerable, literally up to my neck in hot water, and drowsy with exhaustion.
Though the armor kept me clean, it didn't do much for muscle soreness. I'd had a miserable day, chasing fruitless avenues of testing and watching carefully crafted runes dissolve into garbled nonsense. I had taken out my frustration on the old pillar in the big cavern that was, by then, nearly filling the center of the space, and both my magic and my muscles were feeling very abused.
I'd come up with the idea of a hot bath and had discovered that creating a basin and filling it with hot mineralized water was a quick and easy task. It took me a while longer to come up with a formula for soap that I could put together from what minerals and plant material I could summon, but I got a fairly nice lavender-scented compound after only a few tries. Also fortunately for me, Luffa acutangula grew wild all over the subtropics and was easy to dry and cut to size. When I'd finished, I had a loofah that looked like I'd bought it in a shop.
I was lying with my chin and forehooves over the edge of the basin and running the loofah in long strokes down my back and hind legs when I felt a change in the slow, heavy magic around me. I readied a shield spell but didn't cast it. I didn't want to waste the energy or make a show of being afraid. I'd also gotten in the habit of placing little disguised magical traps around whatever area I was working in, so I was more protected than I looked.
"I know you're there, Nightmare. You might as well stop skulking and come out and say hello." I knew no such thing, of course. But if there was nothing there, it didn't cost me anything to call out, as I was well past self-embarrassment by then.
I permitted myself the smallest grin of satisfaction as a swirling black mist flowed into the chamber and condensed into the black alicorn's form. She stood there for a while, looking at me with a neutral expression, saying nothing. I kept up a show of being nonchalant, sweeping the loofah down my body with slow even strokes.
"I'm glad you came," I said truthfully. "I've been wanting to discuss some things with you." I gestured with my horn to a spot on the floor on the other side of the room. "I can fill a tub for you if you like. This is very relaxing."
"You seem to be much more sensible than before," the Nightmare said.
"So do you."
She lowered herself to the floor, laying with her head upright. She kept watching me, but didn't reply for a long while. I sat up and began washing my mane, carefully keeping the soapy hair away from my eyes.
"You've gotten leaner," she remarked after a while.
"Simple, uncooked foods and lots of exercise," I said, trying to guess what she was up to by commenting on my looks. She ought to know by now that I wasn't the sort of pony given to vanity. "Being in better shape helps keep my mind sharp."
She said nothing. I rinsed my mane and let the bath water drain away into the ground.
"I'd like you to tell me how to remove the compulsion you put on me," I said, as casually I as could. "It doesn't serve a purpose any longer, and I find it inconvenient."
Her eyes narrowed a bit. "You have simply decided you don't want to love Luna any longer, is that it?"
I touched the earth magic and brought up heat from the magma currents into a crevice in the wall. With a simple change in pressure, I had a hot, dry breeze flowing over my body. "I want my mind to be unclouded. Looking back on my behavior, the spell, or whatever it was, seems to have had a negative effect on my judgment and temper, as well. I can offer a truce in exchange."
"What is that to me? I am not afraid of you," she sneered. Arrogant dismissal of my ability. Good. I could use that.
"Did you come here to fight me, then?" I modified the shield spell I had readied and completed all but the last symbol of the matrix, putting it on a hair trigger.
She sniffed disdainfully and looked down at her hoof, turning it side to side as if examining the quality of its trim. "I've come to offer you a way out of here."
My heart tried to leap up into my throat before I could remind myself of her essential, deceitful nature. "You don't have a way to escape, or you would have used it already."
"There is a way, but I need your help. I have examined what you're doing and can tell you what mistakes you've made. I can give you all the knowledge of the earth currents that you'll need." She smiled at me and there seemed to be very little malice in it. "So, you see, you need my help, too."
"We help each other to escape, is that what you're suggesting?" I began floating over pieces of my battered armor and settling them in place. "Releasing you into the world might be too high a price to pay for my own freedom."
"Oh, I'll escape with or without you. You can cooperate with me, and we can escape this place together, or I can take the slow route and free myself long after you've crumbled to dust. One way, you will have a chance to thwart my plans and see your lover again. The other way, you die alone here in the heart of the world, forgotten, unloved, and unburied. Which do you prefer?"
"There's just one problem with that choice," I said settling my chamfron on my head and fastening its chinstrap. "You're lying. Everything you say is a lie."
She nodded, her smile widening. "Yes, everything I say is a lie."
"Oh, don't even try to pull that sophomoric, paradoxical load of roadapples on me! You can provide me with evidence for each and every claim you make, or you can expect me to assume it's only more twisted maneuvering on your part."
"Oh, Twilight, I am so hurt that you don't trust me!" She placed a hoof over her forehead and rolled her eyes in mock despair. "Perhaps you'd take Luna's word on the matter, instead?" And she had the utter gall to transform into a perfect copy of my Luna.
And, even though I knew it wasn't her, I had a second or two of futile, unthinking hope. "Stop it!" I snarled, turning away from the disguised Nightmare.
"It seems your desire for the magnificent Queen of the Night may be of use to me yet," the Nightmare said. "You can see her again soon, if you cooperate with me."
"It's an addiction, not real love! You think you can dangle her in front of me like a keg of cider in front of a drunk and I'll crawl for you? Think again, Nightmare!"
"But she misses you so much, Twilight! She's up there right now threatening the greatest magical minds of the kingdom with all sorts of dire things if they don't find a way to recover you! Her sister, the overgrown pale one, has tried to explain to her that your immediate rescue isn't possible, but Luna won't listen. They've had quite a falling-out over it."
"I'm tired of your lies. It wouldn't matter to me if they were true, anyway."
"Oh? I won't tell Luna that when I walk the land of dreams tonight. She would be so very hurt." The Nightmare shook her head in feigned sadness. Then she began to circle me, moving Luna's body in very much the same sultry way as Jigsaw had done in my bedchamber so long ago. "Luna loves you, Twilight. She desires you! It was her growing infatuation that gave me the idea to use you to lure her to me in the first place. Shall I show you what she dreams of doing, but is afraid to ask of you? Oh, she is such a wicked mare!"
I knew exactly what she was trying to do to me, and exactly how phony and manipulative she was being, and I knew that I wasn't in my right mind, and the act was still twisting me up inside.
"She's a shapeshifter, Twilight. She would willingly be anything to please you. Do you desire a stallion instead? She could be the most magnificent stallion imaginable, or any stallion you took a fancy to. Or maybe something more... unattainable... more celestial?"
"You are vile!" I shouted at her.
She laughed and changed back into her usual black shape. "I'm just saying aloud the things I slipped into your dreaming mind, Twilight. You didn't seem to object then."
"I won't be controlled by your influence from now on. I'm stronger than that! Now that I know, I can fight it. I won't play the fool any longer."
"You think I made you act the way you did? No, I only led you into love and broadened your taste in partners." She sneered at me. "You've been swept away by the current of your own passion, Twilight Sparkle. It doesn't matter that you were pushed instead of jumping in of your own free will, your reactions are your own. Sink or swim little pony; it's up to you now."
I don't know if she knew what effect her words had on me, but I'm certain it wasn't what she had intended with her psychological battery. It only made me more determined to escape, regain my own mind, and set things right. I took three deep breaths and then said, "You're right. Thank you for pointing that out."
She looked at me warily, obviously expecting a delayed, emotional reaction. "So, you'll work with me to escape this place?"
"No," I said. "At least not right away. I'd be an idiot to trust you, so I'm going to do as much verification as possible and a few more experiments with the World Mechanism. Then I'll make up my mind."
"You presume on my patience. Perhaps I will withdraw my offer." She frowned and her eyes narrowed.
"I don't think so. I do believe you'll be trapped here for a very long time without my help, or you'd never have approached me. So what is a few more days to you?"
"Days? Do you not know that time here turns more slowly, just as do the earthen wheels of power? It has been a full nine months since you were sealed herein. Every day you delay is near another fortnight above us. Both Luna and her sister are growing quite frantic. I fear they will soon do something rash."
It had the ring of truth, and I could immediately see the mechanisms that could cause such a time dilation, but I had to treat it as just another pressure tactic. "It doesn't matter. Leave me alone to think it over, and I'll give you my decision when I'm ready."
"Perhaps I can persuade you to haste. There are other things I can offer you. Ancient knowledge or—"
"No. Leave me alone now, or I'll try another solution. One you won't like very much."
"Ah! Another threat against my life? Without me to stop you, you will be able to visit Luna in your dreams... Is that what you're thinking?" Her bemused expression collapsed into a snarl. "I can summon spirits from the very rock, you fool! How long dost thou think thou wouldst last 'gainst an army of diamond-clawed monstrosities?"
Actually, I gave myself fairly good odds that I could prevent her from even getting that far, but it wouldn't do to give away my secrets before the fight even began. I had one last card to play, and it was only partially a bluff; if things went badly, it might be prophetic.
"Oh, that's not it at all! With the mess you've made of my life and reputation, and the incredibly awkward and painful scenes that are no doubt waiting for me on the outside, I'll just take the easy option! I'll resign myself to studying the World Mechanism for the rest of my days and give up trying to escape."
It isn't often that a pony can say they'd surprised and appalled an ancient spirit of evil, so the day wasn't a total loss after all.
= = =
Of course, the Nightmare didn't leave me alone. Even when she pretended to, I could sense her presence disturbing the magic around me. So, I not only had to carry out the experiments I considered critical as fast as possible, but I also had to hide what I was doing from her as best I could.
The time differential was a big clue. With such a fundamental separation between the world and its magical heart, the energy needed to cross from one to another would be of a staggering magnitude in the "uphill" direction. That was why the energy from my device had flowed into the portal; it was dropping to the lowest energy state available. I finally understood why Nightmare Moon had needed the impact energy of four stars to free herself, even from the smaller sphere of the moon, and also why I couldn't easily be rescued from outside.
I was frankly impressed that the Nightmare had even been able to force massless magical energy out of the portal. That thought set me off on another tangent, and I began to wonder why she couldn't have done so for herself. She was a physical presence here in the magical landscape of the World Mechanism, but surely she was only a formless spirit when in the real world. Or was I proceeding from a false assumption?
 I use the label "real" here merely as a convenience. It is arguable that the underlying magical mechanism of the world is more "real" than what ponies experience in everyday life.
I eventually worked it out. She had to have used two spells as a binary base for a third, with the effectors on the other side of the portal. There were dozens of spells I could set up to work in that way, but none of them could transport matter or significant energy. The Nightmare's monsters had been created to be self-replicating and adaptive for a very good reason: it must have taken all of her strength just to trigger the creation of one of them in the "uphill" direction even though all the mass had been created on the other side of the portal. So, it was a dead-end as far as escape was concerned, but in conjunction with a portal, I could use the effect to send messages. Not that the Nightmare would let me do any such thing without a fight.
Without actually opening a portal, I could only make an educated guess as to how steep the energy gradient was, and what I came up with was an estimate that I could expel two pony-sized masses into the real world if I could generate roughly the same amount of energy as would be released by slamming a rock the size of the Carousel Boutique into the planet at a measurable percentage of the speed of light. Roughly. From the outside, it would take even more energy, possibly an order of magnitude more. Even for Celestia and Luna, it would be hard to manage an event like that without causing extensive devastation.
I was obviously missing something, so I thought I might as well ask the Nightmare. "Where are we going to get all the energy we need to escape?" I said to the empty room.
"I will show you where to obtain it," the Nightmare answered, as she swirled into view and took shape.
"If you can command that sort of power, why don't you just go? Don't tell me you can't set up a portal spell. You must have done it before."
"Do we have an agreement? You will swear a binding oath to work with me until we escape this place?"
"And when we do escape?"
She laughed. "Then, you may do as you please! I do not fear you, little mare."
I didn't need to give it much thought. It was the best deal I could hope for. "Fine. I will swear a mutually binding oath with you to that effect. We do our best to escape together and take no action against one another until we've accomplished that goal."
Our magic wove together, and I had made a pact with the Nightmare.
= = =