/* Learning phases and static code comparison. */
.learning-stage { --stage-mentor-space: clamp(260px, 21vw, 320px); min-height: 0; }
.learning-stage .phase-nav { width: min(100%, 1180px); max-width: none; margin-right: auto; margin-left: auto; }
.phase--learn .learning-shell { width: 100% !important; margin-right: 0; margin-left: 0; }
.phase-nav { display: grid; grid-template-columns: repeat(5, 1fr); max-width: 980px; margin: 0 auto 18px; border: 1px solid var(--line); background: rgba(4, 10, 13, 0.9); }
.phase-step { display: grid; grid-template-columns: clamp(22px, 1.95vw, 38px) 1fr; align-items: center; gap: clamp(6px, .52vw, 10px); min-height: clamp(38px, 3.52vw, 70px); padding: clamp(6px, .52vw, 10px) clamp(9px, .78vw, 15px); cursor: pointer; text-align: left; color: var(--muted); border: 0; border-right: 1px solid var(--line); background: transparent; }
.phase-step:last-child { border-right: 0; }
.phase-step b { display: grid; width: clamp(20px, 1.82vw, 36px); height: clamp(20px, 1.82vw, 36px); place-items: center; color: var(--cyan); border: 1px solid #315a65; font: 700 clamp(8px, .65vw, 13px) monospace; }
.phase-step span { font: 700 clamp(8px, .72vw, 14px) monospace; text-transform: uppercase; }
.phase-step.is-active { color: #07130e; background: var(--mint); }
.phase-step.is-active b { color: #07130e; border-color: #07130e; }
.phase-step.is-locked { cursor: not-allowed; opacity: 0.34; }
.learning-shell { max-width: none; margin: 0 auto; }
.phase-heading { max-width: 850px; margin-bottom: 16px; }
.phase-heading h1 { margin: 4px 0 8px; font: 700 clamp(28px, 3.125vw, 72px)/1 "Funnel Display", sans-serif; }
.checkpoint-card h1, .reflection-card h1 { margin: 6px 0 10px; font: 700 clamp(34px, 5vw, 62px)/0.95 Georgia, serif; }
.phase-heading > p:last-child, .checkpoint-card > p, .reflection-card > p { color: #b2c3bd; font-size: clamp(12px, 1.04vw, 20px); line-height: 1.55; }
.concept-layout { display: grid; grid-template-columns: clamp(200px, 19.5vw, 440px) minmax(0, 1fr); gap: clamp(12px, 1.04vw, 20px); height: clamp(248px, calc(100svh - 26vw), 1100px); min-height: 0; }
.concept-list { display: grid; align-content: start; gap: 10px; padding-right: 12px; overflow-x: hidden; overflow-y: auto; }
.concept-card { display: grid; grid-template-columns: clamp(62px, 5.73vw, 116px) 1fr; align-items: center; gap: clamp(8px, .65vw, 13px); min-height: clamp(68px, 5.6vw, 112px); padding: 2px clamp(9px, .78vw, 16px); cursor: pointer; text-align: left; color: var(--text); border: 1px solid var(--line); background: rgba(5, 13, 17, 0.92); }
.concept-card:hover, .concept-card.is-active { border-color: var(--cyan); background: rgba(7, 25, 31, 0.96); }
.concept-card.is-locked { cursor: not-allowed; opacity: .45; }
.concept-card img { width: clamp(60px, 5.34vw, 108px); height: clamp(60px, 5.34vw, 108px); object-fit: contain; }
.concept-card b, .concept-card small { display: block; }
.concept-card b { font-size: clamp(14px, 1.17vw, 24px); }
.concept-card small { margin-top: 5px; color: var(--muted); font: clamp(8px, .65vw, 13px) monospace; }
.concept-detail { height: 100%; min-height: 0; padding: clamp(24px, 4vw, 44px); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; border: 1px solid #31594e; background: radial-gradient(circle at 90% 20%, rgba(87, 242, 164, 0.12), transparent 35%), rgba(5, 13, 17, 0.95); scrollbar-gutter: stable; }
.concept-visual { position: relative; float: right; width: min(42%, 230px); height: 210px; margin: -18px -8px 14px 20px; border-bottom: 1px solid rgba(89,217,255,.34); background: radial-gradient(circle at 50% 60%, rgba(89,217,255,.16), transparent 65%); }
.concept-actor { width: 100%; height: 100%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 12px 18px rgba(0,0,0,.7)); }
.concept-attack-sprite { position: absolute; bottom: 0; left: 42%; z-index: 1; display: block; width: 150px; height: 200px; background: url("../../assets/images/behavior/sprites/enemy-slime-attack-sheet.webp") no-repeat 0 56% / 600% auto; filter: drop-shadow(0 0 16px rgba(87,242,164,.45)); transform: translateX(-50%); animation: concept-slime-attack 2000ms step-end infinite; }
.concept-health-badge { position: absolute; right: 70px; bottom: 34px; z-index: 2; padding: 7px 10px; color: #04130c; background: var(--mint); box-shadow: 0 0 18px rgba(87,242,164,.45); font: 800 9px monospace; font-style: normal; letter-spacing: .08em; }
.concept-diagram { position: absolute; right: 0; bottom: 4px; width: 68px; height: 68px; padding: 6px; object-fit: contain; border: 1px solid rgba(89,217,255,.46); background: rgba(2,10,13,.9); }
@keyframes concept-slime-attack {
  0%, 10% { background-position: 0 56%; }
  18% { background-position: 20% 56%; }
  26% { background-position: 40% 56%; }
  34% { background-position: 60% 56%; }
  42% { background-position: 80% 56%; }
  50%, 100% { background-position: 100% 56%; }
}
.concept-detail h2 { margin: 8px 0; font: 700 clamp(28px, 3vw, 68px) "Funnel Display", sans-serif; }
.concept-detail > p:not(.eyebrow) { max-width: 620px; color: #b8c8c3; font-size: clamp(13px, 1.1vw, 22px); line-height: 1.65; }
.concept-code { clear: both; margin: 20px 0 8px; padding: 0; overflow: hidden; color: #b7fbd8; border: 1px solid #254b3d; background: #020706; font: clamp(10px, .85vw, 17px)/1.55 Consolas, monospace; white-space: pre-wrap; }
.concept-code span { display: block; padding: 7px 12px; color: var(--cyan); border-bottom: 1px solid #183329; background: #071318; font-size: 9px; letter-spacing: .12em; }
.concept-code code { display: block; padding: 14px; }
.concept-detail .button { margin-top: 16px; }
.learning-stage .back { font-size: clamp(10px, .85vw, 17px); }
.learning-stage .listen-button { font-size: clamp(8px, .65vw, 13px); }
.learning-stage .button { min-height: clamp(36px, 3.125vw, 62px); padding: 0 clamp(18px, 1.56vw, 30px); font-size: clamp(12px, 1.04vw, 20px); }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.demo-code { position: relative; padding: 12px; border: 1px solid var(--line); background: rgba(4, 10, 13, 0.92); }
.demo-code .code-window { min-height: 160px; margin-top: 10px; }
.code-label { display: inline-block; padding: 5px 9px; font: 700 10px monospace; text-transform: uppercase; }
.code-label--bad { color: #ffc1b8; background: rgba(255, 101, 79, 0.18); }
.code-label--good { color: #bafbd9; background: rgba(87, 242, 164, 0.14); }
