{"id":"rErGinKMJ18x7ZE7","title":"Guess the Footprint","source":"presentation","presentUrl":"https://www.niori.app/present/rErGinKMJ18x7ZE7","slideCount":10,"format":{"language":"jsx","canvas":{"width":1280,"height":720},"conventions":["Each slide is one self-contained React component; the function it declares renders on a fixed 1280x720 canvas.","React hooks are imported from 'react'. Chart components are imported from 'recharts' but served by the app's own implementation.","An import of the form `import \"font:Family Name\"` loads a Google Font for the slide.","An import of the form `import \"palette:Name\"` declares the slide colour palette; charts and diagrams inherit its accent and tones through CSS variables.","Tailwind classes cover layout, spacing, sizing, typography and neutral colours only; colours, borders, shadows and custom values are inline styles.","notes are the speaker notes and targetDuration is the intended time on the slide in seconds; both are present only when set, and notes only for someone with a role on the deck or its agent link."]},"slides":[{"index":0,"title":"Question: coffee water footprint","code":"import { useState } from 'react';\nimport { Frame } from 'deck';\nimport 'palette:Slate';\nimport 'font:FiraGO';\n\nconst INK = '#2A2160';\nconst CREAM = '#FFF7EC';\n\nfunction CoverSlide() {\n  const [s, setS] = useState(() => {\n    const ans = (typeof window !== 'undefined' && window.__quizAns) || [];\n    const KEY = [2, 2, 2, 3, 2, 1, 1];\n    return KEY.filter((k, i) => ans[i + 1] === k).length;\n  });\n  const chips = [\n    ['Coffee', '#FF7A45'], ['Burger', '#FF4E4E'], ['T-shirt', '#FFD23F'],\n    ['Phone', '#7C5CFF'], ['Jeans', '#2E86FF'], ['Streaming', '#F63E9C'], ['Flight', '#00C2A8'],\n  ];\n  return (\n    <Frame index={1} total={9} font=\"FiraGO, sans-serif\" style={{ backgroundColor: '#FFD23F' }}>\n      <div className=\"flex flex-col gap-7 h-full justify-center\">\n        <div className=\"text-sm uppercase tracking-widest\" style={{ color: INK, opacity: 0.7 }}>\n          An interactive quiz · 7 questions · no photos, just numbers\n        </div>\n        <h1 className=\"font-bold leading-none\" style={{ color: INK, fontSize: '100px', letterSpacing: '-2px' }}>\n          Guess the<br /><span style={{ color: '#FFFFFF' }}>footprint</span>\n        </h1>\n        <div className=\"flex gap-8 text-lg\" style={{ color: INK }}>\n          <div className=\"flex items-center gap-3\">\n            <span className=\"flex items-center justify-center font-bold\" style={{ backgroundColor: INK, color: '#FFD23F', width: '36px', height: '36px', borderRadius: '50%' }}>1</span>\n            Pick an answer\n          </div>\n          <div className=\"flex items-center gap-3\">\n            <span className=\"flex items-center justify-center font-bold\" style={{ backgroundColor: INK, color: '#FFD23F', width: '36px', height: '36px', borderRadius: '50%' }}>2</span>\n            See if you nailed it\n          </div>\n          <div className=\"flex items-center gap-3\">\n            <span className=\"flex items-center justify-center font-bold\" style={{ backgroundColor: INK, color: '#FFD23F', width: '36px', height: '36px', borderRadius: '50%' }}>3</span>\n            Watch the real number land\n          </div>\n        </div>\n        <div className=\"flex items-center gap-6\">\n          <div className=\"flex items-baseline gap-3 px-6 py-4 font-bold\" style={{ backgroundColor: INK, color: '#FFD23F', borderRadius: '18px' }}>\n            <span style={{ fontSize: '40px' }}>{s}</span>\n            <span style={{ fontSize: '20px' }}>/ 7 · Score resets here</span>\n          </div>\n          <button\n            onClick={() => { window.__quizAns = []; setS(0); }}\n            className=\"text-lg font-bold px-6 py-4 transition-all duration-200 hover:-translate-y-1\"\n            style={{ backgroundColor: '#FFFFFF', color: INK, borderRadius: '18px', boxShadow: '0 5px 0 rgba(42,33,96,0.35)' }}>\n            Start fresh →\n          </button>\n        </div>\n        <div className=\"flex items-center gap-3\">\n          {chips.map(([name, c]) => (\n            <span key={name} className=\"px-4 py-2 font-bold text-base\" style={{ backgroundColor: c === '#FFD23F' ? '#FFFFFF' : c, color: INK, borderRadius: '999px' }}>{name}</span>\n          ))}\n        </div>\n      </div>\n    </Frame>\n  );\n}"},{"index":1,"title":"Question: burger water footprint","code":"import { useState, useEffect } from 'react';\nimport { Frame } from 'deck';\nimport { BarChart, Bar, XAxis, YAxis, Grid, Cell } from 'charts';\nimport 'palette:Slate';\nimport 'font:FiraGO';\n\nconst IDX = 1, ANSWER = 2;\nconst BG = '#FF7A45', INK = '#2A2160', CREAM = '#FFF7EC', GOOD = '#00B368', BAD = '#C1123A';\nconst OPTS = [\n  { label: '13 L', value: 13 },\n  { label: '37 L', value: 37 },\n  { label: '132 L', value: 132 },\n  { label: '400 L', value: 400 },\n];\nconst Q = 'How much water does it take to make one cup of coffee?';\nconst REAL = '132 litres';\nconst FACT = 'Almost all of it goes into growing and processing the beans. The water in the cup is a rounding error.';\nconst CAP = 'Water footprint of each answer, litres';\nconst SOURCE = 'Water Footprint Network, via DW (2022)';\nconst HREF = 'https://www.dw.com/en/how-big-is-your-water-footprint/a-61171792';\n\nfunction Cup() {\n  return (\n    <svg viewBox=\"0 0 200 130\" width=\"200\" height=\"130\">\n      <path d=\"M35 32 H115 L107 110 Q106 118 98 118 H52 Q44 118 43 110 Z\" fill={INK} />\n      <path d=\"M120 48 q30 0 30 24 q0 24 -33 24\" fill=\"none\" stroke={INK} strokeWidth=\"11\" />\n      <rect x=\"39\" y=\"56\" width=\"74\" height=\"11\" fill={CREAM} opacity=\"0.9\" />\n      <path d=\"M62 24 q10 -10 0 -20\" stroke={CREAM} strokeWidth=\"6\" fill=\"none\" strokeLinecap=\"round\" />\n      <path d=\"M88 24 q10 -10 0 -20\" stroke={CREAM} strokeWidth=\"6\" fill=\"none\" strokeLinecap=\"round\" />\n    </svg>\n  );\n}\n\nfunction QuizSlide() {\n  const [pick, setPick] = useState(null);\n  const [shown, setShown] = useState(false);\n  const [score, setScore] = useState(0);\n  useEffect(() => {\n    const ans = window.__quizAns || (window.__quizAns = []);\n    let s = 0;\n    ans.forEach((a) => { if (a === ANSWER) s += 1; });\n    if (ans[IDX] !== undefined) { setPick(ans[IDX]); setShown(true); }\n    setScore(s);\n  }, []);\n  const choose = (i) => {\n    if (pick !== null) return;\n    const ans = window.__quizAns || (window.__quizAns = []);\n    ans[IDX] = i;\n    let s = 0;\n    ans.forEach((a) => { if (a === ANSWER) s += 1; });\n    setPick(i); setScore(s);\n    setTimeout(() => setShown(true), 40);\n  };\n  const correct = pick === ANSWER;\n  return (\n    <Frame kicker=\"GUESS THE FOOTPRINT\" index={2} total={9} font=\"FiraGO, sans-serif\" style={{ backgroundColor: BG }} source={SOURCE} sourceHref={HREF}>\n      <div className=\"grid gap-8 h-full\" style={{ gridTemplateColumns: '1.15fr 1fr' }}>\n        <div className=\"flex flex-col gap-3\">\n          <div className=\"flex items-center justify-between\">\n            <span className=\"text-sm uppercase tracking-widest\" style={{ color: INK, opacity: 0.65 }}>Question {IDX} of 7</span>\n            <span className=\"text-sm font-bold px-4 py-1.5\" style={{ backgroundColor: INK, color: CREAM, borderRadius: '999px' }}>Score {score}/7</span>\n          </div>\n          <h2 className=\"text-3xl font-bold leading-tight\" style={{ color: INK }}>{Q}</h2>\n          <div className=\"flex flex-col gap-3\">\n            {OPTS.map((o, i) => {\n              const isCorrect = i === ANSWER;\n              let bg = CREAM, fg = INK, sh = '0 5px 0 rgba(42,33,96,0.3)';\n              if (shown && isCorrect) { bg = GOOD; fg = '#FFFFFF'; sh = '0 3px 0 rgba(0,0,0,0.25)'; }\n              else if (shown && i === pick && !correct) { bg = BAD; fg = '#FFFFFF'; sh = '0 3px 0 rgba(0,0,0,0.25)'; }\n              return (\n                <button key={i} onClick={() => choose(i)}\n                  className=\"flex items-center justify-between px-6 py-3 text-xl font-bold transition-all duration-200 hover:-translate-y-1\"\n                  style={{ backgroundColor: bg, color: fg, borderRadius: '14px', boxShadow: sh, textAlign: 'left', opacity: shown && !isCorrect && i !== pick ? 0.35 : 1, cursor: pick !== null ? 'default' : 'pointer' }}>\n                  <span>{o.label}</span>\n                  {shown && isCorrect && <span className=\"text-sm uppercase tracking-widest\">Correct</span>}\n                  {shown && i === pick && !correct && <span className=\"text-sm uppercase tracking-widest\">Nope</span>}\n                </button>\n              );\n            })}\n          </div>\n          <div className={'transition-all duration-500 ' + (shown ? 'opacity-100 scale-100' : 'opacity-0 scale-75')} style={{ transformOrigin: 'left center' }}>\n            <div className=\"flex items-baseline gap-4\">\n              <span className=\"text-5xl font-bold\" style={{ color: INK }}>{REAL}</span>\n              <span className=\"text-xl font-bold uppercase tracking-widest\" style={{ color: correct ? GOOD : BAD }}>{correct ? 'Nailed it!' : 'Not this time'}</span>\n            </div>\n            <p className=\"text-lg mt-2\" style={{ color: INK, opacity: 0.85, maxWidth: '560px' }}>{FACT}</p>\n          </div>\n        </div>\n        <div className=\"flex flex-col gap-3 min-h-0 items-center\">\n          <Cup />\n          <div className=\"flex-1 min-h-0 w-full flex flex-col justify-end\">\n            {pick === null ? (\n              <div className=\"w-full flex items-center justify-center px-6 py-10\" style={{ backgroundColor: '#FFFFFF', borderRadius: '18px' }}>\n                <p className=\"text-lg text-center\" style={{ color: INK, opacity: 0.55 }}>The comparison chart appears once you answer. No peeking.</p>\n              </div>\n            ) : (\n              <div className=\"w-full\" style={{ backgroundColor: '#FFFFFF', borderRadius: '18px', padding: '10px 12px' }}>\n                <BarChart data={OPTS} width=\"100%\" height={230} accent={INK}>\n                  <Grid />\n                  <XAxis dataKey=\"label\" />\n                  <YAxis />\n                  <Bar dataKey=\"value\">\n                    {OPTS.map((o, i) => <Cell key={i} fill={i === ANSWER ? GOOD : INK} />)}\n                  </Bar>\n                </BarChart>\n              </div>\n            )}\n            <p className=\"text-sm tracking-wide mt-2\" style={{ color: INK, opacity: 0.65 }}>{pick === null ? 'Water footprint of each answer, litres' : CAP}</p>\n          </div>\n        </div>\n      </div>\n    </Frame>\n  );\n}"},{"index":2,"title":"Question: cotton t-shirt water footprint","code":"import { useState, useEffect } from 'react';\nimport { Frame } from 'deck';\nimport { BarChart, Bar, XAxis, YAxis, Grid, Cell } from 'charts';\nimport 'palette:Slate';\nimport 'font:FiraGO';\n\nconst IDX = 2, ANSWER = 2;\nconst BG = '#FF4E4E', INK = '#2A2160', CREAM = '#FFF7EC', GOOD = '#00B368', BAD = '#C1123A';\nconst OPTS = [\n  { label: '250 L', value: 250 },\n  { label: '700 L', value: 700 },\n  { label: '2,500 L', value: 2500 },\n  { label: '6,000 L', value: 6000 },\n];\nconst Q = 'How much water does one beef burger cost?';\nconst REAL = '2,500 litres';\nconst FACT = 'About 99% of it is the beef. Raising a cow takes years of feed, grass and drinking water before it reaches a bun.';\nconst CAP = 'Water footprint of each answer, litres';\nconst SOURCE = 'Water Footprint Calculator (2022)';\nconst HREF = 'https://www.watercalculator.org/footprint/what-is-the-water-footprint-of/';\n\nfunction Burger() {\n  return (\n    <svg viewBox=\"0 0 200 130\" width=\"200\" height=\"130\">\n      <path d=\"M40 55 Q40 18 100 18 Q160 18 160 55 Z\" fill={CREAM} />\n      <circle cx=\"75\" cy=\"35\" r=\"4\" fill={INK} /><circle cx=\"100\" cy=\"28\" r=\"4\" fill={INK} /><circle cx=\"125\" cy=\"35\" r=\"4\" fill={INK} />\n      <path d=\"M36 60 q8 10 16 0 q8 10 16 0 q8 10 16 0 q8 10 16 0 q8 10 16 0 q8 10 16 0 q8 10 16 0 q8 10 16 0 V72 H36 Z\" fill=\"#7ED957\" />\n      <rect x=\"36\" y=\"76\" width=\"128\" height=\"16\" rx=\"8\" fill={INK} />\n      <rect x=\"42\" y=\"98\" width=\"116\" height=\"16\" rx=\"8\" fill={CREAM} />\n    </svg>\n  );\n}\n\nfunction QuizSlide() {\n  const [pick, setPick] = useState(null);\n  const [shown, setShown] = useState(false);\n  const [score, setScore] = useState(0);\n  useEffect(() => {\n    const ans = window.__quizAns || (window.__quizAns = []);\n    let s = 0;\n    ans.forEach((a) => { if (a === ANSWER) s += 1; });\n    if (ans[IDX] !== undefined) { setPick(ans[IDX]); setShown(true); }\n    setScore(s);\n  }, []);\n  const choose = (i) => {\n    if (pick !== null) return;\n    const ans = window.__quizAns || (window.__quizAns = []);\n    ans[IDX] = i;\n    let s = 0;\n    ans.forEach((a) => { if (a === ANSWER) s += 1; });\n    setPick(i); setScore(s);\n    setTimeout(() => setShown(true), 40);\n  };\n  const correct = pick === ANSWER;\n  return (\n    <Frame kicker=\"GUESS THE FOOTPRINT\" index={3} total={9} font=\"FiraGO, sans-serif\" style={{ backgroundColor: BG }} source={SOURCE} sourceHref={HREF}>\n      <div className=\"grid gap-8 h-full\" style={{ gridTemplateColumns: '1.15fr 1fr' }}>\n        <div className=\"flex flex-col gap-3\">\n          <div className=\"flex items-center justify-between\">\n            <span className=\"text-sm uppercase tracking-widest\" style={{ color: INK, opacity: 0.65 }}>Question {IDX} of 7</span>\n            <span className=\"text-sm font-bold px-4 py-1.5\" style={{ backgroundColor: INK, color: CREAM, borderRadius: '999px' }}>Score {score}/7</span>\n          </div>\n          <h2 className=\"text-3xl font-bold leading-tight\" style={{ color: INK }}>{Q}</h2>\n          <div className=\"flex flex-col gap-3\">\n            {OPTS.map((o, i) => {\n              const isCorrect = i === ANSWER;\n              let bg = CREAM, fg = INK, sh = '0 5px 0 rgba(42,33,96,0.3)';\n              if (shown && isCorrect) { bg = GOOD; fg = '#FFFFFF'; sh = '0 3px 0 rgba(0,0,0,0.25)'; }\n              else if (shown && i === pick && !correct) { bg = BAD; fg = '#FFFFFF'; sh = '0 3px 0 rgba(0,0,0,0.25)'; }\n              return (\n                <button key={i} onClick={() => choose(i)}\n                  className=\"flex items-center justify-between px-6 py-3 text-xl font-bold transition-all duration-200 hover:-translate-y-1\"\n                  style={{ backgroundColor: bg, color: fg, borderRadius: '14px', boxShadow: sh, textAlign: 'left', opacity: shown && !isCorrect && i !== pick ? 0.35 : 1, cursor: pick !== null ? 'default' : 'pointer' }}>\n                  <span>{o.label}</span>\n                  {shown && isCorrect && <span className=\"text-sm uppercase tracking-widest\">Correct</span>}\n                  {shown && i === pick && !correct && <span className=\"text-sm uppercase tracking-widest\">Nope</span>}\n                </button>\n              );\n            })}\n          </div>\n          <div className={'transition-all duration-500 ' + (shown ? 'opacity-100 scale-100' : 'opacity-0 scale-75')} style={{ transformOrigin: 'left center' }}>\n            <div className=\"flex items-baseline gap-4\">\n              <span className=\"text-5xl font-bold\" style={{ color: INK }}>{REAL}</span>\n              <span className=\"text-xl font-bold uppercase tracking-widest\" style={{ color: correct ? GOOD : BAD }}>{correct ? 'Nailed it!' : 'Not this time'}</span>\n            </div>\n            <p className=\"text-lg mt-2\" style={{ color: INK, opacity: 0.85, maxWidth: '560px' }}>{FACT}</p>\n          </div>\n        </div>\n        <div className=\"flex flex-col gap-3 min-h-0 items-center\">\n          <Burger />\n          <div className=\"flex-1 min-h-0 w-full flex flex-col justify-end\">\n            {pick === null ? (\n              <div className=\"w-full flex items-center justify-center px-6 py-10\" style={{ backgroundColor: '#FFFFFF', borderRadius: '18px' }}>\n                <p className=\"text-lg text-center\" style={{ color: INK, opacity: 0.55 }}>The comparison chart appears once you answer. No peeking.</p>\n              </div>\n            ) : (\n              <div className=\"w-full\" style={{ backgroundColor: '#FFFFFF', borderRadius: '18px', padding: '10px 12px' }}>\n                <BarChart data={OPTS} width=\"100%\" height={230} accent={INK}>\n                  <Grid />\n                  <XAxis dataKey=\"label\" />\n                  <YAxis />\n                  <Bar dataKey=\"value\">\n                    {OPTS.map((o, i) => <Cell key={i} fill={i === ANSWER ? GOOD : INK} />)}\n                  </Bar>\n                </BarChart>\n              </div>\n            )}\n            <p className=\"text-sm tracking-wide mt-2\" style={{ color: INK, opacity: 0.65 }}>{pick === null ? 'Water footprint of each answer, litres' : CAP}</p>\n          </div>\n        </div>\n      </div>\n    </Frame>\n  );\n}"},{"index":3,"title":"Question: smartphone water footprint","code":"import { useState, useEffect } from 'react';\nimport { Frame } from 'deck';\nimport { BarChart, Bar, XAxis, YAxis, Grid, Cell } from 'charts';\nimport 'palette:Slate';\nimport 'font:FiraGO';\n\nconst IDX = 3, ANSWER = 2;\nconst BG = '#FFD23F', INK = '#2A2160', CREAM = '#FFF7EC', GOOD = '#00B368', BAD = '#C1123A';\nconst OPTS = [\n  { label: '90 L', value: 90 },\n  { label: '270 L', value: 270 },\n  { label: '2,700 L', value: 2700 },\n  { label: '7,000 L', value: 7000 },\n];\nconst Q = 'How much water does one cotton t-shirt take to make?';\nconst REAL = '2,700 litres';\nconst FACT = 'Growing and irrigating the cotton is most of it. A polyester tee would use far less water, at the cost of more oil.';\nconst CAP = 'Water footprint of each answer, litres';\nconst SOURCE = 'Water Footprint Network, via Stacker (2020)';\nconst HREF = 'https://stacker.com/stories/environment/how-much-water-it-takes-create-30-common-items';\n\nfunction Tee() {\n  return (\n    <svg viewBox=\"0 0 200 130\" width=\"200\" height=\"130\">\n      <path d=\"M72 18 L44 34 L18 70 L44 88 L54 74 L54 116 H146 V74 L156 88 L182 70 L156 34 L128 18 Q114 34 100 34 Q86 34 72 18 Z\" fill={CREAM} />\n      <path d=\"M86 20 Q100 34 114 20\" fill=\"none\" stroke={INK} strokeWidth=\"7\" strokeLinecap=\"round\" />\n      <circle cx=\"76\" cy=\"70\" r=\"5\" fill={INK} /><circle cx=\"100\" cy=\"80\" r=\"5\" fill={INK} /><circle cx=\"124\" cy=\"70\" r=\"5\" fill={INK} />\n    </svg>\n  );\n}\n\nfunction QuizSlide() {\n  const [pick, setPick] = useState(null);\n  const [shown, setShown] = useState(false);\n  const [score, setScore] = useState(0);\n  useEffect(() => {\n    const ans = window.__quizAns || (window.__quizAns = []);\n    let s = 0;\n    ans.forEach((a) => { if (a === ANSWER) s += 1; });\n    if (ans[IDX] !== undefined) { setPick(ans[IDX]); setShown(true); }\n    setScore(s);\n  }, []);\n  const choose = (i) => {\n    if (pick !== null) return;\n    const ans = window.__quizAns || (window.__quizAns = []);\n    ans[IDX] = i;\n    let s = 0;\n    ans.forEach((a) => { if (a === ANSWER) s += 1; });\n    setPick(i); setScore(s);\n    setTimeout(() => setShown(true), 40);\n  };\n  const correct = pick === ANSWER;\n  return (\n    <Frame kicker=\"GUESS THE FOOTPRINT\" index={4} total={9} font=\"FiraGO, sans-serif\" style={{ backgroundColor: BG }} source={SOURCE} sourceHref={HREF}>\n      <div className=\"grid gap-8 h-full\" style={{ gridTemplateColumns: '1.15fr 1fr' }}>\n        <div className=\"flex flex-col gap-3\">\n          <div className=\"flex items-center justify-between\">\n            <span className=\"text-sm uppercase tracking-widest\" style={{ color: INK, opacity: 0.65 }}>Question {IDX} of 7</span>\n            <span className=\"text-sm font-bold px-4 py-1.5\" style={{ backgroundColor: INK, color: CREAM, borderRadius: '999px' }}>Score {score}/7</span>\n          </div>\n          <h2 className=\"text-3xl font-bold leading-tight\" style={{ color: INK }}>{Q}</h2>\n          <div className=\"flex flex-col gap-3\">\n            {OPTS.map((o, i) => {\n              const isCorrect = i === ANSWER;\n              let bg = CREAM, fg = INK, sh = '0 5px 0 rgba(42,33,96,0.3)';\n              if (shown && isCorrect) { bg = GOOD; fg = '#FFFFFF'; sh = '0 3px 0 rgba(0,0,0,0.25)'; }\n              else if (shown && i === pick && !correct) { bg = BAD; fg = '#FFFFFF'; sh = '0 3px 0 rgba(0,0,0,0.25)'; }\n              return (\n                <button key={i} onClick={() => choose(i)}\n                  className=\"flex items-center justify-between px-6 py-3 text-xl font-bold transition-all duration-200 hover:-translate-y-1\"\n                  style={{ backgroundColor: bg, color: fg, borderRadius: '14px', boxShadow: sh, textAlign: 'left', opacity: shown && !isCorrect && i !== pick ? 0.35 : 1, cursor: pick !== null ? 'default' : 'pointer' }}>\n                  <span>{o.label}</span>\n                  {shown && isCorrect && <span className=\"text-sm uppercase tracking-widest\">Correct</span>}\n                  {shown && i === pick && !correct && <span className=\"text-sm uppercase tracking-widest\">Nope</span>}\n                </button>\n              );\n            })}\n          </div>\n          <div className={'transition-all duration-500 ' + (shown ? 'opacity-100 scale-100' : 'opacity-0 scale-75')} style={{ transformOrigin: 'left center' }}>\n            <div className=\"flex items-baseline gap-4\">\n              <span className=\"text-5xl font-bold\" style={{ color: INK }}>{REAL}</span>\n              <span className=\"text-xl font-bold uppercase tracking-widest\" style={{ color: correct ? GOOD : BAD }}>{correct ? 'Nailed it!' : 'Not this time'}</span>\n            </div>\n            <p className=\"text-lg mt-2\" style={{ color: INK, opacity: 0.85, maxWidth: '560px' }}>{FACT}</p>\n          </div>\n        </div>\n        <div className=\"flex flex-col gap-3 min-h-0 items-center\">\n          <Tee />\n          <div className=\"flex-1 min-h-0 w-full flex flex-col justify-end\">\n            {pick === null ? (\n              <div className=\"w-full flex items-center justify-center px-6 py-10\" style={{ backgroundColor: '#FFFFFF', borderRadius: '18px' }}>\n                <p className=\"text-lg text-center\" style={{ color: INK, opacity: 0.55 }}>The comparison chart appears once you answer. No peeking.</p>\n              </div>\n            ) : (\n              <div className=\"w-full\" style={{ backgroundColor: '#FFFFFF', borderRadius: '18px', padding: '10px 12px' }}>\n                <BarChart data={OPTS} width=\"100%\" height={230} accent={INK}>\n                  <Grid />\n                  <XAxis dataKey=\"label\" />\n                  <YAxis />\n                  <Bar dataKey=\"value\">\n                    {OPTS.map((o, i) => <Cell key={i} fill={i === ANSWER ? GOOD : INK} />)}\n                  </Bar>\n                </BarChart>\n              </div>\n            )}\n            <p className=\"text-sm tracking-wide mt-2\" style={{ color: INK, opacity: 0.65 }}>{pick === null ? 'Water footprint of each answer, litres' : CAP}</p>\n          </div>\n        </div>\n      </div>\n    </Frame>\n  );\n}"},{"index":4,"title":"Question: jeans water footprint","code":"import { useState, useEffect } from 'react';\nimport { Frame } from 'deck';\nimport { BarChart, Bar, XAxis, YAxis, Grid, Cell } from 'charts';\nimport 'palette:Slate';\nimport 'font:FiraGO';\n\nconst IDX = 4, ANSWER = 3;\nconst BG = '#7C5CFF', INK = '#2A2160', CREAM = '#FFF7EC', GOOD = '#00B368', BAD = '#C1123A';\nconst OPTS = [\n  { label: '320 L', value: 320 },\n  { label: '1,200 L', value: 1200 },\n  { label: '5,000 L', value: 5000 },\n  { label: '12,760 L', value: 12760 },\n];\nconst Q = 'How much water goes into manufacturing one smartphone?';\nconst REAL = '12,760 litres';\nconst FACT = 'Every chip inside is rinsed dozens of times, and mining and refining the metals is thirsty work. A phone is essentially born from water.';\nconst CAP = 'Water footprint of each answer, litres';\nconst SOURCE = 'Water Footprint Network, via Stacker (2020)';\nconst HREF = 'https://stacker.com/stories/environment/how-much-water-it-takes-create-30-common-items';\n\nfunction Phone() {\n  return (\n    <svg viewBox=\"0 0 200 130\" width=\"200\" height=\"130\">\n      <rect x=\"70\" y=\"8\" width=\"60\" height=\"114\" rx=\"12\" fill={INK} />\n      <rect x=\"77\" y=\"20\" width=\"46\" height=\"88\" rx=\"5\" fill={CREAM} />\n      <rect x=\"90\" y=\"12\" width=\"20\" height=\"4\" rx=\"2\" fill={CREAM} />\n      <circle cx=\"100\" cy=\"115\" r=\"3\" fill={CREAM} />\n      <path d=\"M150 40 q18 25 0 50\" fill=\"none\" stroke={CREAM} strokeWidth=\"6\" strokeLinecap=\"round\" />\n      <path d=\"M163 30 q28 35 0 70\" fill=\"none\" stroke={CREAM} strokeWidth=\"6\" strokeLinecap=\"round\" opacity=\"0.6\" />\n      <circle cx=\"55\" cy=\"65\" r=\"5\" fill={CREAM} />\n    </svg>\n  );\n}\n\nfunction QuizSlide() {\n  const [pick, setPick] = useState(null);\n  const [shown, setShown] = useState(false);\n  const [score, setScore] = useState(0);\n  useEffect(() => {\n    const ans = window.__quizAns || (window.__quizAns = []);\n    let s = 0;\n    ans.forEach((a) => { if (a === ANSWER) s += 1; });\n    if (ans[IDX] !== undefined) { setPick(ans[IDX]); setShown(true); }\n    setScore(s);\n  }, []);\n  const choose = (i) => {\n    if (pick !== null) return;\n    const ans = window.__quizAns || (window.__quizAns = []);\n    ans[IDX] = i;\n    let s = 0;\n    ans.forEach((a) => { if (a === ANSWER) s += 1; });\n    setPick(i); setScore(s);\n    setTimeout(() => setShown(true), 40);\n  };\n  const correct = pick === ANSWER;\n  return (\n    <Frame kicker=\"GUESS THE FOOTPRINT\" index={5} total={9} font=\"FiraGO, sans-serif\" style={{ backgroundColor: BG }} source={SOURCE} sourceHref={HREF}>\n      <div className=\"grid gap-8 h-full\" style={{ gridTemplateColumns: '1.15fr 1fr' }}>\n        <div className=\"flex flex-col gap-3\">\n          <div className=\"flex items-center justify-between\">\n            <span className=\"text-sm uppercase tracking-widest\" style={{ color: INK, opacity: 0.65 }}>Question {IDX} of 7</span>\n            <span className=\"text-sm font-bold px-4 py-1.5\" style={{ backgroundColor: INK, color: CREAM, borderRadius: '999px' }}>Score {score}/7</span>\n          </div>\n          <h2 className=\"text-3xl font-bold leading-tight\" style={{ color: INK }}>{Q}</h2>\n          <div className=\"flex flex-col gap-3\">\n            {OPTS.map((o, i) => {\n              const isCorrect = i === ANSWER;\n              let bg = CREAM, fg = INK, sh = '0 5px 0 rgba(42,33,96,0.3)';\n              if (shown && isCorrect) { bg = GOOD; fg = '#FFFFFF'; sh = '0 3px 0 rgba(0,0,0,0.25)'; }\n              else if (shown && i === pick && !correct) { bg = BAD; fg = '#FFFFFF'; sh = '0 3px 0 rgba(0,0,0,0.25)'; }\n              return (\n                <button key={i} onClick={() => choose(i)}\n                  className=\"flex items-center justify-between px-6 py-3 text-xl font-bold transition-all duration-200 hover:-translate-y-1\"\n                  style={{ backgroundColor: bg, color: fg, borderRadius: '14px', boxShadow: sh, textAlign: 'left', opacity: shown && !isCorrect && i !== pick ? 0.35 : 1, cursor: pick !== null ? 'default' : 'pointer' }}>\n                  <span>{o.label}</span>\n                  {shown && isCorrect && <span className=\"text-sm uppercase tracking-widest\">Correct</span>}\n                  {shown && i === pick && !correct && <span className=\"text-sm uppercase tracking-widest\">Nope</span>}\n                </button>\n              );\n            })}\n          </div>\n          <div className={'transition-all duration-500 ' + (shown ? 'opacity-100 scale-100' : 'opacity-0 scale-75')} style={{ transformOrigin: 'left center' }}>\n            <div className=\"flex items-baseline gap-4\">\n              <span className=\"text-5xl font-bold\" style={{ color: INK }}>{REAL}</span>\n              <span className=\"text-xl font-bold uppercase tracking-widest\" style={{ color: correct ? GOOD : BAD }}>{correct ? 'Nailed it!' : 'Not this time'}</span>\n            </div>\n            <p className=\"text-lg mt-2\" style={{ color: INK, opacity: 0.85, maxWidth: '560px' }}>{FACT}</p>\n          </div>\n        </div>\n        <div className=\"flex flex-col gap-3 min-h-0 items-center\">\n          <Phone />\n          <div className=\"flex-1 min-h-0 w-full flex flex-col justify-end\">\n            {pick === null ? (\n              <div className=\"w-full flex items-center justify-center px-6 py-10\" style={{ backgroundColor: '#FFFFFF', borderRadius: '18px' }}>\n                <p className=\"text-lg text-center\" style={{ color: INK, opacity: 0.55 }}>The comparison chart appears once you answer. No peeking.</p>\n              </div>\n            ) : (\n              <div className=\"w-full\" style={{ backgroundColor: '#FFFFFF', borderRadius: '18px', padding: '10px 12px' }}>\n                <BarChart data={OPTS} width=\"100%\" height={230} accent={INK}>\n                  <Grid />\n                  <XAxis dataKey=\"label\" />\n                  <YAxis />\n                  <Bar dataKey=\"value\">\n                    {OPTS.map((o, i) => <Cell key={i} fill={i === ANSWER ? GOOD : INK} />)}\n                  </Bar>\n                </BarChart>\n              </div>\n            )}\n            <p className=\"text-sm tracking-wide mt-2\" style={{ color: INK, opacity: 0.65 }}>{pick === null ? 'Water footprint of each answer, litres' : CAP}</p>\n          </div>\n        </div>\n      </div>\n    </Frame>\n  );\n}"},{"index":5,"title":"Question: streaming carbon footprint","code":"import { useState, useEffect } from 'react';\nimport { Frame } from 'deck';\nimport { BarChart, Bar, XAxis, YAxis, Grid, Cell } from 'charts';\nimport 'palette:Slate';\nimport 'font:FiraGO';\n\nconst IDX = 5, ANSWER = 2;\nconst BG = '#2E86FF', INK = '#2A2160', CREAM = '#FFF7EC', GOOD = '#00B368', BAD = '#C1123A';\nconst OPTS = [\n  { label: '750 L', value: 750 },\n  { label: '2,000 L', value: 2000 },\n  { label: '7,500 L', value: 7500 },\n  { label: '15,000 L', value: 15000 },\n];\nconst Q = 'How much water does it take to make a pair of jeans?';\nconst REAL = '7,500 litres';\nconst FACT = 'It is the cotton again: irrigation, dyeing and finishing. Levi\\u2019s own study puts one pair at 3,781 litres; the full supply-chain figures run higher.';\nconst CAP = 'Water footprint of each answer, litres';\nconst SOURCE = 'Water Footprint Network / Levi Strauss & Co.';\nconst HREF = 'https://www.watercalculator.org/footprint/what-is-the-water-footprint-of/';\n\nfunction Jeans() {\n  return (\n    <svg viewBox=\"0 0 200 130\" width=\"200\" height=\"130\">\n      <rect x=\"62\" y=\"10\" width=\"76\" height=\"20\" rx=\"5\" fill={CREAM} />\n      <circle cx=\"118\" cy=\"20\" r=\"4\" fill={INK} />\n      <path d=\"M62 30 L56 118 H88 L99 52 L110 118 H142 L138 30 Z\" fill={CREAM} />\n      <path d=\"M99 52 L100 45 L101 52 L110 112\" fill=\"none\" stroke={INK} strokeWidth=\"5\" />\n      <path d=\"M70 40 V70 M84 40 V78 M116 40 V70 M128 40 V78\" stroke={INK} strokeWidth=\"3\" opacity=\"0.35\" />\n    </svg>\n  );\n}\n\nfunction QuizSlide() {\n  const [pick, setPick] = useState(null);\n  const [shown, setShown] = useState(false);\n  const [score, setScore] = useState(0);\n  useEffect(() => {\n    const ans = window.__quizAns || (window.__quizAns = []);\n    let s = 0;\n    ans.forEach((a) => { if (a === ANSWER) s += 1; });\n    if (ans[IDX] !== undefined) { setPick(ans[IDX]); setShown(true); }\n    setScore(s);\n  }, []);\n  const choose = (i) => {\n    if (pick !== null) return;\n    const ans = window.__quizAns || (window.__quizAns = []);\n    ans[IDX] = i;\n    let s = 0;\n    ans.forEach((a) => { if (a === ANSWER) s += 1; });\n    setPick(i); setScore(s);\n    setTimeout(() => setShown(true), 40);\n  };\n  const correct = pick === ANSWER;\n  return (\n    <Frame kicker=\"GUESS THE FOOTPRINT\" index={6} total={9} font=\"FiraGO, sans-serif\" style={{ backgroundColor: BG }} source={SOURCE} sourceHref={HREF}>\n      <div className=\"grid gap-8 h-full\" style={{ gridTemplateColumns: '1.15fr 1fr' }}>\n        <div className=\"flex flex-col gap-3\">\n          <div className=\"flex items-center justify-between\">\n            <span className=\"text-sm uppercase tracking-widest\" style={{ color: INK, opacity: 0.65 }}>Question {IDX} of 7</span>\n            <span className=\"text-sm font-bold px-4 py-1.5\" style={{ backgroundColor: INK, color: CREAM, borderRadius: '999px' }}>Score {score}/7</span>\n          </div>\n          <h2 className=\"text-3xl font-bold leading-tight\" style={{ color: INK }}>{Q}</h2>\n          <div className=\"flex flex-col gap-3\">\n            {OPTS.map((o, i) => {\n              const isCorrect = i === ANSWER;\n              let bg = CREAM, fg = INK, sh = '0 5px 0 rgba(42,33,96,0.3)';\n              if (shown && isCorrect) { bg = GOOD; fg = '#FFFFFF'; sh = '0 3px 0 rgba(0,0,0,0.25)'; }\n              else if (shown && i === pick && !correct) { bg = BAD; fg = '#FFFFFF'; sh = '0 3px 0 rgba(0,0,0,0.25)'; }\n              return (\n                <button key={i} onClick={() => choose(i)}\n                  className=\"flex items-center justify-between px-6 py-3 text-xl font-bold transition-all duration-200 hover:-translate-y-1\"\n                  style={{ backgroundColor: bg, color: fg, borderRadius: '14px', boxShadow: sh, textAlign: 'left', opacity: shown && !isCorrect && i !== pick ? 0.35 : 1, cursor: pick !== null ? 'default' : 'pointer' }}>\n                  <span>{o.label}</span>\n                  {shown && isCorrect && <span className=\"text-sm uppercase tracking-widest\">Correct</span>}\n                  {shown && i === pick && !correct && <span className=\"text-sm uppercase tracking-widest\">Nope</span>}\n                </button>\n              );\n            })}\n          </div>\n          <div className={'transition-all duration-500 ' + (shown ? 'opacity-100 scale-100' : 'opacity-0 scale-75')} style={{ transformOrigin: 'left center' }}>\n            <div className=\"flex items-baseline gap-4\">\n              <span className=\"text-5xl font-bold\" style={{ color: INK }}>{REAL}</span>\n              <span className=\"text-xl font-bold uppercase tracking-widest\" style={{ color: correct ? GOOD : BAD }}>{correct ? 'Nailed it!' : 'Not this time'}</span>\n            </div>\n            <p className=\"text-lg mt-2\" style={{ color: INK, opacity: 0.85, maxWidth: '560px' }}>{FACT}</p>\n          </div>\n        </div>\n        <div className=\"flex flex-col gap-3 min-h-0 items-center\">\n          <Jeans />\n          <div className=\"flex-1 min-h-0 w-full flex flex-col justify-end\">\n            {pick === null ? (\n              <div className=\"w-full flex items-center justify-center px-6 py-10\" style={{ backgroundColor: '#FFFFFF', borderRadius: '18px' }}>\n                <p className=\"text-lg text-center\" style={{ color: INK, opacity: 0.55 }}>The comparison chart appears once you answer. No peeking.</p>\n              </div>\n            ) : (\n              <div className=\"w-full\" style={{ backgroundColor: '#FFFFFF', borderRadius: '18px', padding: '10px 12px' }}>\n                <BarChart data={OPTS} width=\"100%\" height={230} accent={INK}>\n                  <Grid />\n                  <XAxis dataKey=\"label\" />\n                  <YAxis />\n                  <Bar dataKey=\"value\">\n                    {OPTS.map((o, i) => <Cell key={i} fill={i === ANSWER ? GOOD : INK} />)}\n                  </Bar>\n                </BarChart>\n              </div>\n            )}\n            <p className=\"text-sm tracking-wide mt-2\" style={{ color: INK, opacity: 0.65 }}>{pick === null ? 'Water footprint of each answer, litres' : CAP}</p>\n          </div>\n        </div>\n      </div>\n    </Frame>\n  );\n}"},{"index":6,"code":"import { useState, useEffect } from 'react';\nimport { Frame } from 'deck';\nimport { BarChart, Bar, XAxis, YAxis, Grid, Cell } from 'charts';\nimport 'palette:Slate';\nimport 'font:FiraGO';\n\nconst IDX = 6, ANSWER = 1;\nconst BG = '#F63E9C', INK = '#2A2160', CREAM = '#FFF7EC', GOOD = '#00B368', BAD = '#C1123A';\nconst OPTS = [\n  { label: '5 g', value: 5 },\n  { label: '55 g', value: 55 },\n  { label: '550 g', value: 550 },\n  { label: '5 kg', value: 5000 },\n];\nconst Q = 'What is the carbon footprint of one hour of streaming in Europe?';\nconst REAL = '55 g CO\\u2082e';\nconst FACT = 'That is roughly three kettle boils. Your screen, not the video quality, is the biggest part of it. Dropping HD to SD barely moves the number.';\nconst CAP = 'Emissions of each answer, grams CO\\u2082e per hour';\nconst SOURCE = 'Carbon Trust / DIMPACT, Carbon impact of video streaming (2021)';\nconst HREF = 'https://www.carbontrust.com/our-work-and-impact/guides-reports-and-tools/carbon-impact-of-video-streaming';\n\nfunction Play() {\n  return (\n    <svg viewBox=\"0 0 200 130\" width=\"200\" height=\"130\">\n      <circle cx=\"100\" cy=\"65\" r=\"56\" fill={INK} />\n      <path d=\"M85 40 L132 65 L85 90 Z\" fill={CREAM} />\n      <path d=\"M166 38 q14 27 0 54\" fill=\"none\" stroke={INK} strokeWidth=\"6\" strokeLinecap=\"round\" opacity=\"0.5\" />\n      <circle cx=\"30\" cy=\"30\" r=\"5\" fill={INK} opacity=\"0.5\" />\n      <circle cx=\"45\" cy=\"105\" r=\"4\" fill={INK} opacity=\"0.5\" />\n    </svg>\n  );\n}\n\nfunction QuizSlide() {\n  const [pick, setPick] = useState(null);\n  const [shown, setShown] = useState(false);\n  const [score, setScore] = useState(0);\n  useEffect(() => {\n    const ans = window.__quizAns || (window.__quizAns = []);\n    let s = 0;\n    ans.forEach((a) => { if (a === ANSWER) s += 1; });\n    if (ans[IDX] !== undefined) { setPick(ans[IDX]); setShown(true); }\n    setScore(s);\n  }, []);\n  const choose = (i) => {\n    if (pick !== null) return;\n    const ans = window.__quizAns || (window.__quizAns = []);\n    ans[IDX] = i;\n    let s = 0;\n    ans.forEach((a) => { if (a === ANSWER) s += 1; });\n    setPick(i); setScore(s);\n    setTimeout(() => setShown(true), 40);\n  };\n  const correct = pick === ANSWER;\n  return (\n    <Frame kicker=\"GUESS THE FOOTPRINT\" index={7} total={9} font=\"FiraGO, sans-serif\" style={{ backgroundColor: BG }} source={SOURCE} sourceHref={HREF}>\n      <div className=\"grid gap-8 h-full\" style={{ gridTemplateColumns: '1.15fr 1fr' }}>\n        <div className=\"flex flex-col gap-3\">\n          <div className=\"flex items-center justify-between\">\n            <span className=\"text-sm uppercase tracking-widest\" style={{ color: INK, opacity: 0.65 }}>Question {IDX} of 7</span>\n            <span className=\"text-sm font-bold px-4 py-1.5\" style={{ backgroundColor: INK, color: CREAM, borderRadius: '999px' }}>Score {score}/7</span>\n          </div>\n          <h2 className=\"text-3xl font-bold leading-tight\" style={{ color: INK }}>{Q}</h2>\n          <div className=\"flex flex-col gap-3\">\n            {OPTS.map((o, i) => {\n              const isCorrect = i === ANSWER;\n              let bg = CREAM, fg = INK, sh = '0 5px 0 rgba(42,33,96,0.3)';\n              if (shown && isCorrect) { bg = GOOD; fg = '#FFFFFF'; sh = '0 3px 0 rgba(0,0,0,0.25)'; }\n              else if (shown && i === pick && !correct) { bg = BAD; fg = '#FFFFFF'; sh = '0 3px 0 rgba(0,0,0,0.25)'; }\n              return (\n                <button key={i} onClick={() => choose(i)}\n                  className=\"flex items-center justify-between px-6 py-3 text-xl font-bold transition-all duration-200 hover:-translate-y-1\"\n                  style={{ backgroundColor: bg, color: fg, borderRadius: '14px', boxShadow: sh, textAlign: 'left', opacity: shown && !isCorrect && i !== pick ? 0.35 : 1, cursor: pick !== null ? 'default' : 'pointer' }}>\n                  <span>{o.label}</span>\n                  {shown && isCorrect && <span className=\"text-sm uppercase tracking-widest\">Correct</span>}\n                  {shown && i === pick && !correct && <span className=\"text-sm uppercase tracking-widest\">Nope</span>}\n                </button>\n              );\n            })}\n          </div>\n          <div className={'transition-all duration-500 ' + (shown ? 'opacity-100 scale-100' : 'opacity-0 scale-75')} style={{ transformOrigin: 'left center' }}>\n            <div className=\"flex items-baseline gap-4\">\n              <span className=\"text-5xl font-bold\" style={{ color: INK }}>{REAL}</span>\n              <span className=\"text-xl font-bold uppercase tracking-widest\" style={{ color: correct ? GOOD : BAD }}>{correct ? 'Nailed it!' : 'Not this time'}</span>\n            </div>\n            <p className=\"text-lg mt-2\" style={{ color: INK, opacity: 0.85, maxWidth: '560px' }}>{FACT}</p>\n          </div>\n        </div>\n        <div className=\"flex flex-col gap-3 min-h-0 items-center\">\n          <Play />\n          <div className=\"flex-1 min-h-0 w-full flex flex-col justify-end\">\n            {pick === null ? (\n              <div className=\"w-full flex items-center justify-center px-6 py-10\" style={{ backgroundColor: '#FFFFFF', borderRadius: '18px' }}>\n                <p className=\"text-lg text-center\" style={{ color: INK, opacity: 0.55 }}>The comparison chart appears once you answer. No peeking.</p>\n              </div>\n            ) : (\n              <div className=\"w-full\" style={{ backgroundColor: '#FFFFFF', borderRadius: '18px', padding: '10px 12px' }}>\n                <BarChart data={OPTS} width=\"100%\" height={230} accent={INK}>\n                  <Grid />\n                  <XAxis dataKey=\"label\" />\n                  <YAxis />\n                  <Bar dataKey=\"value\">\n                    {OPTS.map((o, i) => <Cell key={i} fill={i === ANSWER ? GOOD : INK} />)}\n                  </Bar>\n                </BarChart>\n              </div>\n            )}\n            <p className=\"text-sm tracking-wide mt-2\" style={{ color: INK, opacity: 0.65 }}>{pick === null ? 'Emissions of each answer, grams CO\\u2082e per hour' : CAP}</p>\n          </div>\n        </div>\n      </div>\n    </Frame>\n  );\n}"},{"index":7,"title":"Question: flight London to New York carbon","code":"import { useState, useEffect } from 'react';\nimport { Frame } from 'deck';\nimport { BarChart, Bar, XAxis, YAxis, Grid, Cell } from 'charts';\nimport 'palette:Slate';\nimport 'font:FiraGO';\n\nconst IDX = 7, ANSWER = 1;\nconst BG = '#00C2A8', INK = '#2A2160', CREAM = '#FFF7EC', GOOD = '#00B368', BAD = '#C1123A';\nconst OPTS = [\n  { label: '65 kg', value: 65 },\n  { label: '648 kg', value: 648 },\n  { label: '1,300 kg', value: 1300 },\n  { label: '2,500 kg', value: 2500 },\n];\nconst Q = 'One economy seat, London to New York, one way. How much CO\\u2082e?';\nconst REAL = '648 kg CO\\u2082e';\nconst FACT = 'One passenger, one way, economy, using UK government 2026 factors including the extra warming that happens at altitude. A return trip is about 1.3 tonnes.';\nconst CAP = 'Emissions of each answer, kg CO\\u2082e per passenger';\nconst SOURCE = 'UK DESNZ greenhouse gas conversion factors 2026';\nconst HREF = 'https://www.gov.uk/government/collections/government-conversion-factors-for-company-reporting';\n\nfunction Plane() {\n  return (\n    <svg viewBox=\"0 0 200 130\" width=\"200\" height=\"130\">\n      <path d=\"M14 74 L188 30 L104 82 L100 112 L74 86 L46 96 Z\" fill={CREAM} />\n      <path d=\"M188 30 L104 82 L74 86 Z\" fill={INK} />\n      <path d=\"M6 108 q12 -6 24 0 q12 6 24 0\" fill=\"none\" stroke={INK} strokeWidth=\"4\" strokeLinecap=\"round\" opacity=\"0.4\" />\n    </svg>\n  );\n}\n\nfunction QuizSlide() {\n  const [pick, setPick] = useState(null);\n  const [shown, setShown] = useState(false);\n  const [score, setScore] = useState(0);\n  useEffect(() => {\n    const ans = window.__quizAns || (window.__quizAns = []);\n    let s = 0;\n    ans.forEach((a) => { if (a === ANSWER) s += 1; });\n    if (ans[IDX] !== undefined) { setPick(ans[IDX]); setShown(true); }\n    setScore(s);\n  }, []);\n  const choose = (i) => {\n    if (pick !== null) return;\n    const ans = window.__quizAns || (window.__quizAns = []);\n    ans[IDX] = i;\n    let s = 0;\n    ans.forEach((a) => { if (a === ANSWER) s += 1; });\n    setPick(i); setScore(s);\n    setTimeout(() => setShown(true), 40);\n  };\n  const correct = pick === ANSWER;\n  return (\n    <Frame kicker=\"GUESS THE FOOTPRINT\" index={8} total={9} font=\"FiraGO, sans-serif\" style={{ backgroundColor: BG }} source={SOURCE} sourceHref={HREF}>\n      <div className=\"grid gap-8 h-full\" style={{ gridTemplateColumns: '1.15fr 1fr' }}>\n        <div className=\"flex flex-col gap-3\">\n          <div className=\"flex items-center justify-between\">\n            <span className=\"text-sm uppercase tracking-widest\" style={{ color: INK, opacity: 0.65 }}>Question {IDX} of 7</span>\n            <span className=\"text-sm font-bold px-4 py-1.5\" style={{ backgroundColor: INK, color: CREAM, borderRadius: '999px' }}>Score {score}/7</span>\n          </div>\n          <h2 className=\"text-3xl font-bold leading-tight\" style={{ color: INK }}>{Q}</h2>\n          <div className=\"flex flex-col gap-3\">\n            {OPTS.map((o, i) => {\n              const isCorrect = i === ANSWER;\n              let bg = CREAM, fg = INK, sh = '0 5px 0 rgba(42,33,96,0.3)';\n              if (shown && isCorrect) { bg = GOOD; fg = '#FFFFFF'; sh = '0 3px 0 rgba(0,0,0,0.25)'; }\n              else if (shown && i === pick && !correct) { bg = BAD; fg = '#FFFFFF'; sh = '0 3px 0 rgba(0,0,0,0.25)'; }\n              return (\n                <button key={i} onClick={() => choose(i)}\n                  className=\"flex items-center justify-between px-6 py-3 text-xl font-bold transition-all duration-200 hover:-translate-y-1\"\n                  style={{ backgroundColor: bg, color: fg, borderRadius: '14px', boxShadow: sh, textAlign: 'left', opacity: shown && !isCorrect && i !== pick ? 0.35 : 1, cursor: pick !== null ? 'default' : 'pointer' }}>\n                  <span>{o.label}</span>\n                  {shown && isCorrect && <span className=\"text-sm uppercase tracking-widest\">Correct</span>}\n                  {shown && i === pick && !correct && <span className=\"text-sm uppercase tracking-widest\">Nope</span>}\n                </button>\n              );\n            })}\n          </div>\n          <div className={'transition-all duration-500 ' + (shown ? 'opacity-100 scale-100' : 'opacity-0 scale-75')} style={{ transformOrigin: 'left center' }}>\n            <div className=\"flex items-baseline gap-4\">\n              <span className=\"text-5xl font-bold\" style={{ color: INK }}>{REAL}</span>\n              <span className=\"text-xl font-bold uppercase tracking-widest\" style={{ color: correct ? GOOD : BAD }}>{correct ? 'Nailed it!' : 'Not this time'}</span>\n            </div>\n            <p className=\"text-lg mt-2\" style={{ color: INK, opacity: 0.85, maxWidth: '560px' }}>{FACT}</p>\n          </div>\n        </div>\n        <div className=\"flex flex-col gap-3 min-h-0 items-center\">\n          <Plane />\n          <div className=\"flex-1 min-h-0 w-full flex flex-col justify-end\">\n            {pick === null ? (\n              <div className=\"w-full flex items-center justify-center px-6 py-10\" style={{ backgroundColor: '#FFFFFF', borderRadius: '18px' }}>\n                <p className=\"text-lg text-center\" style={{ color: INK, opacity: 0.55 }}>The comparison chart appears once you answer. No peeking.</p>\n              </div>\n            ) : (\n              <div className=\"w-full\" style={{ backgroundColor: '#FFFFFF', borderRadius: '18px', padding: '10px 12px' }}>\n                <BarChart data={OPTS} width=\"100%\" height={230} accent={INK}>\n                  <Grid />\n                  <XAxis dataKey=\"label\" />\n                  <YAxis />\n                  <Bar dataKey=\"value\">\n                    {OPTS.map((o, i) => <Cell key={i} fill={i === ANSWER ? GOOD : INK} />)}\n                  </Bar>\n                </BarChart>\n              </div>\n            )}\n            <p className=\"text-sm tracking-wide mt-2\" style={{ color: INK, opacity: 0.65 }}>{pick === null ? 'Emissions of each answer, kg CO\\u2082e per passenger' : CAP}</p>\n          </div>\n        </div>\n      </div>\n    </Frame>\n  );\n}"},{"index":8,"title":"Results: score and full ranking","code":"import { useState, useEffect } from 'react';\nimport { Frame } from 'deck';\nimport { BarChart, Bar, XAxis, YAxis, Grid, Cell } from 'charts';\nimport 'palette:Slate';\nimport 'font:FiraGO';\n\nconst INK = '#2A2160', CREAM = '#FFF7EC', GOOD = '#00B368';\nconst WATER = [\n  { label: 'Phone', value: 12760 },\n  { label: 'Jeans', value: 7500 },\n  { label: 'T-shirt', value: 2700 },\n  { label: 'Burger', value: 2500 },\n  { label: 'Coffee', value: 132 },\n];\nconst CARBON = [\n  { label: 'Flight (one-way)', value: 648 },\n  { label: 'Streaming 1 hr', value: 0.055 },\n];\n\nfunction ResultsSlide() {\n  const [ans, setAns] = useState([]);\n  useEffect(() => {\n    setAns(window.__quizAns || []);\n  }, []);\n  const KEY = [2, 2, 2, 3, 2, 1, 1];\n  const score = KEY.filter((k, i) => ans[i + 1] === k).length;\n  const verdict =\n    score === 7 ? 'Certified footprint oracle.' :\n    score >= 5 ? 'You can smell hidden water from a mile away.' :\n    score >= 3 ? 'Half oracle, half optimist.' :\n    'The footprints remain suspiciously well hidden.';\n  return (\n    <Frame kicker=\"GUESS THE FOOTPRINT\" index={9} total={9} font=\"FiraGO, sans-serif\" style={{ backgroundColor: INK }} source=\"Water Footprint Network · Water Footprint Calculator · Carbon Trust (2021) · UK DESNZ 2026\">\n      <div className=\"flex flex-col gap-5 h-full\">\n        <div className=\"flex items-end justify-between gap-8\">\n          <div className=\"flex items-baseline gap-6\">\n            <span className=\"font-bold leading-none\" style={{ color: '#FFD23F', fontSize: '110px', letterSpacing: '-3px' }}>{score}<span style={{ color: CREAM, fontSize: '56px' }}>/7</span></span>\n            <div className=\"pb-3\">\n              <p className=\"text-3xl font-bold\" style={{ color: CREAM }}>{verdict}</p>\n              <p className=\"text-lg mt-1\" style={{ color: CREAM, opacity: 0.7 }}>\n                The phone wins the water prize. On carbon, one flight seat beats roughly 12,000 hours of streaming.\n              </p>\n            </div>\n          </div>\n          <button\n            onClick={() => { window.__quizAns = []; setAns([]); }}\n            className=\"text-base font-bold px-5 py-3 transition-all duration-200 hover:-translate-y-1 whitespace-nowrap\"\n            style={{ backgroundColor: '#F63E9C', color: '#FFFFFF', borderRadius: '14px', boxShadow: '0 4px 0 rgba(0,0,0,0.35)' }}>\n            Play again\n          </button>\n        </div>\n        <div className=\"grid gap-8 flex-1 min-h-0\" style={{ gridTemplateColumns: '1.4fr 1fr' }}>\n          <div className=\"flex flex-col min-h-0\">\n            <div className=\"flex-1 min-h-0\" style={{ backgroundColor: '#FFFFFF', borderRadius: '18px', padding: '10px 12px' }}>\n              <BarChart data={WATER} width=\"100%\" height={270} accent={INK}>\n                <Grid />\n                <XAxis dataKey=\"label\" />\n                <YAxis />\n                <Bar dataKey=\"value\">\n                  {WATER.map((o, i) => <Cell key={i} fill={i === 0 ? GOOD : INK} />)}\n                </Bar>\n              </BarChart>\n            </div>\n            <p className=\"text-sm tracking-wide mt-2\" style={{ color: CREAM, opacity: 0.65 }}>Hidden water, litres. Green bar = the biggest surprise.</p>\n          </div>\n          <div className=\"flex flex-col min-h-0\">\n            <div className=\"flex-1 min-h-0\" style={{ backgroundColor: '#FFFFFF', borderRadius: '18px', padding: '10px 12px' }}>\n              <BarChart data={CARBON} width=\"100%\" height={270} accent=\"#FF5A5F\">\n                <Grid />\n                <XAxis dataKey=\"label\" />\n                <YAxis />\n                <Bar dataKey=\"value\">\n                  <Cell fill=\"#FF5A5F\" />\n                  <Cell fill={INK} />\n                </Bar>\n              </BarChart>\n            </div>\n            <p className=\"text-sm tracking-wide mt-2\" style={{ color: CREAM, opacity: 0.65 }}>Hidden carbon, kg CO₂e per person. Streaming barely registers.</p>\n          </div>\n        </div>\n      </div>\n    </Frame>\n  );\n}"},{"index":9,"title":"About: made in Niori","code":"import { Frame } from 'deck';\nimport 'palette:Slate';\nimport 'font:FiraGO';\n\nconst INK = '#2A2160';\nconst CREAM = '#FFF7EC';\n\nfunction AboutSlide() {\n  return (\n    <Frame index={10} total={10} font=\"FiraGO, sans-serif\" style={{ backgroundColor: '#FFD23F' }}>\n      <div className=\"grid gap-10 h-full items-center\" style={{ gridTemplateColumns: '1.3fr 1fr' }}>\n        <div className=\"flex flex-col gap-6\">\n          <div className=\"text-sm uppercase tracking-widest\" style={{ color: INK, opacity: 0.7 }}>About this quiz</div>\n          <h1 className=\"text-6xl font-bold leading-tight\" style={{ color: INK, letterSpacing: '-1px' }}>\n            This quiz was made in <span style={{ color: '#FFFFFF' }}>Niori</span>\n          </h1>\n          <p className=\"text-2xl leading-relaxed\" style={{ color: INK, maxWidth: '620px' }}>\n            The questions, drawings, charts and scoring all came from a short brief and one round of feedback in Niori's chat. The figures are real and sourced on each slide.\n          </p>\n          <div>\n            <a href=\"https://www.niori.app\" target=\"_blank\" rel=\"noopener noreferrer\"\n              className=\"inline-block text-xl font-bold px-8 py-5 transition-all duration-200 hover:-translate-y-1\"\n              style={{ backgroundColor: INK, color: '#FFD23F', borderRadius: '18px', boxShadow: '0 6px 0 rgba(42,33,96,0.35)' }}>\n              Make your own at niori.app →\n            </a>\n          </div>\n        </div>\n        <div className=\"flex items-center justify-center\">\n          <img src=\"https://www.niori.app/logo-icon.svg\" alt=\"Niori logo\" loading=\"lazy\" style={{ width: '320px', height: '320px' }} />\n        </div>\n      </div>\n    </Frame>\n  );\n}"}]}