/* Interactive demonstrations and quizzes inside lessons (app/js/widgets.js), and the pieces of the
   course pages that show planned lessons and prerequisites. */

/* ---------- shared frame ---------- */
.demo, .quiz { margin: 26px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--card-shadow); overflow: hidden; }
.demo-head, .quiz-head { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.demo-tag { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--accent); }
.demo-tag svg { width: 12px; height: 12px; }
.demo-title { font-weight: 620; letter-spacing: -.01em; }
.demo-hint { margin-left: auto; font-size: 12px; color: var(--muted); text-align: right; }
.demo-body { padding: 16px; }
.demo-label { display: flex; align-items: baseline; gap: 10px; font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); margin: 14px 0 8px; }
.demo-label:first-child { margin-top: 0; }
.demo-label small { font-family: var(--font-body); font-size: 11.5px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); }
.demo-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.demo-field { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.demo input[type="text"], .demo input[type="number"] { font-family: var(--font-mono); font-size: 12.5px; padding: 5px 8px; border-radius: 8px; width: 120px; background: var(--field); color: var(--ink); border: 1px solid var(--line); }
.demo-note { font-size: 13px; color: var(--muted); min-height: 20px; margin-top: 10px; line-height: 1.5; }
.demo-note.bad { color: var(--bad); }
.demo-note.changed, .cpu-story.changed, .ptr-code.changed { animation: note-in .32s var(--ease); }
@keyframes note-in { from { opacity: .35; transform: translateY(3px); } }
@keyframes pop { 0% { transform: scale(.92); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes glow { from { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent); } to { box-shadow: 0 0 0 0 transparent; } }

/* ---------- demo-cpu ---------- */
.cpu-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px; }
.cpu-memory { display: grid; grid-template-columns: 1fr; gap: 3px; }
.cpu-cell { display: grid; grid-template-columns: 30px 64px minmax(0, 1fr); align-items: center; gap: 8px; padding: 3px 8px; border-radius: 7px; border: 1px solid transparent; font-size: 12.5px; transition: background-color .2s, border-color .2s; }
.cpu-cell .a { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); }
.cpu-cell .v { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--ink); }
.cpu-cell input.v { width: 64px; padding: 2px 6px; font-weight: 600; }
.cpu-cell .m { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cpu-cell.code .m { font-family: var(--font-mono); font-size: 11.5px; color: var(--c-drill); }
.cpu-cell.pc { background: color-mix(in srgb, var(--accent) 13%, transparent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.cpu-cell.pc .a { color: var(--accent); }
.cpu-cell.operand { background: color-mix(in srgb, var(--info) 13%, transparent); border-color: color-mix(in srgb, var(--info) 45%, transparent); }
.cpu-cell.touched { animation: glow .9s ease-out; background: color-mix(in srgb, var(--good) 14%, transparent); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.cpu-registers { display: grid; gap: 8px; }
.reg { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 10px; padding: 9px 12px; border-radius: 10px; background: var(--field); border: 1px solid var(--line); }
.reg span { font-size: 12.5px; color: var(--ink-soft); }
.reg b { font-family: var(--font-mono); font-size: 18px; font-variant-numeric: tabular-nums; }
.reg small { grid-column: 1 / -1; font-size: 11px; color: var(--muted); font-family: var(--font-mono); min-height: 14px; }
.cpu-phases { display: flex; gap: 6px; margin: 14px 0 10px; }
.cpu-phases span { flex: 1; text-align: center; padding: 6px 0; border-radius: 8px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); border: 1px solid var(--line); transition: all .2s; }
.cpu-phases span.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.cpu-story { font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); min-height: 84px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 6%, var(--field)); border: 1px solid var(--line); }
@container view (max-width: 760px) { .cpu-grid { grid-template-columns: 1fr; } }

/* ---------- demo-bits ---------- */
.bits-row { display: flex; flex-wrap: wrap; gap: 12px 14px; }
.nibble { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.nibble-bits { display: flex; gap: 4px; }
.bit { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 40px; height: 50px; border-radius: 9px; border: 1px solid var(--line); background: var(--field); color: var(--muted); cursor: pointer; transition: background-color .15s, border-color .15s, color .15s, transform .08s; }
.bit:hover { border-color: var(--line-hover); }
.bit:active { transform: scale(.94); }
.bit small { font-family: var(--font-mono); font-size: 9px; color: var(--faint); }
.bit b { font-family: var(--font-mono); font-size: 19px; font-weight: 600; }
.bit.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); animation: pop .22s var(--ease); }
.bit.on small { color: color-mix(in srgb, var(--accent-ink) 70%, transparent); }
.nibble-hex { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--c-lesson); padding: 1px 10px; border-radius: 6px; border: 1px dashed color-mix(in srgb, var(--c-lesson) 45%, transparent); }
.bits-sum { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); margin-top: 12px; min-height: 19px; }
.bits-readout { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.bits-readout > div { padding: 8px 11px; border-radius: 10px; background: var(--field); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bits-readout span { font-size: 11px; color: var(--muted); }
.bits-readout b { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.demo-bits .bit { width: 40px; }
@container view (max-width: 620px) { .bit { width: 32px; height: 44px; } .bit b { font-size: 16px; } }

/* ---------- demo-bytes ---------- */
.bytes-split { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.byte { display: inline-grid; place-items: center; min-width: 40px; padding: 6px 8px; border-radius: 8px; font-family: var(--font-mono); font-size: 14px; font-weight: 600; border: 1px solid transparent; }
.byte.c0 { background: color-mix(in srgb, var(--c-lesson) 18%, transparent); color: var(--c-lesson); border-color: color-mix(in srgb, var(--c-lesson) 40%, transparent); }
.byte.c1 { background: color-mix(in srgb, var(--c-drill) 18%, transparent); color: var(--c-drill); border-color: color-mix(in srgb, var(--c-drill) 40%, transparent); }
.byte.c2 { background: color-mix(in srgb, var(--c-build) 18%, transparent); color: var(--c-build); border-color: color-mix(in srgb, var(--c-build) 40%, transparent); }
.byte.c3 { background: color-mix(in srgb, var(--c-project) 18%, transparent); color: var(--c-project); border-color: color-mix(in srgb, var(--c-project) 40%, transparent); }
.bytes-cells { display: flex; flex-wrap: wrap; gap: 8px; }
.bytes-cells.changed .byte { animation: pop .28s var(--ease); }
.mem-byte { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mem-byte small { font-family: var(--font-mono); font-size: 9.5px; color: var(--faint); }

/* ---------- demo-memory ---------- */
.mem-vars { display: grid; gap: 4px; font-size: 12.5px; }
.mem-var { display: grid; grid-template-columns: minmax(130px, 1.3fr) 104px 70px minmax(90px, 1fr) minmax(110px, 1.4fr); align-items: center; gap: 10px; padding: 5px 10px; border-radius: 9px; border: 1px solid transparent; cursor: pointer; transition: background-color .15s, border-color .15s; }
.mem-var.head { cursor: default; font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); padding-bottom: 2px; }
.mem-var:not(.head):hover { background: var(--hover); }
.mem-var.picked { background: color-mix(in srgb, var(--vc) 12%, transparent); border-color: color-mix(in srgb, var(--vc) 50%, transparent); }
.mem-var .n { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mem-var .n i { width: 10px; height: 10px; border-radius: 3px; background: var(--vc); flex: none; }
.mem-var .n code { background: none; border: 0; padding: 0; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mem-var input { width: 100%; max-width: 130px; }
.mem-var .bytes { color: var(--muted); font-size: 11.5px; letter-spacing: .02em; }
.mem-var .bytes.changed { animation: note-in .35s var(--ease); color: var(--vc); }
.v0 { --vc: var(--c-drill); } .v1 { --vc: var(--c-project); } .v2 { --vc: var(--c-lesson); } .v3 { --vc: var(--c-build); } .v4 { --vc: var(--bad); } .v5 { --vc: var(--info); }
/* Room inside the scroll box for the lift on hover and the ring of a picked cell, which it would otherwise clip. */
.mem-grid { display: grid; gap: 4px; overflow-x: auto; padding: 4px 4px 6px; margin: -4px -4px -2px; }
.mem-row { display: grid; grid-template-columns: minmax(78px, 104px) repeat(8, minmax(28px, 38px)); gap: 4px; align-items: center; }
@container view (max-width: 520px) { .mem-row { gap: 3px; } .mem-addr { font-size: 9.5px; } .mem-cell { font-size: 11px; height: 30px; } }
.mem-addr { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); }
.mem-cell { display: grid; place-items: center; height: 32px; border-radius: 7px; font-family: var(--font-mono); font-size: 12px; font-weight: 600; cursor: pointer;
  background: color-mix(in srgb, var(--vc) 16%, transparent); color: var(--vc); border: 1px solid color-mix(in srgb, var(--vc) 38%, transparent); transition: transform .12s, box-shadow .15s; }
.mem-cell:hover { transform: translateY(-1px); }
.mem-cell.picked { box-shadow: 0 0 0 2px var(--vc); }
.mem-cell.changed { animation: pop .3s var(--ease); }
.mem-cell.pad { cursor: help; color: var(--faint); border: 1px dashed var(--line-hover); background: repeating-linear-gradient(135deg, transparent 0 5px, var(--hover) 5px 10px); }
.mem-cell.blank { border: 0; background: none; cursor: default; }
@container view (max-width: 720px) { .mem-var { grid-template-columns: minmax(110px, 1fr) 70px minmax(80px, 1fr); } .mem-var > :nth-child(2), .mem-var > :nth-child(5) { display: none; } }

/* ---------- demo-pointers ---------- */
.ptr-row { display: flex; gap: 8px; overflow-x: auto; padding: 5px 4px 34px; margin: 0 -4px; }
.ptr-cell { position: relative; flex: 0 0 96px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 6px; border-radius: 11px; border: 1px solid var(--line); background: var(--field); cursor: pointer; transition: border-color .15s, background-color .15s, transform .12s; }
.ptr-cell:hover { border-color: var(--line-hover); transform: translateY(-1px); }
.ptr-cell small { font-family: var(--font-mono); font-size: 9.5px; color: var(--faint); }
.ptr-cell b { font-family: var(--font-mono); font-size: 20px; font-weight: 600; }
.ptr-cell span { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.ptr-cell.ghost { cursor: default; border-style: dashed; background: repeating-linear-gradient(135deg, transparent 0 6px, var(--hover) 6px 12px); }
.ptr-cell.ghost:hover { transform: none; border-color: var(--line); }
.ptr-cell.ghost b { color: var(--faint); }
.ptr-cell.target { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--field)); box-shadow: 0 0 0 1px var(--accent) inset; }
.ptr-cell.ghost.target { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad) inset; background: color-mix(in srgb, var(--bad) 9%, var(--field)); }
.ptr-mark { position: absolute; left: 50%; bottom: -30px; transform: translateX(-50%); display: flex; align-items: center; gap: 3px; font-style: normal; font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--accent-ink); background: var(--accent); padding: 2px 9px 2px 6px; border-radius: 999px; animation: pop .25s var(--ease); }
.ptr-mark svg { width: 12px; height: 12px; }
.ptr-cell.ghost .ptr-mark { background: var(--bad); color: #fff; }
.ptr-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-top: 4px; }
.ptr-info > div { padding: 8px 11px; border-radius: 10px; background: var(--field); border: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr; gap: 0 10px; align-items: baseline; }
.ptr-info span { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; color: var(--accent); }
.ptr-info b { font-size: 13px; font-weight: 600; text-align: right; }
.ptr-info small { grid-column: 1 / -1; font-size: 11px; color: var(--muted); }
.ptr-code { margin: 0; padding: 9px 12px; border-radius: 10px; background: var(--code-bg); border: 1px solid var(--line); font-family: var(--font-mono); font-size: 13px; color: var(--ink); }

/* ---------- demo-stack ---------- */
.stack-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 22px; }
.stack-frames { display: flex; flex-direction: column; gap: 8px; }
.stack-frame { border: 1px solid var(--line); border-radius: 11px; padding: 8px 10px 9px; background: var(--field); }
.stack-frame.top { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 7%, var(--field)); }
.stack-frame.new { animation: rise .3s var(--ease); }
.stack-name { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.stack-name b { font-family: var(--font-mono); font-size: 13.5px; }
.stack-name span { font-size: 11.5px; color: var(--muted); }
.stack-slot { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: baseline; gap: 10px; padding: 3px 6px; border-radius: 6px; font-size: 12.5px; }
.stack-slot .a { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); }
.stack-slot .n { font-family: var(--font-mono); color: var(--ink-soft); display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.stack-slot .n small { font-family: var(--font-body); font-size: 10.5px; color: var(--muted); }
.stack-slot .v { font-family: var(--font-mono); font-weight: 600; text-align: right; }
.stack-slot.ret .n, .stack-slot.ret .v { color: var(--muted); font-weight: 500; }
.stack-slot.param .v { color: var(--c-lesson); }
.stack-slot.changed { background: color-mix(in srgb, var(--good) 14%, transparent); animation: glow .9s ease-out; }
.stack-slot.top { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.stack-empty { padding: 12px; border: 1px dashed var(--line-hover); border-radius: 10px; color: var(--muted); font-size: 12.5px; text-align: center; }
.stack-story, .asm-story { min-height: 64px; margin-top: 10px; }
@container view (max-width: 760px) { .stack-grid, .asm-grid { grid-template-columns: 1fr; } }

/* ---------- demo-asm ---------- */
.asm-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.asm-code { border: 1px solid var(--line); border-radius: 10px; background: var(--code-bg); padding: 6px 0; font-family: var(--font-mono); font-size: 13px; }
.asm-line { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; padding: 2px 10px 2px 0; border-left: 3px solid transparent; }
.asm-line .ln { font-size: 10.5px; color: var(--faint); text-align: right; padding-right: 10px; }
.asm-line code { background: none; border: 0; padding: 0 0 0 14px; font-size: 13px; white-space: pre; color: var(--ink); }
.asm-line.label code { padding-left: 0; color: var(--c-drill); font-weight: 600; }
.asm-line.here { background: color-mix(in srgb, var(--accent) 14%, transparent); border-left-color: var(--accent); }
.asm-regs { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 6px; }
.asm-reg { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 0 8px; padding: 6px 9px; border-radius: 9px; background: var(--field); border: 1px solid var(--line); min-width: 0; }
.asm-reg span { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--accent); }
.asm-reg b { font-family: var(--font-mono); font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.asm-reg small { grid-column: 1 / -1; font-family: var(--font-mono); font-size: 9.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; }
.asm-reg.changed { border-color: color-mix(in srgb, var(--good) 55%, transparent); background: color-mix(in srgb, var(--good) 12%, var(--field)); animation: glow .9s ease-out; }
.asm-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.asm-flag { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--faint); }
.asm-flag small { font-family: var(--font-body); font-size: 10.5px; font-weight: 400; }
.asm-flag.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.asm-stack { display: grid; gap: 3px; }
.asm-stack .stack-slot { grid-template-columns: 96px minmax(0, 1fr) 48px; background: var(--field); }

/* ---------- quizzes ---------- */
.quiz-head { font-weight: 620; }
.quiz-head svg { width: 16px; height: 16px; color: var(--accent); }
.quiz-list { padding: 6px 16px 0; }
.quiz-q { padding: 14px 0 16px; border-bottom: 1px solid var(--line); }
.quiz-q:last-child { border-bottom: 0; }
.quiz-text { display: flex; gap: 12px; align-items: flex-start; font-size: calc(15px * var(--text-scale)); font-weight: 550; line-height: 1.5; }
.quiz-text .n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-size: 11px; font-weight: 600; background: var(--selected); color: var(--ink-soft); margin-top: 1px; transition: background-color .2s, color .2s; }
.quiz-q.correct .quiz-text .n { background: var(--good); color: #fff; }
.quiz-q.incorrect .quiz-text .n { background: var(--bad); color: #fff; }
.quiz-options { display: grid; gap: 7px; margin: 12px 0 0 36px; }
.quiz-option { display: flex; align-items: flex-start; gap: 11px; text-align: left; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); color: var(--ink-soft); font: inherit; font-size: calc(14px * var(--text-scale)); line-height: 1.45; cursor: pointer; transition: border-color .15s, background-color .15s, transform .08s; }
.quiz-option:hover:not(:disabled) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--field)); }
.quiz-option:active:not(:disabled) { transform: scale(.995); }
.quiz-option:disabled { cursor: default; opacity: .62; }
.quiz-option .mark { flex: none; width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; border: 1.5px solid var(--line-hover); transition: all .15s; }
.quiz-option.right { opacity: 1; border-color: var(--good); background: color-mix(in srgb, var(--good) 11%, var(--field)); color: var(--ink); }
.quiz-option.right .mark { border-color: var(--good); background: var(--good); box-shadow: inset 0 0 0 3px var(--field); }
.quiz-option.wrong { opacity: 1; border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--field)); animation: shake .3s; }
.quiz-option.wrong .mark { border-color: var(--bad); background: var(--bad); box-shadow: inset 0 0 0 3px var(--field); }
@keyframes shake { 25% { transform: translateX(-4px); } 60% { transform: translateX(3px); } }
.quiz-why { display: none; margin: 12px 0 0 36px; padding: 10px 13px; border-radius: 10px; font-size: calc(13.5px * var(--text-scale)); line-height: 1.55; color: var(--ink-soft); background: var(--panel-2); border-left: 3px solid var(--line-hover); }
.quiz-why.show { display: block; animation: note-in .3s var(--ease); }
.quiz-q.correct .quiz-why { border-left-color: var(--good); }
.quiz-q.incorrect .quiz-why { border-left-color: var(--bad); }
.quiz-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--panel-2); font-size: 13px; }
.quiz-score { display: inline-flex; align-items: center; gap: 7px; font-weight: 650; }
.quiz-score svg { width: 16px; height: 16px; color: var(--accent); }
.quiz-score.perfect { color: var(--good); }
.quiz-score.perfect svg { color: var(--good); animation: pop .4s var(--ease); }
.quiz code, .demo code { font-size: .92em; }

