/* Homepage + Learn page styles. Loaded AFTER site.css; tokens come from there.
   Everything here is namespaced (.hm-* homepage, .ln-* learn) so the shared
   marketing classes in site.css stay the single source for nav/cards/buttons. */

/* ------------------------------------------------------------------ *
 * Hero demo panel — the "engine, running" moment on the homepage.
 * A live canvas stage on top, the Flow rule that drives it underneath.
 * ------------------------------------------------------------------ */
.hm-demo {
  position: relative;
  z-index: 1;
  min-width: 0;
  border: 1px solid rgba(178, 239, 132, 0.2);
  border-radius: var(--r-xl);
  background: var(--surface);
  overflow: hidden;
  box-shadow:
    0 36px 90px -42px rgba(0, 0, 0, 0.96),
    0 0 70px -38px rgba(74, 224, 214, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.025) inset;
}
.hm-demo-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.hm-dots { display: flex; gap: 5px; flex: none; }
.hm-dots i {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-2);
}
.hm-demo-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hm-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  color: var(--accent);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hm-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 9px var(--accent);
}
.hm-demo-tabs {
  margin-left: 2px;
  flex: none;
  display: flex;
  gap: 2px;
  padding: 2px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.hm-hero-copy { position: relative; z-index: 2; }
.hm-proof {
  margin-top: 20px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: 0.01em;
  line-height: 1.5;
}
.hm-demo-tabs button {
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 650;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.hm-demo-tabs button:hover { color: var(--text); }
.hm-demo-tabs button[aria-selected="true"] {
  background: var(--card-2);
  color: var(--text);
}

.hm-view { position: relative; background: #06080b; }
.hm-view[hidden] { display: none; }
.hm-stage {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  cursor: pointer;
  touch-action: manipulation;
}
.hm-stage:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.hm-hint {
  position: absolute;
  left: 12px;
  bottom: 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  background: rgba(6, 8, 11, 0.78);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 4px 10px;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.hm-hint.gone { opacity: 0; }
.hm-shot img {
  display: block;
  width: 100%;
  /* The width/height attributes on the <img> map to presentational height,
     which beats aspect-ratio unless height is explicitly auto. */
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top left;
  background: #06070a;
}
.hm-shot figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 12px 9px;
  font-size: 11px;
  color: var(--text-soft);
  background: linear-gradient(180deg, transparent, rgba(6, 8, 11, 0.92));
}

/* The Flow rule under the stage. */
.hm-flow {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 11px 12px;
  background: var(--card);
  border-top: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.hm-flow::-webkit-scrollbar { display: none; }
.hm-node {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--bg-soft);
  color: var(--text);
  white-space: nowrap;
}
.hm-node svg { width: 12px; height: 12px; }
.hm-node.ev {
  border-color: var(--accent-line);
  background: var(--accent-bg);
  color: var(--accent);
}
.hm-node.act {
  cursor: pointer;
  border-color: rgba(182, 156, 240, 0.34);
  background: var(--violet-bg);
  color: var(--violet);
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.hm-node.act:hover { border-color: rgba(182, 156, 240, 0.6); }
.hm-wire {
  flex: 1 1 auto;
  min-width: 16px;
  height: 2px;
  margin: 0 2px;
  border-radius: 2px;
  background: var(--line-2);
  position: relative;
  overflow: hidden;
}
.hm-wire::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: translateX(-100%);
  opacity: 0;
}
.hm-flow.fire .hm-wire::after { animation: hmPulse 0.46s ease-out; }
.hm-flow.fire .hm-wire:nth-of-type(4)::after { animation-delay: 0.1s; }
@keyframes hmPulse {
  0% { transform: translateX(-100%); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}
/* Only when the rail genuinely overflows (toggled in JS) — otherwise the
   mask would fade a node that is already fully visible. */
.hm-flow.scrolls {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
}
.hm-demo-foot {
  padding: 0 12px 11px;
  background: var(--card);
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.45;
}

/* ------------------------------------------------------------------ *
 * Homepage section rhythm
 * ------------------------------------------------------------------ */
body[data-page="home"] .hm-path-sec,
body[data-page="home"] .hm-remix-sec {
  background: var(--bg-soft);
}
.hm-sec-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  max-width: none;
}
.hm-sec-row .sec-sub { max-width: 36em; }
.hm-sec-cta { flex: none; }

@media (min-width: 901px) {
  .hm-arcade.is-featured {
    grid-template-columns: 1.35fr 1fr 1fr;
  }
}

.hm-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 28px;
  counter-reset: none;
}
.hm-steps li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 22px 22px 20px;
}
.hm-step-n {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 14px;
}
.hm-steps h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.hm-steps p {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.55;
}

.hm-remix-badge { margin-bottom: 14px; }
.hm-remix-copy { margin-top: 12px; max-width: 34em; }
.hm-remix-sec .sec { margin-top: 8px; }

.hm-final-cta {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.hm-final-cta .btn {
  padding: 13px 24px;
  font-size: 15px;
}

/* ------------------------------------------------------------------ *
 * Workspace explorer
 * ------------------------------------------------------------------ */
.hm-ws {
  margin-top: 30px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--card);
  overflow: hidden;
}
.hm-ws-tabs {
  display: flex;
  gap: 4px;
  padding: 8px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: thin;
}
.hm-ws-tabs button {
  flex: none;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.hm-ws-tabs button:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.hm-ws-tabs button[aria-selected="true"] {
  color: var(--accent);
  background: var(--accent-bg);
  border-color: var(--accent-line);
}
.hm-ws-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 34px;
  padding: 26px;
  align-items: start;
}
.hm-ws-panel[hidden] { display: none; }

.hm-engine-art {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: #090d10;
  box-shadow: 0 34px 90px -56px rgba(40, 219, 216, 0.38);
}
.hm-engine-art img { display: block; width: 100%; height: auto; }
.hm-ws-panel .k {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.hm-ws-panel h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 8px 0 9px;
}
.hm-ws-panel p { font-size: 14px; color: var(--text-soft); line-height: 1.55; }
.hm-ws-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 15px;
  font-size: 13px;
  font-weight: 650;
  color: var(--accent);
}
.hm-ws-link:hover { text-decoration: underline; }
.hm-ws-note {
  margin-top: 15px;
  font-size: 12.5px;
  color: var(--text-faint);
  border-left: 2px solid var(--line-2);
  padding-left: 10px;
}
.hm-ws-list { list-style: none; display: grid; gap: 10px; }
.hm-ws-list li {
  position: relative;
  padding-left: 19px;
  font-size: 13.5px;
  color: var(--text-soft);
  line-height: 1.5;
}
.hm-ws-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.75;
}
/* Workspace screenshots span the panel's full width beneath the copy. */
.hm-ws-shot {
  grid-column: 1 / -1;
  position: relative;
  margin: 4px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #06070a;
}
.hm-ws-shot img { display: block; width: 100%; height: auto; }
.hm-ws-shot figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 14px 9px;
  font-size: 12px;
  color: var(--text-soft);
  background: linear-gradient(180deg, transparent, rgba(6, 8, 11, 0.92));
}

