/* ============================================================
   Common layout + components for lessons 02–13.
   (Lesson 01 predates this and keeps its own module.css.)
   Each lesson page adds only demo-specific styles on top.
   ============================================================ */

.module {
  max-width: 62rem;
  margin: 0 auto;
  padding: 1.6rem 1.4rem 0;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--press);
  margin-bottom: 0.4rem;
}

.lesson-name {
  font-family: var(--font-display);
  font-weight: var(--w-title);
  font-size: 2rem;
  line-height: 1.12;
  letter-spacing: -0.015em;
  max-width: 44ch;
}

.intro {
  margin-top: 0.7rem;
  max-width: 58ch;
  color: var(--mute);
  font-size: 1.05rem;
}

.instruction {
  margin-top: 1.1rem;
  color: var(--mute);
  font-size: 0.95rem;
}

/* honest-labelling asides: illustrative data, caveats on tidy results */
.fineprint {
  margin-top: 0.6rem;
  max-width: 62ch;
  font-size: 0.82rem;
  color: var(--mute);
}

/* ---- generic building blocks ---- */

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.demo { margin-top: 1.2rem; }

.btn {
  border: 1px solid var(--press);
  background: var(--press);
  color: #fff;
  border-radius: 7px;
  padding: 0.5rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.btn kbd { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.btn:hover { filter: brightness(1.12); }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--rule); }
.btn.ghost kbd { background: var(--card); border-color: var(--rule); color: var(--mute); }
.btn.ghost:hover { border-color: var(--press); color: var(--press); filter: none; }
.btn[disabled] { opacity: 0.4; cursor: default; pointer-events: none; }

/* segmented / pill selectors */
.seg { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.seg-btn {
  border: 1px solid var(--rule);
  background: var(--card);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.88rem;
  color: var(--mute);
  cursor: pointer;
}
.seg-btn:hover { border-color: var(--press); color: var(--press); }
.seg-btn[aria-pressed="true"] {
  border-color: var(--press);
  color: var(--press);
  font-weight: 700;
  background: #e6eafc;
}

/* token chips (the house style established in lesson 01) */
.tok {
  display: inline-block;
  font-family: var(--font-mono);
  white-space: pre;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 0.14rem 0.4rem;
}

/* probability / magnitude bars (ruled gauge, lesson 01 house style) */
.meter {
  position: relative;
  height: 1.4rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}
.meter::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent calc(10% - 1px),
    rgba(23, 26, 33, 0.16) calc(10% - 1px),
    rgba(23, 26, 33, 0.16) 10%
  );
  pointer-events: none;
}
.meter .fill {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 0;
  background: var(--press);
  transition: width 0.25s ease;
}
.meter .fill.hatch {
  background: repeating-linear-gradient(
    -45deg,
    var(--mute) 0,
    var(--mute) 3px,
    transparent 3px,
    transparent 8px
  );
  opacity: 0.55;
}

.pct {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.muted { color: var(--mute); }
.mono { font-family: var(--font-mono); }

/* a highlighted reveal / explanation panel */
.reveal {
  margin-top: 0.9rem;
  padding: 0.9rem 1.1rem;
  background: #e6eafc;
  border: 1px solid var(--press);
  border-radius: var(--radius);
}

/* stepper controls for walk-through demos */
.stepper {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.step-dots { display: flex; gap: 0.3rem; }
.step-dots span {
  width: 0.55rem; height: 0.55rem;
  border-radius: 50%;
  background: var(--rule);
}
.step-dots span.on { background: var(--press); }

/* ---- takeaway + forward link (same look as lesson 01) ---- */

.takeaway {
  margin-top: 2rem;
  padding: 1.2rem 1.4rem;
  background: var(--card);
  border-left: 4px solid var(--press);
  border-radius: 0 var(--radius) var(--radius) 0;
  max-width: 62ch;
}
.takeaway h2 {
  font-family: var(--font-display);
  font-weight: var(--w-head);
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}
.takeaway p { margin-bottom: 0.7rem; }
.takeaway p:last-child { margin-bottom: 0; }

.mod-foot { margin-top: 1.6rem; }
.forward { display: inline-block; font-size: 1rem; }

/* presenter mode: hide long-form copy, scale handled by root font-size */
html[data-mode="presenter"] .lesson-name { font-size: 1.9rem; }

@media (max-width: 680px) {
  .module { padding-inline: 1rem; }
  .lesson-name { font-size: 1.5rem; }
}
