:root {
  color-scheme: light;
  --ink: #15171a;
  --muted: #5c6670;
  --line: #d8dde3;
  --paper: #f7f5ef;
  --surface: #ffffff;
  --accent: #0d9488;
  --accent-dark: #0f766e;
  --grid: rgba(35, 45, 55, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

.lesson-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
}

.lesson-sidebar {
  padding: 36px 32px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.lesson-kicker {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lesson-sidebar h1 {
  margin: 0;
  font-size: clamp(32px, 6vw, 56px);
  line-height: 0.95;
  letter-spacing: 0;
  word-break: keep-all;
}

.lesson-goal {
  margin: 22px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.lesson-list {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.lesson-list li {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  line-height: 1.55;
}

.lesson-stage {
  min-height: 100svh;
  padding: 32px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
}

.embed-stage {
  min-height: 680px;
  padding: 18px;
}

.embed-stage .stage-canvas {
  min-height: 500px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.toolbar label {
  display: inline-grid;
  grid-template-columns: auto minmax(120px, 180px) 44px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

input[type="range"] {
  accent-color: var(--accent);
}

button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

.mode-pill {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 13px;
}

.stage-canvas {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    #fbfaf6;
  background-size: 32px 32px;
}

.stage-canvas[data-role="viewport"] {
  cursor: crosshair;
}

.stage-canvas[data-mode="pan"] {
  cursor: grab;
}

.axis-x,
.axis-y {
  position: absolute;
  background: rgba(21, 23, 26, 0.28);
  pointer-events: none;
}

.axis-x {
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
}

.axis-y {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
}

.shape {
  position: absolute;
  width: 148px;
  height: 92px;
  left: calc(50% - 74px);
  top: calc(50% - 46px);
  display: grid;
  place-items: center;
  border: 2px solid #14191f;
  background: #f6c85f;
  color: #14191f;
  font-weight: 800;
  transform-origin: center;
  user-select: none;
}

.shape.secondary {
  width: 104px;
  height: 72px;
  background: #9ac8eb;
}

.point {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  border: 2px solid #14191f;
  background: var(--accent);
  z-index: 4;
  pointer-events: none;
}

.vector-line,
.guide-line {
  position: absolute;
  height: 2px;
  transform-origin: left center;
  background: var(--accent);
  pointer-events: none;
}

.guide-line {
  background: #ef4444;
}

.selection-box {
  position: absolute;
  border: 1.5px solid var(--accent);
  background: rgba(13, 148, 136, 0.08);
  pointer-events: none;
}

.scene-node {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  user-select: none;
}

.scene-parent {
  width: 280px;
  height: 176px;
  border: 2px dashed #14191f;
  background: rgba(154, 200, 235, 0.18);
  z-index: 2;
}

.scene-child {
  width: 118px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 2px solid #14191f;
  background: #f6c85f;
  color: #14191f;
  font-weight: 800;
}

.scene-label {
  position: absolute;
  left: 10px;
  top: 8px;
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  font-size: 12px;
  line-height: 1;
}

.scene-axis {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  pointer-events: none;
}

.scene-axis-x {
  width: 58px;
  height: 2px;
  background: #ef4444;
}

.scene-axis-y {
  width: 2px;
  height: 58px;
  background: #0d9488;
}

.scene-origin {
  position: absolute;
  z-index: 4;
  padding: 4px 6px;
  border: 1px solid #14191f;
  background: #ffffff;
  color: var(--muted);
  font-size: 11px;
  transform: translate(8px, 8px);
  pointer-events: none;
}

.scene-edge {
  z-index: 1;
  background: rgba(21, 23, 26, 0.38);
}

.scene-world-box {
  z-index: 3;
  border-style: dashed;
  background: rgba(13, 148, 136, 0.05);
}

.marquee-node {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 2px solid #14191f;
  background: #f6c85f;
  color: #14191f;
  font-weight: 800;
  transform-origin: 0 0;
  user-select: none;
}

.marquee-node.is-rounded {
  background: #9ac8eb;
}

.marquee-node.is-circle,
.marquee-node.is-ellipse {
  border-radius: 50%;
  background: #f7b2bd;
}

.marquee-node.is-ellipse {
  background: #c7d2fe;
}

.marquee-node.is-selected {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  background: #86efac;
}

.marquee-box {
  z-index: 4;
  border-width: 2px;
  background: rgba(13, 148, 136, 0.14);
}

.snap-node {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 2px solid #14191f;
  background: #f6c85f;
  color: #14191f;
  font-weight: 800;
  transform-origin: 0 0;
  user-select: none;
}

.snap-moving {
  cursor: grab;
  touch-action: none;
}

.snap-moving.is-dragging {
  cursor: grabbing;
}

.snap-moving.is-snapped {
  outline: 3px solid rgba(239, 68, 68, 0.38);
  outline-offset: 3px;
}

.snap-target {
  background: #9ac8eb;
}

.snap-guide {
  position: absolute;
  z-index: 4;
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.12);
  pointer-events: none;
}

.snap-guide-v {
  width: 2px;
}

.snap-guide-h {
  height: 2px;
}

.group-demo-container,
.frame-demo-container,
.frame-demo-child,
.group-demo-child {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  user-select: none;
}

.group-demo-container {
  z-index: 2;
  width: 230px;
  height: 156px;
  border: 2px dashed #14191f;
  background: rgba(154, 200, 235, 0.14);
  overflow: visible;
  cursor: grab;
  touch-action: none;
}

.group-demo-child,
.frame-demo-child {
  display: grid;
  place-items: center;
  border: 2px solid #14191f;
  color: #14191f;
  font-weight: 800;
}

.group-demo-child {
  width: 88px;
  height: 56px;
  background: #f6c85f;
  cursor: grab;
  touch-action: none;
}

.group-demo-child-a {
  transform: translate(24px, 54px) rotate(8deg);
}

.group-demo-child-b {
  width: 76px;
  height: 52px;
  background: #f7b2bd;
  transform: translate(132px, 88px) rotate(-14deg);
}

.frame-demo-container {
  z-index: 2;
  width: 250px;
  height: 164px;
  border: 3px solid var(--accent-dark);
  background: rgba(255, 255, 255, 0.72);
  overflow: visible;
  cursor: grab;
  touch-action: none;
}

.frame-demo-container.is-clipping {
  overflow: hidden;
}

.frame-demo-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(13, 148, 136, 0.14) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(13, 148, 136, 0.14) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.frame-demo-child {
  z-index: 3;
  width: 112px;
  height: 72px;
  background: #86efac;
  cursor: grab;
  touch-action: none;
}

.frame-demo-child.is-dragging {
  cursor: grabbing;
}

.group-world-pin {
  background: #ef4444;
}

.group-demo-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.group-demo-obb {
  fill: rgba(13, 148, 136, 0.06);
  stroke: var(--accent);
  stroke-width: 2;
}

.group-demo-child-obb {
  fill: rgba(239, 68, 68, 0.06);
  stroke: #ef4444;
  stroke-width: 2;
  stroke-dasharray: 6 4;
}

.group-demo-rotate-line {
  stroke: var(--accent-dark);
  stroke-width: 2;
  stroke-dasharray: 5 5;
}

.group-rotate-handle {
  z-index: 5;
}

.resize-node {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 2px solid #14191f;
  background: #f6c85f;
  color: #14191f;
  font-weight: 800;
  transform-origin: 0 0;
  user-select: none;
}

.resize-overlay-svg {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.resize-obb {
  fill: rgba(13, 148, 136, 0.08);
  stroke: var(--accent);
  stroke-width: 2;
}

.resize-rotate-line {
  stroke: var(--accent-dark);
  stroke-width: 2;
  stroke-dasharray: 5 5;
}

.resize-aabb {
  z-index: 1;
  border-style: dashed;
  border-color: rgba(21, 23, 26, 0.28);
  background: transparent;
}

.resize-handle {
  z-index: 5;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid var(--accent-dark);
  background: #ffffff;
  cursor: nwse-resize;
}

.resize-handle-ne,
.resize-handle-sw {
  cursor: nesw-resize;
}

.resize-handle-rotate {
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: var(--accent);
  cursor: grab;
}

.handle {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border: 1px solid #0f766e;
  background: #fff;
}

.handle.resize-handle {
  z-index: 5;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid var(--accent-dark);
  background: #ffffff;
}

.handle.resize-handle-rotate {
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: var(--accent);
}

.gradient-sample {
  position: absolute;
  left: calc(50% - 180px);
  top: calc(50% - 120px);
  width: 360px;
  height: 240px;
  border: 2px solid #14191f;
  background: linear-gradient(35deg, #0d9488, #f6c85f, #9ac8eb);
  overflow: hidden;
}

.gradient-overlay {
  position: absolute;
  inset: 0;
}

.gradient-radius-line,
.gradient-conic-ray {
  position: absolute;
  height: 2px;
  transform-origin: left center;
  pointer-events: none;
}

.gradient-radius-line {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(20, 25, 31, 0.72);
}

.gradient-conic-ray {
  box-shadow: 0 0 0 1px rgba(20, 25, 31, 0.34);
}

.gradient-ring {
  position: absolute;
  border: 2px dashed currentColor;
  border-radius: 50%;
  opacity: 0.9;
  pointer-events: none;
}

.gradient-stop-marker {
  position: absolute;
  min-width: 40px;
  height: 22px;
  margin: -11px 0 0 -20px;
  display: grid;
  place-items: center;
  border: 2px solid #14191f;
  border-radius: 999px;
  background: var(--stop-color);
  color: #14191f;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  box-shadow: 0 2px 8px rgba(20, 25, 31, 0.2);
}

.figma-gradient-stop:active {
  cursor: grabbing;
}

.gradient-center-handle,
.gradient-sample-point {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
}

.gradient-center-handle {
  width: 22px;
  height: 22px;
  border: 3px solid #14191f;
  background: #ffffff;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 0 0 3px rgba(246, 200, 95, 0.75);
}

.gradient-center-handle:active {
  cursor: grabbing;
}

.gradient-sample-point {
  width: 16px;
  height: 16px;
  border: 3px solid #ffffff;
  background: #ef4444;
  pointer-events: none;
  box-shadow: 0 0 0 2px #14191f;
}

.gradient-overlay[data-mode="radial"] .gradient-conic-ray,
.gradient-overlay[data-mode="radial"] .gradient-stop-marker-conic {
  display: none;
}

.gradient-overlay[data-mode="conic"] .gradient-ring,
.gradient-overlay[data-mode="conic"] .gradient-radius-line,
.gradient-overlay[data-mode="conic"] .gradient-stop-marker-radial {
  display: none;
}

.gradient-overlay[data-mode="conic"] .gradient-conic-ray {
  display: block;
}

.gradient-overlay[data-mode="conic"] .gradient-stop-marker-conic {
  display: grid;
}

.pipeline-step {
  position: absolute;
  left: calc(50% - 170px);
  top: calc(50% - 55px);
  width: 140px;
  height: 92px;
  display: grid;
  place-items: center;
  border: 2px solid #14191f;
  background: #ffffff;
  font-weight: 800;
  transition: transform 240ms ease, background-color 240ms ease, left 240ms ease;
}

.pipeline-step:nth-child(2) {
  left: calc(50% - 20px);
  background: #f6c85f;
}

.pipeline-step:nth-child(3) {
  left: calc(50% + 130px);
  background: #9ac8eb;
}

.pipeline-step.active {
  background: #86efac;
}

.svg-layer,
.canvas-layer {
  position: absolute;
  inset: 16px;
  width: calc(100% - 32px);
  height: calc(100% - 32px);
  background: rgba(255, 255, 255, 0.66);
}

.svg-layer {
  border: 1px solid var(--line);
}

.svg-layer .anchor {
  cursor: grab;
}

.canvas-layer {
  display: block;
}

.world-layer {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  z-index: 1;
}

.world-layer .shape {
  left: 0;
  top: 0;
}

.viewport-inspector {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  width: min(420px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  overflow: auto;
  padding: 14px 16px;
  border: 1px solid rgba(21, 23, 26, 0.16);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  color: var(--muted);
  font: 12px/1.55 "SFMono-Regular", Consolas, monospace;
  white-space: pre-wrap;
  pointer-events: none;
}

.viewport-inspector strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
}

.viewport-inspector code {
  color: var(--accent-dark);
  font: inherit;
}

.ruler {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 42px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
  z-index: 2;
}

.tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 12px;
  background: rgba(21, 23, 26, 0.42);
  color: var(--muted);
  font: 11px "SFMono-Regular", Consolas, monospace;
  padding: 0 0 16px 4px;
  white-space: nowrap;
}

.tick.major {
  height: 24px;
  background: #15171a;
}

.state-node,
.state-ghost {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  border: 2px solid #14191f;
  color: #14191f;
  font-weight: 800;
  user-select: none;
  transform-origin: center;
}

.state-node {
  cursor: pointer;
}

.state-node-yellow {
  background: #f6c85f;
}

.state-node-blue {
  background: #9ac8eb;
}

.state-node-green {
  background: #86efac;
}

.state-node.is-selected {
  outline: 3px solid var(--accent);
  outline-offset: 5px;
}

.state-node.is-locked {
  opacity: 0.62;
}

.state-ghost {
  border-style: dashed;
  background: rgba(101, 113, 125, 0.08);
  color: transparent;
  pointer-events: none;
}

.layer-panel {
  position: absolute;
  right: 18px;
  top: 18px;
  z-index: 10;
  display: grid;
  gap: 8px;
  min-width: 170px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
}

.layer-panel strong {
  color: var(--muted);
  font-size: 12px;
}

.layer-row {
  justify-content: flex-start;
  min-height: 32px;
  padding: 0 10px;
  text-align: left;
}

.layer-row.is-selected {
  border-color: var(--accent);
  background: rgba(13, 148, 136, 0.1);
}

.json-editor {
  position: absolute;
  right: 18px;
  top: 18px;
  z-index: 8;
  width: min(340px, calc(100% - 36px));
  height: 300px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: 12px/1.5 "SFMono-Regular", Consolas, monospace;
  resize: vertical;
}

.figma-tree-panel {
  position: absolute;
  left: calc(50% - 330px);
  top: calc(50% - 150px);
  width: 270px;
  min-height: 230px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
  border: 2px solid #14191f;
  background: rgba(255, 255, 255, 0.88);
}

.figma-dom-panel {
  left: calc(50% + 60px);
}

.figma-tree-panel strong {
  margin-bottom: 8px;
  color: var(--accent-dark);
}

.figma-tree-panel span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

.figma-tree-panel .indent {
  margin-left: 20px;
}

.figma-tree-panel .indent-2 {
  margin-left: 40px;
}

.figma-frame-demo {
  position: absolute;
  left: 50%;
  top: 50%;
  height: 220px;
  padding: 32px;
  border: 2px solid #14191f;
  background: rgba(154, 200, 235, 0.18);
  transform: translate(-50%, -50%);
}

.figma-layout-child {
  width: 92px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 2px solid #14191f;
  background: #f6c85f;
  font-weight: 800;
}

.figma-layout-child.secondary {
  background: #86efac;
}

.figma-paint-demo {
  position: absolute;
  left: calc(50% - 95px);
  top: calc(50% - 72px);
  width: 190px;
  height: 144px;
  display: grid;
  place-items: center;
  border: 0 solid #14191f;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(13, 148, 136, 0.92), rgba(246, 200, 95, 0.94)),
    #9ac8eb;
  font-weight: 800;
}

.figma-vector-demo {
  position: absolute;
  left: 40px;
  top: 60px;
  width: 48%;
  height: 340px;
  background: rgba(255, 255, 255, 0.64);
}

.figma-text-demo {
  position: absolute;
  right: 70px;
  top: 150px;
  width: 230px;
  padding: 24px;
  border: 2px solid #14191f;
  background: #ffffff;
  color: #14191f;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.24;
  white-space: pre-line;
}

.vector-network-demo {
  position: absolute;
  inset: 22px 38px 132px;
  width: auto;
  height: auto;
  border: 2px solid #14191f;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    rgba(255, 255, 255, 0.82);
  background-size: 24px 24px;
  touch-action: none;
}

.vector-network-demo text {
  fill: #334155;
  font: 12px/1.2 ui-monospace, monospace;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.86);
  stroke-width: 4px;
  pointer-events: none;
}

.vector-network-region,
.vector-network-segment,
.vector-network-vertex,
.vector-network-handle {
  cursor: grab;
}

.vector-network-region:active,
.vector-network-segment:active,
.vector-network-vertex:active,
.vector-network-handle:active {
  cursor: grabbing;
}

.vector-network-region {
  pointer-events: fill;
}

.vector-network-segment {
  pointer-events: stroke;
}

.motion-demo-panel {
  position: absolute;
  left: calc(50% - 310px);
  top: 42px;
  width: 620px;
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 28px;
  align-items: center;
}

.motion-track {
  position: relative;
  height: 150px;
  border: 2px solid #14191f;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    rgba(255, 255, 255, 0.82);
  background-size: 24px 24px;
}

.motion-track::before {
  content: "";
  position: absolute;
  left: 40px;
  right: 40px;
  top: 50%;
  border-top: 3px solid #14191f;
}

.motion-ball {
  position: absolute;
  left: 20px;
  top: 50%;
  width: 34px;
  height: 34px;
  border: 3px solid #14191f;
  border-radius: 999px;
  background: #f6c85f;
  transform: translate(20px, -50%);
  will-change: transform;
}

.motion-ball::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.motion-marker {
  position: absolute;
  top: calc(50% + 24px);
  color: #334155;
  font: 12px/1 ui-monospace, monospace;
}

.motion-marker.start {
  left: 36px;
}

.motion-marker.end {
  right: 36px;
}

.motion-graph {
  width: 240px;
  height: 160px;
  border: 2px solid #14191f;
  background: rgba(255, 255, 255, 0.9);
}

.motion-props {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.motion-props span {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.motion-props strong,
.motion-props em,
.motion-props code {
  display: block;
}

.motion-props strong {
  color: var(--accent-dark);
  font-size: 12px;
}

.motion-props em {
  margin: 4px 0;
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
}

.motion-props code {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.keyframe-stage {
  position: absolute;
  left: calc(50% - 330px);
  top: 28px;
  width: 660px;
  height: 390px;
  border: 2px solid #14191f;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    rgba(255, 255, 255, 0.82);
  background-size: 24px 24px;
  overflow: hidden;
}

.keyframe-path {
  position: absolute;
  left: 50px;
  top: 30px;
  width: 560px;
  height: 260px;
  overflow: visible;
}

.keyframe-path text {
  fill: #334155;
  font: 11px/1.2 ui-monospace, monospace;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 4px;
}

.keyframe-path-line.card {
  stroke: rgba(246, 200, 95, 0.72);
}

.keyframe-path-line.badge {
  stroke: rgba(13, 148, 136, 0.72);
}

.keyframe-path-line.cursor {
  stroke: rgba(15, 23, 42, 0.42);
}

.keyframe-path-dot {
  stroke: #11161b;
  stroke-width: 2;
}

.keyframe-path-dot.card {
  fill: #f6c85f;
}

.keyframe-path-dot.badge {
  fill: #0d9488;
}

.keyframe-path-dot.cursor {
  fill: #ffffff;
}

.keyframe-node-layer {
  position: absolute;
  left: 50px;
  top: 30px;
  width: 560px;
  height: 260px;
}

.keyframe-node {
  position: absolute;
  left: 0;
  top: 0;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 3px solid #14191f;
  border-radius: 10px;
  background: #f6c85f;
  transform-origin: center;
  will-change: transform, opacity, background;
  color: #14191f;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.keyframe-node.badge {
  width: 34px;
  height: 34px;
  border-radius: 999px;
}

.keyframe-node.cursor {
  width: 0;
  height: 0;
  border: 0;
  border-left: 26px solid #111827;
  border-top: 16px solid transparent;
  border-bottom: 16px solid transparent;
  border-radius: 0;
  background: transparent !important;
  color: transparent;
}

.keyframe-timeline {
  position: absolute;
  left: 46px;
  right: 46px;
  bottom: 28px;
  height: 74px;
  padding-top: 18px;
}

.keyframe-rail {
  position: relative;
  height: 14px;
  border: 2px solid #14191f;
  border-radius: 999px;
  background: #ffffff;
  cursor: pointer;
  touch-action: none;
}

.keyframe-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 999px;
  background: rgba(13, 148, 136, 0.34);
  pointer-events: none;
}

.keyframe-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.keyframe-marker {
  position: absolute;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 2px solid #14191f;
  border-radius: 3px;
  background: #f6c85f;
  transform: translate(-50%, -50%) rotate(45deg);
  pointer-events: auto;
  cursor: pointer;
}

.keyframe-marker.card {
  background: #f6c85f;
}

.keyframe-marker.badge {
  background: #0d9488;
}

.keyframe-marker.cursor {
  background: #ffffff;
}

.keyframe-playhead {
  position: absolute;
  top: -18px;
  bottom: -24px;
  width: 3px;
  background: #ef4444;
  transform: translateX(-50%);
  pointer-events: none;
}

.keyframe-playhead::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -8px;
  width: 14px;
  height: 14px;
  border: 2px solid #14191f;
  background: #ef4444;
  transform: translateX(-50%) rotate(45deg);
}

.motion-path-stage {
  position: absolute;
  left: calc(50% - 330px);
  top: 28px;
  width: 660px;
  height: 390px;
  border: 2px solid #14191f;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    rgba(255, 255, 255, 0.84);
  background-size: 24px 24px;
  overflow: hidden;
}

.motion-path-svg {
  position: absolute;
  left: 20px;
  top: 18px;
  width: 620px;
  height: 300px;
  overflow: visible;
}

.motion-path-curve {
  fill: none;
  stroke: #14191f;
  stroke-width: 5;
  stroke-linecap: round;
}

.motion-path-tangent {
  stroke: #ef4444;
  stroke-width: 4;
  stroke-linecap: round;
}

.motion-path-normal {
  stroke: #0d9488;
  stroke-width: 3;
  stroke-dasharray: 6 6;
  stroke-linecap: round;
}

.motion-path-sample {
  fill: #ffffff;
  stroke: #14191f;
  stroke-width: 3;
}

.motion-path-node {
  position: absolute;
  left: 20px;
  top: 18px;
  width: 42px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 3px solid #14191f;
  border-radius: 8px;
  background: #f6c85f;
  color: #14191f;
  font-size: 11px;
  font-weight: 900;
  transform-origin: center;
  will-change: transform;
}

.motion-path-code {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 18px;
  height: 88px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font: 12px/1.45 "SFMono-Regular", Consolas, monospace;
  overflow: auto;
}

.bezier-length-stage {
  position: absolute;
  left: calc(50% - 350px);
  top: 22px;
  width: 700px;
  height: 456px;
  border: 2px solid #14191f;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    rgba(255, 255, 255, 0.86);
  background-size: 24px 24px;
  overflow: hidden;
}

.bezier-length-svg {
  position: absolute;
  left: 20px;
  top: 12px;
  width: 660px;
  height: 300px;
  overflow: visible;
  touch-action: none;
}

.bezier-length-controls {
  fill: none;
  stroke: #0d9488;
  stroke-width: 2;
  stroke-dasharray: 7 7;
}

.bezier-length-polyline {
  fill: none;
  stroke: rgba(239, 68, 68, 0.52);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.bezier-length-curve {
  fill: none;
  stroke: #14191f;
  stroke-width: 5;
  stroke-linecap: round;
}

.bezier-length-tangent {
  stroke: #ef4444;
  stroke-width: 4;
  stroke-linecap: round;
}

.bezier-length-marker {
  fill: #ffffff;
  stroke: #14191f;
  stroke-width: 4;
}

.bezier-length-dot-t {
  fill: #9ac8eb;
  stroke: #14191f;
  stroke-width: 1.5;
}

.bezier-length-dot-distance {
  fill: #f6c85f;
  stroke: #14191f;
  stroke-width: 1.5;
}

.bezier-length-anchor-end,
.bezier-length-anchor-handle {
  stroke: #14191f;
  stroke-width: 3;
  cursor: grab;
}

.bezier-length-anchor-end {
  fill: #9ac8eb;
}

.bezier-length-anchor-handle {
  fill: #0d9488;
}

.bezier-length-anchor-end:active,
.bezier-length-anchor-handle:active {
  cursor: grabbing;
}

.bezier-length-code {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 16px;
  height: 112px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font: 12px/1.42 "SFMono-Regular", Consolas, monospace;
  overflow: auto;
}

.css-math-card {
  position: absolute;
  left: calc(50% - 190px);
  top: calc(50% - 110px);
  width: 380px;
  min-height: 220px;
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 28px;
  border: 2px solid #14191f;
  background: #ffffff;
}

.css-math-card strong {
  color: var(--accent-dark);
  font-size: 32px;
}

.css-math-card span {
  color: var(--ink);
  font-weight: 700;
}

.css-math-card code {
  padding: 12px;
  background: rgba(101, 113, 125, 0.09);
  color: var(--muted);
  font: 13px/1.5 "SFMono-Regular", Consolas, monospace;
}

.figma-gradient-demo {
  position: absolute;
  left: calc(50% - 220px);
  top: calc(50% - 162px);
  width: 440px;
  height: 280px;
  border: 2px solid #14191f;
  background: linear-gradient(38deg, #f6c85f, #0d9488, #9ac8eb);
  overflow: visible;
}

.figma-gradient-overlay {
  position: absolute;
  inset: 0;
}

.figma-gradient-guide {
  position: absolute;
  height: 3px;
  transform-origin: left center;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0 0 1px rgba(20, 25, 31, 0.72);
  pointer-events: none;
}

.figma-gradient-guide.secondary {
  height: 2px;
  background: rgba(20, 25, 31, 0.68);
  box-shadow: none;
  border-top: 1px dashed rgba(255, 255, 255, 0.85);
}

.figma-gradient-handle {
  position: absolute;
  z-index: 4;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  display: grid;
  place-items: center;
  border: 3px solid #14191f;
  border-radius: 50%;
  background: #ffffff;
  color: #14191f;
  font-size: 12px;
  font-weight: 900;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 2px 10px rgba(20, 25, 31, 0.22);
}

.figma-gradient-handle:active {
  cursor: grabbing;
}

.figma-gradient-stop {
  position: absolute;
  z-index: 6;
  min-width: 30px;
  height: 20px;
  margin: -10px 0 0 -15px;
  display: grid;
  place-items: center;
  border: 2px solid #14191f;
  border-radius: 999px;
  background: var(--stop-color);
  color: #14191f;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  box-shadow: 0 2px 8px rgba(20, 25, 31, 0.2);
}

.figma-gradient-stop:active {
  cursor: grabbing;
}

.figma-gradient-code {
  position: absolute;
  left: calc(50% - 220px);
  top: calc(50% + 136px);
  width: 440px;
  min-height: 116px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: 12px/1.45 "SFMono-Regular", Consolas, monospace;
  white-space: pre-wrap;
}

.figma-formula-panel {
  position: absolute;
  left: calc(50% - 330px);
  top: 54px;
  width: 280px;
  min-height: 190px;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 20px;
  border: 2px solid #14191f;
  background: rgba(255, 255, 255, 0.92);
}

.figma-formula-panel strong {
  color: var(--accent-dark);
  font-size: 30px;
}

.figma-formula-panel span {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.figma-formula-visual {
  position: absolute;
  right: calc(50% - 330px);
  top: 54px;
  width: 320px;
  height: 220px;
  border: 2px solid #14191f;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    rgba(255, 255, 255, 0.76);
  background-size: 24px 24px;
  overflow: hidden;
}

.figma-formula-code {
  position: absolute;
  left: calc(50% - 330px);
  top: 296px;
  width: 660px;
  min-height: 144px;
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: 13px/1.55 "SFMono-Regular", Consolas, monospace;
  white-space: pre-wrap;
}

.formula-box,
.formula-parent,
.formula-radius,
.formula-superellipse,
.formula-stroke,
.formula-shadow,
.formula-image {
  position: absolute;
  border: 3px solid #14191f;
  background: #f6c85f;
}

.formula-box {
  left: 104px;
  top: 68px;
  width: 112px;
  height: 74px;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.formula-box.rotated {
  transform: rotate(-22deg) translate(12px, -4px);
}

.formula-axis {
  position: absolute;
  left: 158px;
  top: 110px;
  width: 118px;
  height: 3px;
  transform-origin: left center;
  background: #0d9488;
}

.formula-axis.y {
  width: 90px;
  transform: rotate(90deg);
  background: #dc2626;
}

.formula-pivot-stage {
  position: absolute;
  left: 70px;
  top: 42px;
  width: 170px;
  height: 135px;
}

.formula-pivot-node {
  position: absolute;
  left: 42px;
  top: 34px;
  width: 92px;
  height: 62px;
  border: 3px solid #14191f;
  background: rgba(96, 165, 250, 0.28);
  transform: rotate(-18deg);
  transform-origin: 0 0;
}

.formula-pivot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.formula-pivot::after {
  position: absolute;
  left: 14px;
  top: -5px;
  white-space: nowrap;
  font: 11px/1.2 ui-monospace, monospace;
  color: #334155;
}

.formula-pivot.top-left {
  left: 42px;
  top: 34px;
  background: #ef4444;
}

.formula-pivot.top-left::after {
  content: "Figma top-left";
}

.formula-pivot.center {
  left: 87px;
  top: 68px;
  background: #2563eb;
}

.formula-pivot.center::after {
  content: "CSS center";
  top: 8px;
}

.formula-pivot-line {
  position: absolute;
  left: 43px;
  top: 34px;
  width: 55px;
  height: 1px;
  border-top: 1px dashed #64748b;
  transform: rotate(34deg);
  transform-origin: left center;
}

.formula-parent {
  left: 54px;
  top: 52px;
  width: 214px;
  height: 116px;
  background: rgba(154, 200, 235, 0.26);
}

.formula-child {
  position: absolute;
  left: 70px;
  top: 34px;
  width: 76px;
  height: 48px;
  border: 3px solid #14191f;
  background: #f6c85f;
}

.formula-pin {
  position: absolute;
  top: 58px;
  height: 2px;
  background: #dc2626;
}

.formula-pin.left {
  left: 0;
  width: 70px;
}

.formula-pin.right {
  right: 0;
  width: 68px;
}

.formula-flex {
  position: absolute;
  left: 44px;
  top: 78px;
  display: flex;
  gap: 18px;
  padding: 22px;
  border: 3px solid #14191f;
  background: rgba(154, 200, 235, 0.3);
}

.formula-flex span {
  width: 54px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 2px solid #14191f;
  background: #ffffff;
  font-weight: 900;
}

.formula-radius {
  left: 52px;
  top: 60px;
  width: 96px;
  height: 96px;
  border-radius: 28px;
}

.formula-superellipse {
  right: 54px;
  top: 60px;
  width: 96px;
  height: 96px;
  border-radius: 42%;
  background: #9ac8eb;
}

.formula-stroke.inside {
  left: 58px;
  top: 70px;
  width: 88px;
  height: 78px;
  border-width: 10px;
  box-sizing: border-box;
}

.formula-stroke.outside {
  right: 64px;
  top: 80px;
  width: 88px;
  height: 58px;
  box-shadow: 0 0 0 10px #14191f;
  border-width: 0;
  background: #9ac8eb;
}

.formula-shadow {
  left: 96px;
  top: 64px;
  width: 128px;
  height: 92px;
  box-shadow: 24px 28px 28px rgba(20, 25, 31, 0.24);
}

.formula-text {
  position: absolute;
  left: 78px;
  top: 48px;
  width: 168px;
  padding: 20px;
  border: 2px solid #14191f;
  background: #ffffff;
  font-size: 54px;
  font-weight: 900;
  line-height: 1.05;
}

.formula-text small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 16px;
}

.formula-image {
  left: 54px;
  top: 48px;
  width: 210px;
  height: 124px;
  background:
    linear-gradient(135deg, rgba(13, 148, 136, 0.84), rgba(246, 200, 95, 0.88)),
    #9ac8eb;
}

.formula-crop {
  position: absolute;
  left: 96px;
  top: 72px;
  width: 128px;
  height: 76px;
  border: 3px dashed #ffffff;
  outline: 2px solid #14191f;
}

.readout {
  min-height: 90px;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

@media (max-width: 820px) {
  .lesson-shell {
    grid-template-columns: 1fr;
  }

  .lesson-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .lesson-stage {
    min-height: auto;
    padding: 18px;
  }

  .stage-canvas {
    min-height: 420px;
  }
}
