/* The lesson-complete sequence: a full-screen overlay that plays after
   Mark as Complete on a whole course day. Five beats (done, streak,
   progress, today's mission, journey), advanced only by the bottom CTA.
   The overlay carries its own ek-root, so every token here resolves.
   Page rules, not an ek component: one use, and ek has no celebration shape
   to put it in. Prefix is .lc-, never .ek-. */

.lc {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--ek-surface);
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.lc[hidden] { display: none !important; }

.lc__dots {
  display: flex;
  justify-content: center;
  gap: var(--ek-space-2);
  padding-top: var(--ek-space-5);
  min-height: calc(var(--ek-space-5) + 6px);
}
.lc__dots i {
  width: 6px;
  height: 6px;
  border-radius: var(--ek-radius-full);
  background: var(--ek-surface-sunken);
  transition: width var(--ek-duration-medium) var(--ek-easing), background var(--ek-duration-medium) var(--ek-easing);
}
.lc__dots i.is-on { width: 18px; background: var(--ek-brand); }

.lc__stage { position: relative; flex: 1; overflow: hidden; }
.lc__screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--ek-modal-width);
  margin: 0 auto;
  animation: lc-in 350ms cubic-bezier(.2, .8, .2, 1) both;
}
.lc__screen[hidden] { display: none !important; }
.lc__center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 var(--ek-space-8);
}
.lc__foot {
  width: 100%;
  max-width: var(--ek-modal-width);
  margin: 0 auto;
  padding: var(--ek-space-4) var(--ek-space-6) var(--ek-space-8);
}
.lc__title { margin: 0 0 var(--ek-space-2); }
.lc__sub {
  font-size: var(--ek-type-body);
  line-height: var(--ek-leading-body);
  color: var(--ek-ink-muted);
  margin: 0;
}
.lc__lesson {
  font-size: var(--ek-type-subhead);
  line-height: var(--ek-leading-heading);
  font-weight: var(--ek-weight-medium);
  color: var(--ek-ink-muted);
  margin: 0;
  text-wrap: balance;
}
.lc .ek-eyebrow { margin-bottom: var(--ek-space-2); }

.lc-rise { animation: lc-rise 450ms ease-out both; }

/* 1. Done */
.lc-check {
  width: 120px;
  height: 120px;
  border-radius: var(--ek-radius-full);
  background: var(--ek-brand);
  display: grid;
  place-items: center;
  margin-bottom: var(--ek-space-10);
  animation: lc-pop 600ms cubic-bezier(.3, 1.6, .5, 1) 100ms both;
}
.lc-check svg { width: 60px; height: 60px; stroke-dasharray: 60; stroke-dashoffset: 60; animation: lc-draw 350ms ease-out 500ms forwards; }
.lc-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

/* 2. Streak */
.lc-flame { font-size: 104px; line-height: 1; animation: lc-pop 700ms cubic-bezier(.3, 1.6, .5, 1) 100ms both; }
.lc-num {
  position: relative;
  width: 200px;
  height: 92px;
  overflow: hidden;
  margin: var(--ek-space-2) 0 var(--ek-space-1);
  font-size: 88px;
  line-height: 92px;
  font-weight: var(--ek-weight-strong);
  color: var(--ek-ink);
  font-variant-numeric: tabular-nums;
}
.lc-num span { position: absolute; left: 0; right: 0; transition: transform 500ms cubic-bezier(.3, 1.4, .5, 1); }
.lc-week { display: flex; gap: var(--ek-space-2); margin-top: var(--ek-space-8); }
.lc-day { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: var(--ek-weight-medium); color: var(--ek-ink-subtle); }
.lc-day b {
  width: 36px;
  height: 36px;
  border-radius: var(--ek-radius-full);
  background: var(--ek-surface-sunken);
  display: grid;
  place-items: center;
  font-size: 15px;
  color: var(--ek-deep);
  transition: background var(--ek-duration-medium) var(--ek-easing);
}
.lc-day.is-done b { background: var(--ek-highlight); }
.lc-day.is-today b { box-shadow: 0 0 0 3px var(--ek-tint); }
.lc-day.is-pop b { animation: lc-bump 450ms; }

/* 3. Progress */
.lc-ring { position: relative; width: 200px; height: 200px; margin-bottom: var(--ek-space-8); }
.lc-ring svg { transform: rotate(-90deg); display: block; }
.lc-ring__track { stroke: var(--ek-surface-sunken); }
.lc-ring__fill { stroke: var(--ek-brand); transition: stroke-dashoffset 1100ms cubic-bezier(.3, .8, .3, 1); }
.lc-ring__label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.lc-ring__label b { font-size: 52px; line-height: 1; font-weight: var(--ek-weight-strong); color: var(--ek-ink); }
.lc-ring__label span { font-size: var(--ek-type-caption); color: var(--ek-ink-muted); margin-top: var(--ek-space-1); }
.lc-weekbar { width: 100%; margin-top: var(--ek-space-8); text-align: left; }
.lc-weekbar__row { display: flex; justify-content: space-between; font-size: var(--ek-type-caption); font-weight: var(--ek-weight-strong); color: var(--ek-ink); margin-bottom: var(--ek-space-2); }
.lc-weekbar__row span:last-child { color: var(--ek-ink-muted); }
.lc-segs { display: flex; gap: 6px; }
.lc-segs i { flex: 1; height: 10px; border-radius: var(--ek-radius-full); background: var(--ek-surface-sunken); transition: background var(--ek-duration-medium) var(--ek-easing); }
.lc-segs i.is-filled { background: var(--ek-brand); }