/* ------------------------------------------------------------------ *
 * "Also in the box" link cards
 * ------------------------------------------------------------------ */
.hm-more {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 26px;
}
.hm-more a {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  transition: border-color 0.15s, background 0.15s;
}
.hm-more a:hover { border-color: var(--line-2); background: var(--card-2); }
.hm-more h3 {
  font-size: 14px;
  font-weight: 650;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hm-more h3 img {
  width: 34px;
  height: 34px;
  flex: none;
  object-fit: contain;
}
.hm-more p { font-size: 13px; color: var(--text-soft); line-height: 1.5; }

.hm-engine-art { margin-top: 28px; }
.hm-engine-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(5, 8, 11, 0.88));
}
.hm-engine-art figcaption {
  position: absolute;
  z-index: 1;
  left: 24px;
  right: 24px;
  bottom: 22px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.hm-engine-art figcaption strong { font-size: 18px; color: var(--text); }
.hm-engine-art figcaption span { font-size: 13px; color: var(--text-soft); }

/* Honest status note near the closing CTA. */
.hm-status {
  margin: 22px auto 0;
  max-width: 40em;
  font-size: 12.5px;
  color: var(--text-faint);
  line-height: 1.6;
}
.hm-status a { color: var(--text-soft); text-decoration: underline; text-underline-offset: 2px; }
.hm-status a:hover { color: var(--text); }

/* ------------------------------------------------------------------ *
 * LEARN
 * ------------------------------------------------------------------ */
.ln-panel {
  min-width: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 28px 70px -40px rgba(0, 0, 0, 0.9);
}
.ln-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.ln-panel-head h2 { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.ln-panel-head p { font-size: 12.5px; color: var(--text-faint); margin-top: 2px; }
.ln-count {
  margin-left: auto;
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  padding: 5px 11px;
  white-space: nowrap;
}
.ln-bar {
  height: 4px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}
.ln-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.35s ease;
}
.ln-panel-body { padding: 8px; }
.ln-panel-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--card);
  font-size: 12px;
  color: var(--text-faint);
}
.ln-reset {
  margin-left: auto;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  padding: 5px 10px;
  cursor: pointer;
}
.ln-reset:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.24); }

