:root {
  color-scheme: light;
  --ink: #183044;
  --muted: #637484;
  --paper: #f7f8f2;
  --white: #fff;
  --line: #dbe2dc;
  --green: #2d8a59;
  --green-dark: #17613b;
  --blue: #238cc0;
  --blue-dark: #175d82;
  --orange: #ed7b35;
  --orange-dark: #a84a22;
  --yellow: #ffd45a;
  font-family: "Avenir Next", "Trebuchet MS", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; min-width: 1000px; min-height: 700px; overflow: hidden; }
body { margin: 0; color: var(--ink); background: var(--paper); }
button { color: inherit; font: inherit; cursor: pointer; }
:focus-visible { outline: 4px solid #0067b1; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.lesson { width: 100%; height: 100%; display: grid; grid-template-rows: minmax(480px, 1fr) 184px; gap: 13px; padding: 14px 18px 16px; }
.lab { position: relative; min-height: 0; overflow: hidden; border: 1px solid #bdd6ce; border-radius: 22px; background: #dff1ec; box-shadow: 0 7px 0 #bed8d0, 0 18px 35px rgba(39,83,68,.1); isolation: isolate; }
.lab::before { position: absolute; inset: 0; z-index: -1; content: ""; background: radial-gradient(circle at 16% 20%, rgba(255,255,255,.6) 0 2px, transparent 3px), linear-gradient(180deg, rgba(255,255,255,.56), transparent 42%); background-size: 42px 42px, auto; }
.lab-tools { position: absolute; z-index: 12; left: 18px; right: 18px; top: 15px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; pointer-events: none; }
.level-label span { display: block; color: var(--green-dark); font-size: 10px; font-weight: 950; letter-spacing: .1em; text-transform: uppercase; }
.level-label strong { display: block; margin-top: 2px; font-size: 18px; }
.evidence-pill { min-height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid rgba(29,91,75,.18); border-radius: 999px; background: rgba(255,255,255,.84); color: #315e56; font-size: 12px; font-weight: 850; }
.evidence-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(45,138,89,.13); }
.mute-button { justify-self: end; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid #cbd9d4; border-radius: 50%; background: white; box-shadow: 0 3px 0 #b7ccc5; pointer-events: auto; transition: transform 150ms ease-out, box-shadow 150ms ease-out; }
.mute-button:hover { transform: translateY(-2px); box-shadow: 0 5px 0 #b7ccc5; }
.mute-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sound-off { display: none; }
.mute-button[aria-pressed="true"] .sound-on { display: none; }
.mute-button[aria-pressed="true"] .sound-off { display: block; }

#particleCanvas { width: 100%; height: 100%; display: block; }
.temperature-card { position: absolute; z-index: 8; left: 20px; bottom: 20px; width: 176px; padding: 12px 14px; border: 1px solid rgba(34,80,68,.2); border-radius: 13px; background: rgba(255,255,255,.9); box-shadow: 0 5px 0 rgba(48,93,80,.12); }
.temperature-card span { display: block; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.temperature-card strong { display: block; margin-top: 5px; font-size: 17px; }
.temperature-track { height: 9px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: #dce8e8; }
.temperature-track i { display: block; width: 30%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #38aadc, #ffd14d, #ed683b); transition: width 500ms ease-out; }
.speed-key { position: absolute; z-index: 8; right: 20px; bottom: 20px; display: flex; align-items: center; gap: 16px; padding: 10px 13px; border: 1px solid rgba(34,80,68,.16); border-radius: 12px; background: rgba(255,255,255,.86); color: #49656b; font-size: 11px; font-weight: 850; }
.speed-key span { display: flex; align-items: center; gap: 6px; }
.speed-key i { display: block; height: 4px; border-radius: 3px; background: var(--blue); }
.speed-key .short { width: 15px; }
.speed-key .long { width: 38px; }
.comparison-labels { position: absolute; z-index: 8; left: 12%; right: 12%; top: 88px; display: grid; grid-template-columns: 1fr 1fr; gap: 14%; text-align: center; }
.comparison-labels span { justify-self: center; padding: 7px 14px; border-radius: 999px; color: white; background: var(--ink); font-size: 11px; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; }

.level-intro, .finale { position: absolute; z-index: 30; left: 50%; top: 50%; width: min(520px, calc(100% - 48px)); min-height: 340px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 48px; transform: translate(-50%,-50%); border: 1px solid #d6e2dc; border-radius: 22px; background: rgba(255,255,255,.97); box-shadow: 0 15px 0 rgba(50,96,81,.11), 0 32px 65px rgba(41,78,66,.2); text-align: center; }
.level-intro > span, .finale > span { color: var(--green-dark); font-size: 11px; font-weight: 950; letter-spacing: .11em; text-transform: uppercase; }
.intro-icon { width: 70px; height: 70px; display: grid; place-items: center; margin: 12px 0; transform: rotate(-4deg); border: 3px solid var(--ink); border-radius: 18px; background: var(--yellow); box-shadow: 5px 5px 0 var(--ink); font-size: 34px; font-weight: 950; }
.level-intro h1, .finale h1 { margin: 0 0 9px; font-size: 39px; line-height: 1; letter-spacing: -.04em; }
.level-intro p, .finale p { max-width: 410px; margin: 0 0 22px; color: #536878; font-size: 15px; line-height: 1.45; }
.level-intro button, .finale button, .primary-button { min-width: 218px; min-height: 52px; padding: 0 22px; border: 2px solid var(--green-dark); border-radius: 12px; color: white; background: var(--green); box-shadow: 0 6px 0 var(--green-dark); font-weight: 950; transition: transform 150ms ease-out, box-shadow 150ms ease-out; }
.level-intro button:hover, .finale button:hover, .primary-button:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--green-dark); }
.level-intro button:active, .finale button:active, .primary-button:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--green-dark); }
.finale { min-height: 390px; border-color: #e6c24e; background: #fffdf2; }
.finale h1 { margin-top: 96px; font-size: 43px; }
.finale-orbit { position: absolute; top: 27px; width: 108px; height: 108px; border: 3px dashed #dda928; border-radius: 50%; animation: orbit 7s linear infinite; }
.finale-orbit::after { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; content: "✓"; display: grid; place-items: center; transform: translate(-50%,-50%); border: 3px solid var(--ink); border-radius: 50%; color: var(--ink); background: var(--yellow); font-size: 27px; font-weight: 1000; }
.finale-orbit i { position: absolute; width: 17px; height: 17px; border: 3px solid white; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 2px var(--ink); }
.finale-orbit i:nth-child(1) { left: -4px; top: 40px; }.finale-orbit i:nth-child(2) { right: 4px; top: 4px; background: var(--orange); }.finale-orbit i:nth-child(3) { right: 10px; bottom: 3px; background: var(--green); }
.callout { position: absolute; z-index: 18; left: 50%; bottom: 22px; max-width: 76%; padding: 10px 18px; opacity: 0; transform: translate(-50%,12px); border-radius: 999px; color: white; background: var(--ink); box-shadow: 0 5px 0 rgba(24,48,68,.18); pointer-events: none; font-size: 13px; font-weight: 900; transition: opacity 160ms ease-out, transform 160ms ease-out; }
.callout.show { opacity: 1; transform: translate(-50%,0); }

.decision-card { display: grid; grid-template-columns: minmax(250px,.72fr) minmax(0,1.65fr); align-items: center; gap: 30px; padding: 18px 22px 18px 26px; border: 1px solid var(--line); border-radius: 17px; background: white; box-shadow: 0 5px 0 #e0e6e1; }
.decision-copy > span { display: block; margin-bottom: 5px; color: var(--green-dark); font-size: 10px; font-weight: 950; letter-spacing: .1em; text-transform: uppercase; }
.decision-copy h2 { margin: 0; font-size: 25px; line-height: 1.12; letter-spacing: -.025em; }
.decision-copy p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.decision-actions { min-width: 0; display: flex; align-items: stretch; justify-content: center; gap: 11px; }
.choice-grid { width: 100%; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.choice-grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.choice-button { min-height: 105px; display: flex; align-items: center; gap: 13px; padding: 13px 16px; border: 2px solid #d4deda; border-radius: 13px; background: #fbfcfb; text-align: left; transition: transform 150ms ease-out, border-color 150ms ease-out, box-shadow 150ms ease-out, background 150ms ease-out; }
.choice-button:hover { transform: translateY(-3px); border-color: #58a180; background: #f2faf6; box-shadow: 0 5px 0 #d7e9df; }
.choice-button .symbol { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; border-radius: 13px; color: white; background: var(--blue); font-size: 24px; font-weight: 1000; }
.choice-button:nth-child(2) .symbol { background: var(--orange); }.choice-button:nth-child(3) .symbol { background: var(--green); }
.choice-button strong { display: block; font-size: 15px; line-height: 1.18; }.choice-button small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.22; }
.observation-action { width: 100%; display: grid; grid-template-columns: 74px 1fr; place-items: center; min-height: 106px; padding: 12px 30px; border: 3px solid var(--orange-dark); border-radius: 15px; color: white; background: var(--orange); box-shadow: 0 8px 0 var(--orange-dark); transition: transform 150ms ease-out, box-shadow 150ms ease-out; }
.observation-action:hover { transform: translateY(-3px); box-shadow: 0 11px 0 var(--orange-dark); }.observation-action:active { transform: translateY(5px); box-shadow: 0 3px 0 var(--orange-dark); }
.observation-action .symbol { width: 59px; height: 59px; display: grid; place-items: center; border: 3px solid white; border-radius: 50%; font-size: 28px; }.observation-action strong { font-size: 25px; }
.evidence-result { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.evidence-result > div { display: flex; align-items: center; gap: 14px; }.result-mark { width: 58px; height: 58px; flex: 0 0 58px; display: grid; place-items: center; border: 3px solid var(--ink); border-radius: 50%; background: var(--yellow); font-size: 27px; font-weight: 1000; }
.evidence-result strong { display: block; font-size: 19px; line-height: 1.16; }.evidence-result p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.3; }
.primary-button { min-width: 190px; }
.lab.is-pointing-surface::after { position: absolute; z-index: 10; left: 18%; right: 18%; top: 38%; height: 8px; content: "Surface: particles can leave here"; padding-top: 10px; border-top: 5px solid var(--yellow); color: var(--ink); font-size: 13px; font-weight: 950; text-align: center; animation: pulse 480ms ease-out 3; }

@keyframes orbit { to { rotate: 360deg; } }
@keyframes pulse { 50% { transform: scaleY(1.6); } }
@media (max-height: 780px) { .lesson { grid-template-rows: minmax(410px,1fr) 166px; gap: 10px; padding-top: 10px; }.decision-card { padding-top: 13px; padding-bottom: 13px; }.level-intro { min-height: 305px; }.choice-button { min-height: 92px; } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
