As soon as the door shuts, Twilight begins to pace, furiously, like the world will end if she stands still. If there's space, she likes to pace in circles, so she never has to stop to turn around. Sometimes, she lets herself believe she would have been valedictorian if only they'd let her take tests standing. Some thoughts are easy to think.

The context and gravity of her task are beyond her comprehension. There's nothing left to do except get started.

"Spike, before we start working on solutions in detail, we're going to write a comprehensive list of every problem we can think of. That way, we know exactly where we stand, and exactly what our priorities should be, before we get mired within solving a single problem. Write down each numbered item, with a few lines of blank space underneath."

"Okay, Twi." He hops up to the librarian's chair behind the desk. He's not tall enough to see over the counter, but he only needs to hear.

"First are the obvious ones. One: food. We're going to run out as soon as the crops begin to die from lack of sunlight, unless we start rationing immediately. Two: temperature. It isn't going to stop dropping until it's far below safe levels." Twilight reckons it will be maybe a matter of hours until it gets uncomfortably chilly, and a few more before it gets truly dangerous. Then, the thought occurs to her: the average pony won't have any clue what time it is without the sun or moon to gauge it by. Once her magic refills completely, she won't have any sort of natural timer, either. "Three: time-keeping. Relatively minor in the scope of things, but we're going to need a system in place in order to distribute rations, since we can't use the sun and moon. With me so far? "

"Absolutely," says Spike, though he's still scribbling.

While her mind's on the moon, she impulsively steps outside. A quick angle metric and some trigonometry tell her that the moon is directly overhead, within experimental uncertainty. It must have returned over the horizon at some point after the festival began, probably around when Nightmare Moon showed up. Of course they wouldn't even be so lucky as to have a reliable visual compass.

What else? What else does the sun provide? "Four: lighting. It's going to be dark, all the time. We need infrastructure for lighting the town and ponies' homes. Candles would work, although the first time it rains—oh. Five: the water cycle. It's going to be seriously disrupted without the sun to evaporate surface water. We may not see changes for a while, but it's going to pose problems of its own. Although, honestly, if we can make it long enough that it becomes an issue, I'd say we were doing pretty well."

Twilight's mind is still spinning, but nothing else comes rattling out. That might be all of the problems the sun's absence will cause, at least the one's she's equipped to recognize. But... that's not the only effect of Princess Luna's return, is it? I also need to address problems caused by Celestia's... disappearance. She won't call it anything else. Can't.

"Don't write this down yet, but six: power. With Celestia gone, there's going to be a serious power vacuum in Canterlot, and all of Equestria, until Nightmare Moon directly steps in. Ponies won't know who to turn to. I don't know what the chain of succession is. I don't even know whether Equestria has one. It just never seemed relevant. We've been stable so long that we assumed... I assumed the sun would shine forever. I don't know who's going to be making the decisions and decrees in Canterlot, because it's not like we have a vice princess. Maybe one of Celestia's advisers, but it doesn't matter, at least it's not something Ponyville has to solve. Whenever they figure out who's in charge, I would not like to be in her hooves, and be the figurehead against Nightmare Moon's reign. But whoever it is, Ponyville's going to have to talk to her, and so will every other city. We need country-wide unity in infrastructure if we're going to stand a chance at surviving, much less fighting back. So, six: hierarchy of command. No, scratch that, it's still not really our problem. Six: intercity communication. It's going to be too resource-intensive to keep trains running, all that coal could be used in much better ways, but we still have to keep the channels open. I'm not sure how Ponyville can help, but it's definitely our problem too."

She pictures the iconic mountainside capital, shrouded in darkness, with the full moon hung far above—

"Come to think of it, we don't know where Nightmare Moon even went. Maybe her first stop was Canterlot, and if that's the case..."

For the first time since she arrived in Ponyville, Twilight is glad she's not back home. She shakes her head a fraction. Focus. The girls agreed to return in ninety minutes, plus-or-minus their estimation skills. What else can you do with this time?

"Seven: power. ...Write it down this time; I mean something else."

"Twilight?"