/* ---------- prerequisites, planned lessons ---------- */
.requires { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 18px; }
.requires .label { font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); }
.requires a.chip { text-decoration: none; text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: 12.5px; padding: 4px 10px; transition: border-color .15s, transform .12s; }
.requires a.chip:hover { transform: translateY(-1px); }
.banner.growing { --c: var(--info); margin-top: 22px; align-items: flex-start; }
.banner.growing svg { margin-top: 2px; }
.trail-card.soon { border-left-style: dashed; background: transparent; box-shadow: none; }
.trail-card.soon .t { color: var(--ink-soft); }
.trail-node.soon { border-style: dashed; color: var(--muted); }
.soon-mark { width: 50px; height: 50px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px dashed var(--line-hover); color: var(--faint); }
.soon-mark svg { width: 18px; height: 18px; }
.planned-list .list-row { cursor: default; }
.planned-list .list-row:hover { background: none; }
.planned-list .title { color: var(--ink-soft); }
.planned-dot { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 1.5px dashed var(--line-hover); }
a.ms-head.soon { text-decoration: none; opacity: .72; }
a.ms-head.soon:hover, a.ms-head.soon.here { opacity: 1; text-decoration: none; }
a.ms-head.soon.here { background: var(--selected); }
a.ms-head.soon svg, a.ms-head.soon.open svg { transform: none; width: 11px; height: 11px; }
a.ms-head.soon .ms-meta { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.ms-mini.soon { opacity: .55; border-style: dashed; }
.lesson-link.more { color: var(--faint); font-size: 12.5px; }
.lesson-link .tick.plus { border-style: dashed; }
.lesson-link .tick.plus svg { display: block; width: 8px; height: 8px; color: var(--faint); }
.h-course .t { max-width: 240px; }

/* ---------- motion: small, quick, and switched off when asked ---------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.page.fade-in > .hero > *, .page.fade-in > .grid > *, .page.fade-in > .home-split > *, .page.fade-in > .trail > *, .page.fade-in > .list > * { animation: rise .42s var(--ease) backwards; }
.page.fade-in > .grid > :nth-child(2), .page.fade-in > .hero > :nth-child(2), .page.fade-in > .home-split > :nth-child(2), .page.fade-in > .trail > :nth-child(2), .page.fade-in > .list > :nth-child(2) { animation-delay: .04s; }
.page.fade-in > .grid > :nth-child(3), .page.fade-in > .trail > :nth-child(3), .page.fade-in > .list > :nth-child(3) { animation-delay: .08s; }
.page.fade-in > .grid > :nth-child(4), .page.fade-in > .trail > :nth-child(4), .page.fade-in > .list > :nth-child(4) { animation-delay: .12s; }
.page.fade-in > .grid > :nth-child(n+5), .page.fade-in > .trail > :nth-child(n+5), .page.fade-in > .list > :nth-child(n+5) { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.bar i { animation: bar-in .7s var(--ease) backwards; transition: width .5s var(--ease); }
@keyframes bar-in { from { width: 0; } }
.ring .fill { animation: ring-in .9s var(--ease) backwards; }
@keyframes ring-in { from { stroke-dashoffset: 97.4; } }
.side-progress i { animation: bar-in .7s var(--ease) backwards; }
.nav-item svg, .quick-card .qc-icon, .trail-node, .badge-icon { transition: transform .18s var(--ease), color .15s, background-color .15s; }
.nav-item:hover svg { transform: translateX(1px) scale(1.06); }
.quick-card:hover .qc-icon { transform: scale(1.07) rotate(-3deg); }
.trail-item:hover .trail-node { transform: scale(1.12); }
.badge.earned:hover .badge-icon { transform: scale(1.1) rotate(-6deg); }
.list-row { transition: background-color .15s, padding-left .15s var(--ease); }
a.list-row:hover { padding-left: 20px; }
.chip { transition: border-color .15s, background-color .15s; }
.codeblock { transition: border-color .15s; }
.codeblock:hover { border-color: var(--line-hover); }
/* Animations switched off in Settings. The computer's own "reduce motion" switch is not followed: the site's
   owner asked for movement on every machine, and Settings has the off switch. */
/* "none", never a tiny duration: a duration on every element turns every style change into a transition
   (transition-property defaults to all), and the diagram library then measures its boxes mid-change and
   draws them thousands of pixels apart. */
html[data-anim="off"] *, html[data-anim="off"] *::before, html[data-anim="off"] *::after { animation: none !important; transition: none !important; }
html[data-anim="off"] .reveal { opacity: 1; transform: none; }
