/* CodeForge look previews: mechanics every look shares (no colours, no layout). Each page styles the rest. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.ic { width: 1em; height: 1em; flex: none; }

/* editor: a transparent textarea over the coloured code */
.ed { display: flex; min-height: 0; line-height: 1.6; }
.ed-g { flex: none; text-align: right; user-select: none; }
.ed-g span { display: block; }
.ed-w { position: relative; flex: 1; min-width: 0; overflow: auto; }
.ed-i { position: relative; min-width: 100%; width: max-content; }
.ed-hl, .ed-ta { margin: 0; border: 0; padding: 0; font: inherit; line-height: inherit; letter-spacing: inherit; white-space: pre; tab-size: 4; }
.ed-hl { pointer-events: none; min-height: calc(var(--ed-lines, 4) * 1.6em); }
.ed-ln { display: inline-block; min-width: 100%; }
.ed-ta { position: absolute; inset: 0; width: 100%; height: 100%; resize: none; background: none; color: transparent; caret-color: var(--caret, #fff); outline: none; overflow: hidden; }
.ed-ta::selection { background: var(--select, rgba(120, 160, 255, .3)); }

/* tasks open and close */
.task-h { cursor: pointer; user-select: none; }
.task.is-locked .task-h { cursor: default; }
.task-b { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .34s cubic-bezier(.2, .8, .2, 1); }
.task.is-open .task-b { grid-template-rows: 1fr; }
.task-b-in { overflow: hidden; min-height: 0; }
.task-ring .ic + .ic { display: none; }
.task.is-locked .task-ring .ic { display: none; }
.task.is-locked .task-ring .ic + .ic { display: block; }

/* questions */
.q-done { display: none; }
.q.is-done .q-row, .q.is-done .q-fb, .q.is-done .q-hintbox { display: none; }
.q.is-done .q-done { display: flex; animation: cf-pop .42s cubic-bezier(.2, 1.4, .4, 1) both; }
.q.is-wrong .q-field { animation: cf-shake .4s; }
.q-fb:empty { display: none; }
@keyframes cf-shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
@keyframes cf-pop { from { opacity: 0; transform: scale(.96) translateY(4px); } }

/* output */
.out-l, .out-e, .out-n { animation: cf-in .3s both; }
@keyframes cf-in { from { opacity: 0; transform: translateY(5px); } }

/* steps (looks that show the tasks as a row of steps) */
.step .ic { display: none; }
.step.is-done .step-n, .step.is-locked .step-n { display: none; }
.step.is-done .ic:first-of-type { display: block; }
.step.is-locked:not(.is-done) .ic:last-of-type { display: block; }

/* the Run nudge: a ring on the button and an arrow that points at it, until the first run */
.run-nudge { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; pointer-events: none; animation: cf-poke 1s ease-in-out infinite; }
@keyframes cf-poke { 50% { transform: translateX(5px); } }
@keyframes cf-ring { 0% { box-shadow: 0 0 0 0 var(--ring, rgba(255, 255, 255, .5)); } 100% { box-shadow: 0 0 0 14px rgba(255, 255, 255, 0); } }

/* No "reduce motion" rule here on purpose: this PC has Windows animations off, so every browser on it asks for
   reduced motion and the previews would not move at all. The real build should offer its own motion setting. */
