:root {
  --ink: #151619;
  --paper: #f2f0e8;
  --lime: #d9fa3d;
  --blue: #3136aa;
  --display: "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; color: var(--ink); background: var(--paper); font: 1rem/1.52 var(--display) }
main { flex: 1 }
a { color: inherit; text-underline-offset: .2em }
button, select, textarea { font: inherit }
button, select { cursor: pointer }
:focus-visible { outline: 3px solid #7755ff; outline-offset: 4px }
.masthead, footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem clamp(1rem, 4vw, 4rem); border-bottom: 1px solid currentColor; font-size: .875rem }
footer { border: 0; border-top: 1px solid currentColor }
.brand, .kicker { font-weight: 800; letter-spacing: .075em; font-size: .875rem }
.brand, .masthead nav a { text-decoration: none }
.masthead nav { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem }
.masthead nav a[aria-current], .masthead nav a:hover { text-decoration: underline; text-underline-offset: .35em }
h1, h2, p, figure { margin-top: 0 }
h1 { letter-spacing: -.085em; font-weight: 800; line-height: .82; margin-bottom: 1.5rem }
.kicker { display: block; margin-bottom: 1.6rem }
.intro { max-width: 27ch; font-size: clamp(1.1rem, 2vw, 1.4rem); line-height: 1.27 }
.button { display: inline-flex; justify-content: center; align-items: center; gap: .4rem; min-height: 46px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); padding: .55rem .95rem; font-weight: 700; text-decoration: none }
.button:hover { background: #fff }
.button.primary, .main-button { background: var(--lime); color: var(--ink) }
.main-button:hover, .button.primary:hover { background: #edff9e }
.cover { background: #17171d; color: var(--paper) }
.poster { min-height: min(820px, calc(100svh - 110px)); display: grid; grid-template-columns: 1.08fr 1fr; isolation: isolate; overflow: hidden }
.cover-copy { z-index: 1; align-self: center; padding: 3rem 0 3rem clamp(1rem, 5vw, 5rem) }
.cover h1 { font-size: clamp(4.3rem, 10.3vw, 12rem) }
.cover h1 em { font-style: normal; color: var(--lime); white-space: nowrap; font-size: .82em }
.cover-art, .stage-art { position: relative; isolation: isolate; background-image: linear-gradient(#8885 1px, transparent 1px), linear-gradient(90deg, #8885 1px, transparent 1px); background-size: 42px 42px }
.cover-art { margin: 1.4rem 1.4rem 1.4rem -4vw; border: 1px solid #686871; background-color: #20203a; background-image: radial-gradient(ellipse at 52% 48%, #555cac, transparent 70%), linear-gradient(#8885 1px, transparent 1px), linear-gradient(90deg, #8885 1px, transparent 1px); background-size: 100% 100%, 42px 42px, 42px 42px }
.material { display: block; width: 100%; height: 100%; position: absolute; inset: 0 }
.paper { display: block; position: absolute; color: var(--ink); box-shadow: 3px 5px 0 #15161955; pointer-events: none }
.strip { right: 5%; top: 12%; background: var(--paper); padding: .45rem .8rem; transform: rotate(8deg); font: 700 .875rem/1.2 monospace }
.fragment { padding: 0 .28em; right: 7%; bottom: 11%; transform: rotate(-9deg); background: #fe672e; font-size: clamp(3rem, 8vw, 9rem); font-weight: 800; letter-spacing: -.09em; line-height: .84; clip-path: polygon(0 8%, 98% 0, 100% 94%, 4% 100%) }
.fragment i { font-family: Georgia, serif }
.cutout { bottom: 15%; left: 6%; transform: rotate(6deg); padding: .4em .55em; background: #e7decd; font: 700 clamp(1.45rem, 3vw, 3.4rem)/.94 Georgia, serif; letter-spacing: -.07em }
.demo, .end-grid { display: grid; grid-template-columns: minmax(290px, 38%) minmax(0, 1fr); min-height: calc(100svh - 110px) }
.stage, .end-title { padding: clamp(1.35rem, 4vw, 4rem); border-right: 1px solid var(--ink); background: #e2ddff }
.reworked .stage { background: var(--blue); color: white }
.stage h1, .end-title h1 { font-size: clamp(4.5rem, 8.5vw, 9.5rem) }
.stage-art { height: clamp(150px, 21vw, 300px); margin: 1.25rem 0; border: 1px solid currentColor }
.stage-art .strip { top: auto; bottom: 9% }
.text-link { display: block; width: fit-content; margin-top: .8rem; font-size: .875rem }
.work, .end-copy { padding: clamp(1.1rem, 4vw, 4rem); width: 100%; max-width: 57rem }
.chooser, .exercise-header { display: flex; align-items: center; gap: .7rem; font-size: .875rem; font-weight: 700 }
select { max-width: 100%; padding: .35rem; background: white; color: var(--ink); border: 1px solid }
.exercise { margin-top: 1.5rem; border-top: 1px solid; padding-top: .75rem }
.exercise h2, .end-copy h2 { font-size: clamp(1.8rem, 3.3vw, 3.2rem); letter-spacing: -.06em; line-height: .97; margin: .6rem 0 .8rem }
.exercise h4 { margin: 0 0 .5rem }
.small { font-size: .875rem; margin-bottom: .4rem }
pre { background: #1b1b26; color: white; padding: .85rem; overflow-x: auto; font-size: .925rem }
.corrected { color: var(--lime) }
fieldset { min-width: 0; padding: .65rem; border: 1px solid }
#options { display: flex; flex-wrap: wrap; gap: .5rem }
#options label { display: flex; align-items: center; gap: .3rem; padding: .35rem .55rem; border: 1px solid; cursor: pointer; font-family: monospace; background: white }
#options label:has(:checked) { background: var(--lime) }
#prediction-form .button { margin: .55rem .25rem 0 0 }
.hint { background: #e2ddff; padding: .6rem }
#answer-panel { padding: .85rem; border: 1px solid; background: #fff; margin: .75rem 0 }
#answer-panel:focus { outline: 2px solid #3136aa }
.details, details { margin-top: 1rem }
summary { cursor: pointer; font-weight: 700 }
.result { border-left: 3px solid var(--blue); padding: .5rem .75rem; margin-top: .75rem }
.result p { margin: 0; overflow-wrap: anywhere }
.trace dl div { display: flex; justify-content: space-between; gap: .5rem; border-bottom: 1px solid }
.session { border-top: 1px solid; padding-top: .6rem; margin-top: 1.5rem }
#export-json { width: 100% }
.mobile-next { display: none }
.end-title { background: var(--lime) }
.end-copy { max-width: 47rem }
.end-copy h2:not(:first-child) { margin-top: 1.7rem }
@media (max-width: 760px) {
  .masthead { align-items: flex-start; flex-direction: column; gap: .4rem }
  footer { flex-wrap: wrap }
  .poster, .demo, .end-grid { grid-template-columns: 1fr }
  .cover-copy { padding: 2rem 1rem 0 }
  .cover h1 { font-size: clamp(3.6rem, 13vw, 7rem) }
  .cover-art { min-height: 260px; margin: 1rem }
  .stage, .end-title { padding: 1.35rem 1rem 1rem; border-right: 0; border-bottom: 1px solid }
  .stage h1, .end-title h1 { font-size: clamp(3.5rem, 12vw, 6rem) }
  .stage-art { height: 145px }
  .mobile-next { display: inline-flex; margin-top: 1rem }
}

/* ---------- Step rail ---------- */
#steps { border: 1px solid var(--ink); background: #fff; margin: 0 0 1.25rem }
#steps ol { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; padding: 0 }
#steps li { display: flex; gap: .55rem; align-items: flex-start; padding: .65rem .7rem; border-right: 1px solid #d8d3c6; opacity: .45; transition: opacity .25s, background .25s }
#steps li:last-child { border-right: 0 }
#steps li.is-done { opacity: .88 }
#steps li.is-active { opacity: 1; background: var(--lime) }
#steps li.is-skipped { opacity: .82; background: repeating-linear-gradient(135deg, #faf7ee 0 10px, #f1ece0 10px 20px) }
#steps li.is-skipped .step-body strong { color: #6b6455 }
.step-index { font: 800 .68rem/1.4 monospace; letter-spacing: .08em; color: var(--blue); padding-top: .1rem }
.step-body strong { display: block; font-size: .8rem; line-height: 1.25 }
.step-body small { display: block; margin-top: .15rem; font-size: .68rem; line-height: 1.3; color: #4a4a52 }
.steps-meter { height: 3px; background: #e0dbcf }
.steps-meter span { display: block; height: 100%; width: 25%; background: var(--blue); transition: width .35s ease }
.steps-caption { margin: .55rem .7rem .7rem; font-size: .78rem; color: #3c3c44 }
.reworked #steps li.is-active { background: var(--lime); color: var(--ink) }
.enter { animation: enter .4s ease both }
@keyframes enter { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
.result.stagger p { animation: enter .4s ease both }
@media (max-width: 760px) { #steps ol { grid-template-columns: 1fr 1fr } }
@media (prefers-reduced-motion: reduce) { .enter, .result.stagger p { animation: none } .steps-meter span { transition: none } }