/* 4. Mission */
.lc-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 46vh;
  margin-top: var(--ek-space-6);
  border-radius: var(--ek-radius-card);
  overflow: hidden;
  background: var(--ek-surface-sunken);
  animation: lc-card 600ms cubic-bezier(.3, 1.4, .5, 1) 150ms both;
}
.lc-media img,
.lc-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Top-left, clear of the Day stamp top-right. */
.lc-sound {
  position: absolute; top: var(--ek-space-4); left: var(--ek-space-4);
  width: 40px; height: 40px;
  border: 0; border-radius: var(--ek-radius-full);
  background: rgba(0, 0, 0, .5); color: var(--ek-ink-on-solid);
  font-size: 18px; line-height: 40px; text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.lc-media__play { position: absolute; inset: 0; display: grid; place-items: center; }
.lc-media__play i {
  width: 64px; height: 64px; border-radius: var(--ek-radius-full);
  background: rgba(255, 255, 255, .92); color: var(--ek-brand);
  display: grid; place-items: center; font-style: normal; font-size: 24px; padding-left: 4px;
}
.lc-media__cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: var(--ek-space-5);
  color: var(--ek-ink-on-solid);
  text-align: left;
  font-size: 15px;
  font-weight: var(--ek-weight-medium);
  background: linear-gradient(transparent, rgba(0, 0, 0, .55));
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.lc-stamp {
  position: absolute; top: var(--ek-space-4); right: var(--ek-space-4);
  background: var(--ek-surface); color: var(--ek-brand);
  font-size: var(--ek-type-caption); font-weight: var(--ek-weight-strong);
  padding: 6px 10px; border-radius: var(--ek-radius-chip);
  animation: lc-stamp 350ms ease-in 700ms both;
}
.lc-empty {
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 46vh;
  margin-top: var(--ek-space-6);
  border: 2px dashed var(--ek-ink-subtle);
  border-radius: var(--ek-radius-card);
  background: none;
  font: inherit;
  color: var(--ek-ink-muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--ek-space-8);
  cursor: pointer;
}
.lc-empty__icon { width: 80px; height: 80px; border-radius: var(--ek-radius-full); background: var(--ek-tint); display: grid; place-items: center; font-size: 36px; margin-bottom: var(--ek-space-4); }
.lc-empty b { font-size: var(--ek-type-card-title); color: var(--ek-ink); margin-bottom: 6px; }
.lc-empty__go { margin-top: var(--ek-space-3); color: var(--ek-brand); font-weight: var(--ek-weight-strong); }

/* 5. Journey */
.lc-jhead { padding: var(--ek-space-8) var(--ek-space-6) var(--ek-space-5); }
.lc-badge { display: inline-block; background: var(--ek-tint); color: var(--ek-brand); font-size: var(--ek-type-caption); font-weight: var(--ek-weight-strong); padding: 6px 10px; border-radius: var(--ek-radius-chip); margin-bottom: var(--ek-space-3); }
.lc-tl { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: var(--ek-space-3) var(--ek-space-6) var(--ek-space-6); }
/* The gap lives on the foot, not on the link: .ek-textaction's own
   margin-block (a tap-pad give-back) is (0,2,0) and would beat a margin here. */
.lc__foot--stack { display: flex; flex-direction: column; align-items: center; gap: var(--ek-space-2); }

/* The mission form opens over the sequence rather than closing it. */
body.lc-open #mission-modal { z-index: 9100; }
.lc-item { position: relative; display: flex; gap: var(--ek-space-4); padding-bottom: 22px; }
.lc-item::before { content: ""; position: absolute; left: 19px; top: 40px; bottom: 0; width: 2px; background: var(--ek-surface-sunken); }
.lc-item:last-child::before { display: none; }
.lc-node { width: 40px; height: 40px; flex: none; z-index: 1; border-radius: var(--ek-radius-full); background: var(--ek-brand); color: var(--ek-ink-on-solid); display: grid; place-items: center; font-size: 14px; font-weight: var(--ek-weight-strong); }
.lc-node.is-today { box-shadow: 0 0 0 6px var(--ek-tint); }
.lc-node.is-off { background: var(--ek-surface); border: 2px solid var(--ek-surface-sunken); color: var(--ek-ink-subtle); }
.lc-item__body { flex: 1; min-width: 0; }
.lc-item__body small { font-size: var(--ek-type-caption); color: var(--ek-ink-muted); }
.lc-item__body p { margin: 2px 0 var(--ek-space-2); font-size: 15px; font-weight: var(--ek-weight-medium); color: var(--ek-ink); }
.lc-thumb { width: 92px; height: 116px; border-radius: var(--ek-radius-control); object-fit: cover; background: var(--ek-surface-sunken); display: block; }

@keyframes lc-in { from { opacity: 0; transform: translateX(40px); } }
@keyframes lc-rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes lc-pop { from { transform: scale(0); } }
@keyframes lc-draw { to { stroke-dashoffset: 0; } }
@keyframes lc-bump { 50% { transform: scale(1.3); } }
@keyframes lc-card { from { opacity: 0; transform: rotate(-3deg) scale(.9); } to { transform: rotate(-2deg); } }
@keyframes lc-stamp { from { opacity: 0; transform: rotate(6deg) scale(2); } to { transform: rotate(6deg); } }

@media (prefers-reduced-motion: reduce) {
  .lc *, .lc *::before, .lc { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  .lc-confetti { display: none; }
}