.ln-chapters { display: grid; gap: 14px; margin-top: 28px; }
.ln-chapter {
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--card);
  overflow: hidden;
}
.ln-chapter-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.ln-chapter-head h3 { font-size: 15.5px; font-weight: 700; letter-spacing: -0.02em; }
.ln-chapter-head p { font-size: 13px; color: var(--text-soft); }
.ln-chapter-head .ln-stage-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 3px 9px;
}

.ln-lesson {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}
.ln-chapter .ln-lesson:first-of-type { border-top: 0; }
.ln-lesson:hover { background: rgba(255, 255, 255, 0.018); }
.ln-check {
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
}
.ln-lesson h4 { font-size: 14.5px; font-weight: 650; letter-spacing: -0.01em; }
.ln-lesson.done h4 { color: var(--text-soft); text-decoration: line-through; }
.ln-lesson p { font-size: 13px; color: var(--text-soft); margin-top: 3px; line-height: 1.5; }
.ln-out {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  padding: 3px 9px;
}
.ln-open {
  flex: none;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 7px 12px;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.ln-open:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.24); }

.ln-lanes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 28px; }
.ln-lane {
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--card);
  padding: 20px;
}
.ln-tag {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 13px;
}
.ln-tag.green { background: var(--accent-bg); color: var(--accent); }
.ln-tag.sky { background: var(--sky-bg); color: var(--sky); }
.ln-tag.violet { background: var(--violet-bg); color: var(--violet); }
.ln-lane h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.ln-lane > p { color: var(--text-soft); font-size: 13.5px; margin: 8px 0 15px; line-height: 1.55; }
.ln-lane ul { list-style: none; display: grid; gap: 9px; }
.ln-lane li a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-soft);
}
.ln-lane li a::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line-2);
  flex: none;
}
.ln-lane li a:hover { color: var(--text); }
.ln-lane li a:hover::before { background: var(--accent); }

