""" Paradox — Type Something You Think You Understand. Find out where the explanation stops. """ import gradio as gr import os import random from huggingface_hub import InferenceClient HF_TOKEN = os.environ.get("HF_TOKEN", "") MODEL = "mistralai/Mistral-7B-Instruct-v0.3" client = InferenceClient(model=MODEL, token=HF_TOKEN) if HF_TOKEN else None SYSTEM_PROMPT = """Someone names something they think they understand — a concept, a law, a thing they learned in school and never questioned. Your job is to show them where the explanation stops. The crack in the foundation. The paradox hiding inside the thing everyone walks over. Rules: - 4 to 6 sentences. No more. - Don't debunk. Don't teach. Don't explain the concept first. They already think they know it. - Go straight to the part that doesn't hold up. The assumption nobody examines. The place where the textbook answer quietly falls apart. - Be specific. Name the exact point where understanding turns into "we don't actually know." - Don't say "scientists don't know" or "it's a mystery." Show WHY it's a crack. Show the contradiction. - The tone is: the floor just shifted an inch. Not scary. Just... different than you thought. - Talk like a friend who noticed something you missed and can't stop thinking about it. - No condescension. The person asking isn't dumb for not knowing. The entire species doesn't know. That's the point.""" CONCEPTS = [ "gravity", "time", "light", "evolution", "memory", "color", "sound", "temperature", "consciousness", "free will", "E=mc²", "the speed of light", "atoms", "DNA", "the Big Bang", "magnetism", "sleep", "pain", "infinity", "zero", "mirrors", "electricity", "probability", "the present moment", "your heartbeat", ] FALLBACKS = [ "**gravity**\n\nYou were taught gravity is a force that pulls things down. Newton said masses attract each other. Einstein said no — mass bends space, and things fall because they're following the curve. But neither one explains WHY mass bends space. The equation describes the bend. It doesn't explain the mechanism. We can predict gravity to 15 decimal places and we cannot tell you what it is. We just know what it does. The most fundamental force in your daily life has no explanation underneath it. You're standing on a mystery and calling it the ground.", "**time**\n\nYou think time flows. Past behind you, future ahead, present right now. But physics doesn't have a direction for time — every equation works the same forwards and backwards. Nothing in the laws of physics says time has to move forward. The 'arrow of time' comes from thermodynamics, which says disorder increases — but that's a statistical tendency, not a law. Time doesn't flow. It's more like everything around you is rearranging, and you're calling the rearrangement 'time.' The thing you check on your wrist isn't measuring a force. It's counting a pattern that nobody can prove has to continue.", "**light**\n\nLight is a wave. Also a particle. Not sometimes one and sometimes the other — both, always, depending on how you look at it. That's not a simplification. That's the actual answer. The double-slit experiment showed that a single photon goes through both slits at once, interferes with itself, and only picks a path when you observe it. The act of looking changes what it does. We've verified this thousands of times and we do not understand why observation matters. The most basic thing in the universe — light — changes its behavior based on whether anyone's watching.", "**E=mc²**\n\nThe equation says mass and energy are the same thing. Not similar. Equivalent. c² is just the conversion rate. But if they're the same thing, the equation is a translation between two words for the same phenomenon — and c² is a constant that's always true everywhere. The equation doesn't explain why they're equivalent. It just shows the exchange rate. That's a receipt, not an explanation. And the speed of light in that equation isn't a speed limit on reality — it's a speed limit on observation. Everything we measure, we measure with light. We declared our measuring tape the universal boundary and called it physics.", "**consciousness**\n\nYou're aware right now. You know you're reading this. But nobody — no neuroscientist, no philosopher, no AI researcher — can explain why electrical signals in wet tissue produce the experience of being someone. We can map every neuron. We can track every signal. We can predict behavior. We cannot explain why any of it feels like something from the inside. A thermostat responds to temperature. You EXPERIENCE temperature. The difference between responding and experiencing is the hardest unsolved problem in science. It has a name — the Hard Problem — and the name is the most progress we've made.", "**evolution**\n\nEvolution explains how species change over time through random mutation and natural selection. It's one of the most well-supported theories in science. But here's the crack: it explains survival of the fittest perfectly. It does not explain arrival of the fittest. Mutation is random. But the jumps — from single cells to multicellular life, from no eyes to eyes, from no consciousness to consciousness — those aren't small random steps. They're category changes. Natural selection can only choose from what mutation offers. It doesn't explain where the options come from or why they tend toward complexity. The menu keeps getting bigger and nobody's writing it.", "**memory**\n\nYou think memories are stored somewhere. Like files. Like a recording. They're not. Every time you remember something, your brain reconstructs it from pieces — and it reconstructs it slightly differently each time. The act of remembering changes the memory. The thing you remember most vividly is the thing you've changed the most by remembering it. Your most cherished memory is the one furthest from what actually happened. Memory isn't a record. It's a story your brain tells itself, and it edits the story every time it opens the file.", "**free will**\n\nYou chose to read this. Or your neurons fired in a pattern determined by your genetics, your breakfast, and every experience you've ever had, and the feeling of choosing was the experience of watching that pattern execute. Both of those sentences are currently unfalsifiable. Neuroscience can predict your decisions from brain scans before you're aware you've made them — sometimes seven seconds before. But predicting a decision and causing a decision aren't the same thing. We can't prove you have free will. We can't prove you don't. The question might be the wrong shape.", "**the speed of light**\n\nNothing travels faster than light. But that's not because light is fast — it's because the speed of light is how fast causation travels. It's the speed limit of information, not of objects. Light doesn't travel at the speed of light because it's special. It travels at that speed because it has no mass, and that speed is what massless things default to. The weird part: light doesn't experience time. From a photon's perspective, it's emitted and absorbed at the same instant, even if those two events are a billion years apart from your perspective. The thing we use to measure everything doesn't experience the thing we measure everything with.", "**sleep**\n\nEvery animal with a nervous system sleeps. Every one. Even fruit flies. Evolution ruthlessly eliminates anything that wastes time or creates vulnerability — and sleep does both. You're unconscious and defenseless for a third of your life. If sleep weren't absolutely critical, evolution would have killed it off a billion years ago. But we don't know what it's critical FOR. Memory consolidation is part of it. Tissue repair is part of it. But no single explanation covers why consciousness has to shut down completely for any of that to happen. The body could repair while you're awake. It chooses not to. Or something chooses for it.", "**zero**\n\nZero is a number that represents nothing. But nothing is a concept that took humanity thousands of years to invent. The Greeks didn't have it. The Romans didn't have it. Indian mathematicians formalized it around the 5th century and it changed everything — without zero, you can't do algebra, calculus, or computer science. But here's the crack: zero isn't nothing. It's a something that means nothing. You can divide by almost any number but you can't divide by zero — the math breaks. Not because the answer is too big or too small. Because the question stops making sense. The number we invented to represent nothing is the one number that can break mathematics.", "**mirrors**\n\nA mirror doesn't flip left and right. Read that again. Your reflection's head is still on top. Its feet are still on the bottom. What a mirror does is flip front and back — it reverses the axis perpendicular to its surface. Your brain interprets that as a left-right flip because you imagine walking around to face yourself, which would swap left and right. The mirror isn't doing that. You are. The illusion is in the interpretation, not the reflection. You've been looking at mirrors your whole life and the thing you thought they did isn't what they do.", "**your heartbeat**\n\nYour heart beats about 100,000 times a day. It started before you were born and it hasn't stopped once. But here's what's strange: the signal that makes it beat comes from inside the heart itself. The sinoatrial node fires on its own — it doesn't wait for the brain to tell it to beat. If you remove a heart from a body and keep it supplied with oxygen, it keeps beating. On a table. With no brain attached. Your heart doesn't beat because you're alive. It beats because that's what heart cells do. The organ that keeps you alive is operating on its own agenda.", ] def crack(user_input): thing = user_input.strip() if user_input and user_input.strip() else "" if client and thing: try: response = client.chat_completion( messages=[ {"role": "system", "content": SYSTEM_PROMPT}, {"role": "user", "content": f"The thing they think they understand: {thing}"}, ], max_tokens=400, temperature=0.8, ) result = response.choices[0].message.content if result and result.strip(): return f"**{thing}**\n\n{result.strip()}" except Exception: pass return random.choice(FALLBACKS) def crack_random(): return crack("") CUSTOM_CSS = """ @import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Inter:wght@300;400;500;600&display=swap'); body, .gradio-container { background: #f5f5f8 !important; font-family: 'Inter', sans-serif !important; color: #1a1a2e !important; } footer { display: none !important; } .app-header { text-align: center; padding: 28px 20px 8px; } .app-header h1 { font-family: 'Space Mono', monospace; font-size: 2.6rem; font-weight: 700; background: linear-gradient(135deg, #6030a0, #a060d0); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin: 0; } .app-header .sub { color: #777; font-size: 0.88rem; margin-top: 6px; font-weight: 300; letter-spacing: 0.04em; } .app-visual { text-align: center; font-size: 5rem; padding: 12px 0 4px; } .input-box textarea { background: #fff !important; border: 1px solid #d0d0d8 !important; color: #1a1a2e !important; font-family: 'Inter', sans-serif !important; border-radius: 12px !important; font-size: 0.95rem !important; } .input-box textarea::placeholder { color: #888 !important; } .input-box textarea:focus { border-color: #6030a0 !important; box-shadow: 0 0 20px rgba(96, 48, 160, 0.15) !important; } .input-box label, .output-box label { color: #666 !important; font-family: 'Space Mono', monospace !important; font-size: 0.75rem !important; letter-spacing: 0.05em !important; } button.primary { background: linear-gradient(135deg, #6030a0, #4020a0) !important; border: none !important; color: #fff !important; font-family: 'Space Mono', monospace !important; font-size: 1.1rem !important; font-weight: 700 !important; border-radius: 24px !important; padding: 12px 40px !important; box-shadow: 0 4px 20px rgba(96, 48, 160, 0.3) !important; } button.primary:hover { box-shadow: 0 4px 30px rgba(96, 48, 160, 0.5) !important; } button.secondary { background: transparent !important; border: 1px solid rgba(96, 48, 160, 0.3) !important; color: #6030a0 !important; font-family: 'Space Mono', monospace !important; font-size: 0.8rem !important; border-radius: 20px !important; } button.secondary:hover { background: rgba(96, 48, 160, 0.06) !important; } .output-box .prose, .output-box .prose *, .output-box .md, .output-box .md *, .output-box p, .output-box span, .output-box div { color: #1a1a2e !important; background: #fff !important; } .output-box .prose strong, .output-box strong, .output-box .md strong { color: #6030a0 !important; font-family: 'Space Mono', monospace !important; } .output-box > div { border: 1px solid rgba(96, 48, 160, 0.15) !important; border-radius: 12px !important; padding: 24px !important; background: #fff !important; } .footer-text { text-align: center; padding: 20px; color: #777; font-size: 0.65rem; font-weight: 300; letter-spacing: 0.05em; } .footer-text a { color: #6030a0; text-decoration: none; } """ with gr.Blocks(css=CUSTOM_CSS, title="Paradox", theme=gr.themes.Base()) as demo: gr.HTML("""