/* story-data.jsx — the five Level 0 narratives. One object per page; the
   page HTML picks which to render. Balanced depth: story + the key idea. */

const STORIES = {
  spark: {
    n: "L0-01", kicker: "Where it all begins", title: "The Spark",
    sub: "Volta, Galvani & the first battery · 1780–1800",
    lede: {
      adult: <>Two Italians, one twitching frog leg, and a decade-long argument that accidentally produced the world's first battery. Electricity went from a parlor trick to a tool you could <em>build</em>.</>,
      kids: <>A frog leg twitched on a metal hook — and two scientists started arguing about why. That argument led to the very first battery!</>,
    },
    panels: [
      { initials: "LG", seed: 1, name: "Luigi Galvani", years: "1780s",
        heading: "The twitching frog", body: {
          adult: <>Galvani, an anatomist, noticed a dead frog's leg kicked when touched by two different metals. He decided the frog itself stored "animal electricity." He was wrong about the cause — but he'd stumbled onto something real.</>,
          kids: <>Galvani saw a dead frog's leg kick when two metals touched it. He thought the frog was full of electricity. Not quite — but he was onto something!</>,
        } },
      { initials: "AV", seed: 2, name: "Alessandro Volta", years: "1799",
        heading: "The pile that worked", body: {
          adult: <>Volta suspected the <em>metals</em>, not the frog, made the electricity. To prove it he stacked discs of zinc and copper separated by brine-soaked cloth — the "voltaic pile." It produced a steady current with no frog at all. The first battery.</>,
          kids: <>Volta thought the <em>metals</em> made the spark. So he stacked zinc and copper discs with salty cloth between them — and out came electricity, no frog needed. The first battery!</>,
        } },
    ],
    idea: {
      adult: <>A <em>steady, controllable</em> source of current. Before the pile, electricity was a momentary spark; after it, you could run a current through a wire for as long as you liked — and start measuring it. Volta's name became the <em>volt</em>.</>,
      kids: <>A battery you could rely on! Now electricity could flow steadily through a wire — long enough to study and use. We named the "push" after Volta: the <em>volt</em>.</>,
    },
    bridge: { href: "chapter1.html", label: "Chapter 1 · The Flow",
      blurb: "Volta gave us voltage — the push. See exactly what that push does in the water analogy." },
  },

  ohm: {
    n: "L0-02", kicker: "The law nobody believed", title: "The Law",
    sub: "Georg Ohm, doubted for a decade · 1827",
    lede: {
      adult: <>A schoolteacher worked out the single most useful relationship in electronics — and was so ignored he resigned in disgrace. It took ten years for the world to admit Ohm was right.</>,
      kids: <>A teacher figured out the most useful rule in all of electronics. Nobody believed him for ten whole years!</>,
    },
    panels: [
      { initials: "GO", seed: 3, name: "Georg Ohm", years: "1827",
        heading: "Push, flow, squeeze", body: {
          adult: <>Working with wires of different lengths, Ohm measured how much current a given voltage pushed through. The pattern was beautifully simple: current = voltage ÷ resistance. V = I·R. Three quantities, locked together forever.</>,
          kids: <>Ohm tested lots of wires and found a simple pattern: more push (voltage) means more flow (current), and more squeeze (resistance) means less flow. That's it!</>,
        } },
      { initials: "??", seed: 4, name: "The doubters", years: "1827–1841",
        heading: "Ten years of silence", body: {
          adult: <>German academics dismissed the work as too simple, even unscientific. Ohm resigned his teaching post. Only in 1841, when the Royal Society awarded him its top medal, did recognition finally arrive — and the unit of resistance took his name.</>,
          kids: <>Other scientists said his idea was too simple to matter. Ohm lost his job! Years later they realized he was right, and named the unit of resistance the <em>ohm</em>.</>,
        } },
    ],
    idea: {
      adult: <>The equation you can't do electronics without. V = I·R lets you predict <em>exactly</em> how a circuit behaves before you build it — the foundation everything else stands on.</>,
      kids: <>One tiny equation — V = I·R — that tells you how every circuit behaves before you even build it. The most useful rule you'll learn.</>,
    },
    bridge: { href: "chapter1.html", label: "Chapter 1 · The Flow",
      blurb: "Ohm's law is the heart of Chapter 1. Drag the sliders and watch V, I and R stay locked together." },
  },

  faraday: {
    n: "L0-03", kicker: "The bookbinder who electrified the world", title: "The Storehouse",
    sub: "Michael Faraday & stored charge · 1820s–1830s",
    lede: {
      adult: <>A bookbinder's apprentice with almost no math became the greatest experimentalist of his age — discovering how to store charge, and how moving magnets make electricity. Nearly every generator and motor traces back to him.</>,
      kids: <>A boy who bound books taught himself science and became one of the greatest experimenters ever. He figured out how to <em>store</em> electricity — and how to make it from magnets!</>,
    },
    panels: [
      { initials: "MF", seed: 5, name: "Michael Faraday", years: "1791–1867",
        heading: "From shop to lab", body: {
          adult: <>Self-taught from the books he was binding, Faraday talked his way into the Royal Institution. With little formal mathematics, he relied on intuition and relentless experiment — and outpaced everyone.</>,
          kids: <>Faraday read every book he was supposed to be binding, then got a job in a famous lab. He wasn't great at math — but nobody could out-experiment him.</>,
        } },
      { initials: "C", seed: 6, name: "The capacitor", years: "1830s",
        heading: "Holding a charge", body: {
          adult: <>Faraday studied how an insulator between two plates could <em>store</em> electric charge — capacitance. His name became the <em>farad</em>, the unit of how much charge a capacitor holds. The "bucket" in your circuits is pure Faraday.</>,
          kids: <>Faraday showed you could store electricity between two plates — like filling a bucket. The unit for how big the bucket is got his name: the <em>farad</em>.</>,
        } },
    ],
    idea: {
      adult: <>Storage and timing. A capacitor holds charge and releases it on its own schedule — giving circuits memory, smoothing, and a sense of time. (His other gift, induction, runs every generator on Earth.)</>,
      kids: <>A way to store electricity and let it out slowly — giving circuits a sense of <em>time</em>. That's how blinkers and timers work.</>,
    },
    bridge: { href: "chapter4.html", label: "Chapter 4 · The Bucket",
      blurb: "Faraday's capacitor is the bucket of Chapter 4. Fill it, drain it, and watch R·C set the time." },
  },

  wars: {
    n: "L0-04", kicker: "The current wars", title: "Current Wars",
    sub: "Edison vs. Tesla, DC vs. AC · 1880s–1890s",
    lede: {
      adult: <>Two visions of how to deliver power fought a bitter, theatrical war — complete with publicity stunts and worse. The outcome decided what comes out of every wall socket on Earth.</>,
      kids: <>Two brilliant inventors fought over the best way to send electricity to homes. The winner decided what comes out of your wall plug today!</>,
    },
    panels: [
      { initials: "TE", seed: 7, name: "Thomas Edison", years: "DC",
        heading: "Direct current", body: {
          adult: <>Edison built the first power systems using direct current — steady, one-direction flow, exactly like our battery-and-barrel. But DC was hard to send far: it lost too much energy over distance.</>,
          kids: <>Edison's electricity flowed one steady direction, like our barrel and pipe. The problem: it couldn't travel far without fading out.</>,
        } },
      { initials: "NT", seed: 8, name: "Nikola Tesla", years: "AC",
        heading: "Alternating current", body: {
          adult: <>Tesla (with backer George Westinghouse) championed alternating current — flow that reverses many times a second. With transformers, AC could be sent at high voltage across huge distances, then stepped down for homes. It won.</>,
          kids: <>Tesla's electricity flips back and forth super fast. That trick let it travel very far across wires — so Tesla's way won, and it's what we use now.</>,
        } },
    ],
    idea: {
      adult: <>The grid. AC's ability to travel efficiently made nationwide power possible. (Everything in these lessons uses simpler <em>DC</em> — but now you know why your wall outlet is different, and more dangerous.)</>,
      kids: <>The reason power can reach every home. Our lessons use the simpler one-direction kind (DC) — but your wall plug uses Tesla's back-and-forth kind (AC), which is much more dangerous.</>,
    },
    bridge: { href: "chapter3.html", label: "Chapter 3 · Power & Heat",
      blurb: "Power is what the grid delivers. See watts, heat, and why big loads matter in Chapter 3." },
  },

  transistor: {
    n: "L0-05", kicker: "The invention that made everything", title: "The Tiny Switch",
    sub: "Bell Labs & the transistor · 1947",
    lede: {
      adult: <>Three physicists in a New Jersey lab built a tiny device that could switch and amplify with no moving parts. It replaced the bulky vacuum tube — and everything digital, from your phone to the internet, is built from billions of its descendants.</>,
      kids: <>Three scientists made a tiny gadget that could switch electricity all by itself. Today there are <em>billions</em> of them in every phone and computer!</>,
    },
    panels: [
      { initials: "BL", seed: 1, name: "Bardeen, Brattain & Shockley", years: "1947",
        heading: "A switch with no moving parts", body: {
          adult: <>At Bell Labs, John Bardeen, Walter Brattain and William Shockley built the first transistor — a sliver of semiconductor where a tiny input current controls a much larger one. They shared the 1956 Nobel Prize in Physics.</>,
          kids: <>At Bell Labs, three scientists made the first transistor — a tiny switch where a small signal controls a big one. They won the Nobel Prize for it!</>,
        } },
      { initials: "µ", seed: 2, name: "The microchip", years: "1958 →",
        heading: "From one to billions", body: {
          adult: <>Once transistors could be etched onto a single chip of silicon, the count exploded — thousands, then millions, now tens of billions on a fingernail-sized die. Each one is a switch flipped by electricity, exactly as in Chapter 6.</>,
          kids: <>Soon people learned to print tons of transistors on one tiny chip. Now a chip smaller than your fingernail holds billions of them — all switching faster than you can blink.</>,
        } },
    ],
    idea: {
      adult: <>The atom of computing. A small signal switching a big one, repeated billions of times, is literally how every computer thinks. The whole digital world is this one idea, scaled up.</>,
      kids: <>The building block of every computer. A tiny switch, copied billions of times — that's how computers think!</>,
    },
    bridge: { href: "chapter6.html", label: "Chapter 6 · The Transistor",
      blurb: "Meet the transistor itself in Chapter 6 — a small signal switching a big load, by hand." },
  },
};

Object.assign(window, { STORIES });