.ln-practice { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 32px; align-items: center; }
.ln-practice > * { min-width: 0; }
.ln-scene {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, #101820 0%, #173044 42%, #2a4038 78%, #35503c 100%);
}
.ln-scene::before {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  right: -12px;
  top: -24px;
  border-radius: 50%;
  background: radial-gradient(circle at 55% 45%, #e8f4ff 0 9px, rgba(178, 239, 132, 0.22) 11px, rgba(74, 224, 214, 0) 70%);
  pointer-events: none;
}
.ln-scene::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28%;
  background:
    linear-gradient(#7dcc72, #7dcc72) top / 100% 3px no-repeat,
    linear-gradient(rgba(178, 239, 132, 0.28), rgba(178, 239, 132, 0.28)) top 3px left 0 / 100% 2px no-repeat,
    linear-gradient(180deg, #3d6a3c 0%, #24462a 18%, #101c14 100%);
  pointer-events: none;
}
.ln-hills {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26%;
  height: 44%;
  background:
    radial-gradient(120% 110% at 16% 120%, #14241c 42%, transparent 43%),
    radial-gradient(90% 100% at 50% 130%, #14241c 40%, transparent 41%),
    radial-gradient(110% 110% at 88% 124%, #14241c 44%, transparent 45%);
  pointer-events: none;
}
.ln-chip {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 650;
  border: 1px solid var(--line-2);
  background: rgba(7, 12, 16, 0.78);
  border-radius: 999px;
  padding: 6px 11px;
}
.ln-chip b { color: var(--accent); font-weight: 700; }
.ln-hero-img,
.ln-coin-img {
  position: absolute;
  z-index: 1;
  /* width/height ATTRIBUTES map to a presentational height that beats the CSS
     width unless height is explicitly auto — without this the 130x182 hero
     rendered as a squashed 88x88 square. */
  height: auto;
}
.ln-hero-img {
  left: 14%;
  bottom: 18%;
  width: 88px;
  filter: drop-shadow(0 14px 16px rgba(0, 0, 0, 0.45));
}
.ln-coin-img {
  right: 24%;
  top: 26%;
  width: 54px;
  filter: drop-shadow(0 0 18px rgba(227, 192, 105, 0.5));
  animation: lnBob 2.6s ease-in-out infinite;
}
@keyframes lnBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}
.ln-checklist { display: grid; gap: 10px; margin-top: 17px; }
.ln-check-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  border-radius: var(--r-md);
  padding: 13px 14px;
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.5;
}
.ln-check-row b { color: var(--text); font-weight: 650; }
.ln-tick {
  width: 19px;
  height: 19px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  margin-top: 1px;
}

.ln-index {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 26px;
}
.ln-index a {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 550;
  color: var(--text-soft);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.ln-index a:hover { color: var(--text); border-color: var(--line-2); background: var(--card-2); }
.ln-manual-note { margin-top: 14px; }
.ln-manual-note a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ------------------------------------------------------------------ *
 * Responsive
 * ------------------------------------------------------------------ */
@media (max-width: 900px) {
  .hm-ws-panel { grid-template-columns: 1fr; gap: 18px; padding: 22px; }
  .hm-more { grid-template-columns: 1fr 1fr; }
  .hm-steps { grid-template-columns: 1fr; }
  .hm-sec-row { display: block; }
  .hm-sec-cta { margin-top: 16px; }
  .ln-lanes { grid-template-columns: 1fr; }
  .ln-practice { grid-template-columns: 1fr; gap: 24px; }
  .ln-index { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .hm-more { grid-template-columns: 1fr; }
  .hm-engine-art figcaption { left: 16px; right: 16px; bottom: 14px; display: block; }
  .hm-engine-art figcaption strong { display: block; font-size: 15px; }
  .hm-engine-art figcaption span { display: none; }
  .hm-demo-name { display: none; }
  .hm-flow { padding: 10px; }
  .hm-node { font-size: 11px; padding: 5px 8px; gap: 5px; }
  .hm-wire { min-width: 10px; margin: 0 1px; }
  .ln-index { grid-template-columns: 1fr; }
  .ln-lesson { grid-template-columns: auto 1fr; row-gap: 10px; padding: 14px 16px; }
  .ln-open { grid-column: 2; justify-self: start; }
  .ln-chapter-head { padding: 15px 16px; }
  .ln-scene { min-height: 250px; }
}

/* ------------------------------------------------------------------ *
 * Reduced motion — every animated thing on these two pages stops here.
 * The canvas demo also checks this in JS and never starts its rAF loop.
 * ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .hm-flow.fire .hm-wire::after,
  .ln-coin-img { animation: none !important; }
  .hm-wire::after { opacity: 0; }
  .ln-bar span { transition: none; }
  .hm-hint { transition: none; }
}

/* Chapter summary rows inside the Learn progress panel. */
.ln-sum {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  color: var(--text-soft);
  transition: background 0.15s, color 0.15s;
}
.ln-sum:hover { background: rgba(255, 255, 255, 0.045); color: var(--text); }
.ln-sum b { display: block; font-weight: 650; color: var(--text); font-size: 13.5px; }
.ln-sum small { display: block; font-size: 12px; color: var(--text-faint); margin-top: 1px; }
.ln-sum:hover small, .ln-sum:hover .n { color: var(--text-soft); }
.ln-sum .ring {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  display: grid;
  place-items: center;
  color: transparent;
  font-size: 11px;
  font-weight: 800;
}
.ln-sum.full .ring {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent);
}
.ln-sum .n {
  margin-left: auto;
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* site.css turns on smooth scrolling globally; the anchor jumps on Learn
   should not animate for readers who asked for less motion. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