"...We're completely out of our depth here. You, me, Ponyville, Equestria. For all my studying, I'm useless in a fight, and so is probably everypony we know. I harbor no delusion of slaying Nightmare Moon, but... even around Ponyville, things may become... rough. As food and clothing begin to dwindle..."

"...I get it."

Twilight stares through the window at the stars, subtly twinkling in an obscure, unrecognizable rhythm. It's almost like some facile scheme of communication, like they have something to say, some whispered wisdom with which she might save something. They're stalwart, invulnerable, but so far away... is that the cost?

"We need to know how to take care of ourselves. So do the girls. I'm not going to mandate combat training or anything, but there are certain steps we can take. I assume Rarity and Tinder don't know the first thing about magic, because almost nopony does. That will change."

It's a question of economy. She can pour as many intricate spells as she wants into a gem, but at the end of the day, what matters is its decay rate. Canterlot is renowned for its lapidaries, and as a professional mage, Twilight receives a large monthly stipend for the express purpose of aggregating choice infusion materials. As such, those in her possession are among the highest fidelity bits can buy. Specifically, they're almost worthless. For all the spellwork Twilight slaves over every waking hour, almost none of it is simple enough to put in a rock.

She eyes her list of candidate suspensions, for at least the fourth time.

• Automated force repulsion

• Automated barrier

• Automated illusion (what?)

• Automated distress signal (what?)

• Automated vivification retaliation

• Automated escape (how?)

Too many options, too little specificity in each. She realizes she's going about this backwards. Factor out the commonality between the different choices, and work with it first. ...I can't believe I wrote 'automated' six different times. What should the activation mechanism be? Even simpler, what could it be? What's utilitarian enough for a gem that it won't hog the magical real estate? It's considerably simpler than the holistic "What tools should I craft for my allies?" Figure it out, then work within the constraint of how much thaumage you have left.

Twilight fancies a react-to-threat mechanism, but she's growing increasingly confident that it won't work. In theory, there's nothing stopping her from crafting a specialized metric that detects incident force within the trigger range, namely six inches or so from the body of the pony wearing it. She can't help but realize that the same metric could easily be modified to detect vivifications above a certain power threshold, too. Immediately, she exiles that thoughtline. What good is that? No one in Ponyville is going to even try to fight with magic. No one has the raw capacity, except, maybe, you. Your job is not to protect them from Nightmare Moon directly. Your role is to maximize their chance of survival by accounting for whatever threats you can realistically handle. If any one of us meets Nightmare Moon again, she's dead. Period. Ergo, conditioning on that possibility is a complete waste of time. Check the hyperprotagonistic fantasies at the door to the apocalypse, please.

No, it's just too much complexity to pack into just the trigger. Even setting up the detection range for the top-level metric requires another metric to match the contours of the body. A complicated one. It could be simplified to a rough ellipse... but unless it's awkwardly centered at the stone itself, that's still stacking metrics, which gets expensive quickly. Twilight fantasizes about a metric that can just detect ill-will, as straightforwardly as that...

Except... she already knows how to do that. There is an exceedingly obvious way to trigger a suspended spell in response to threat. Almost the cheapest trigger mechanism she can think of, too.

Don't craft what sounds the most useful. Craft what is the most useful.

It's obvious Spike's got something on his mind, if only Twilight were looking. He's wringing his hands in a way that only a baby dragon could without looking maniacal. It's a testament to how nervous he is that he's waiting for her to notice: he knows she won't. After a while, he's swallowed enough times to work up to it: "Hey, Twi? Can I ask you something?"

"Sure." Her gaze is deep within a sapphire, her horn aglow in concentration.

"Are you... are you worried about your family? What do you think Twilight Velvet and Shining Armor are doing right now?"

"...I have no equestrian idea." That's all there is to say.

"Do you think they're safe?"

"I don't know, Spike." Her gears start skipping teeth.

"What about our friends? Lemon Hearts, Minuette, Moon Dan—"

The sapphire shatters in a surge of purple magic. "I know who my friends are, Spike. I don't know how they are or what they're doing. But I do know you couldn't pay me enough to set hoof within ten miles of Canterlot right now. What do you want from me?!"

"...Nothing, Twi. Sorry for bringing it up."

It's not until far too many minutes later that Twilight realizes he wasn't asking for her sake.