/* ===========================================================================
   concept-ladder.css — the "know more" sheet.
   ===========================================================================
   It opens OVER the reel feed and borrows its ink and its gold, because it is
   the same room one door further in — a different palette here would read as a
   different app.

   The figure is the largest thing on the screen and the text is the smallest.
   That ratio is the design, not a preference: the whole feature exists because
   a paragraph was the wrong answer to "tell me more". If a change to this file
   makes the words bigger than the picture, the change is wrong.

   Written against the 390px phone first. --bg-bottom-inset is the app shell's
   bottom chrome (memory: bottom-chrome-inset); the sheet must sit above it, not
   under it.
   =========================================================================== */

#bgl {
  position: fixed;
  inset: 0;
  z-index: 60;              /* over the feed (3) and its rail, under a toast */
  display: none;
  font-family: inherit;
}
#bgl.open { display: block }

/* Locks the feed behind the sheet. Without it a swipe here scrolls the reel
   underneath, and the student comes back to a concept they did not choose. */
html.bgl-lock, html.bgl-lock body { overflow: hidden; touch-action: none }

.bgl-scrim {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 15, .82);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.bgl-sheet {
  position: absolute;
  left: 0; right: 0; bottom: var(--bg-bottom-inset, 0px);
  /* Not full height. Leaving the top of the reel visible is what keeps this
     feeling like a drawer over the video rather than a page that replaced it. */
  max-height: 92%;
  display: flex;
  flex-direction: column;
  background: #0e1118;
  color: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -18px 50px rgba(0, 0, 0, .55);
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  animation: bgl-rise .26s cubic-bezier(.22, .9, .3, 1);
}
@keyframes bgl-rise { from { transform: translateY(24px); opacity: 0 } to { transform: none; opacity: 1 } }

@media (min-width: 720px) {
  /* On a wide screen a full-bleed drawer is a very long line of text. Keep the
     reading column the width it was designed at. */
  .bgl-sheet { left: 50%; right: auto; width: 420px; transform: translateX(-50%); border-radius: 20px; bottom: 24px }
  @keyframes bgl-rise { from { transform: translate(-50%, 24px); opacity: 0 } to { transform: translateX(-50%); opacity: 1 } }
}

/* ------------------------------------------------------------------- top */

.bgl-top { display: flex; align-items: center; gap: 10px; min-height: 34px }
.bgl-topic {
  flex: 1; min-width: 0;
  font-size: .74rem; letter-spacing: .06em; text-transform: uppercase;
  color: #8b93a6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bgl-x, .bgl-lang {
  background: rgba(255, 255, 255, .08); color: #fff; border: 0; border-radius: 999px;
  font-family: inherit; cursor: pointer; flex: none;
}
.bgl-x { width: 32px; height: 32px; font-size: 1.25rem; line-height: 1; padding: 0 }
.bgl-lang { padding: 6px 12px; font-size: .78rem; font-weight: 700 }
.bgl-lang[hidden] { display: none }

.bgl-hook {
  margin: 6px 0 12px;
  font-size: 1.12rem; line-height: 1.32; font-weight: 800;
  color: var(--bgr-gold, #fac410);
}

/* ------------------------------------------------------------------ stage */

.bgl-stage { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch }

.bgl-step { opacity: 0 }
.bgl-step.in { animation: bgl-step .3s ease forwards }
@keyframes bgl-step { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

.bgl-kind { display: flex; align-items: center; gap: 8px; margin: 0 0 10px }
.bgl-kind b { font-size: 1rem; line-height: 1 }
.bgl-kind span { font-size: .76rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #9aa3b8 }

/* The picture. Cream ground because that is what the figure kit draws on, and
   a transparent SVG on this ink would lose every stroke. */
.bgl-figwrap { background: #fdfaf2; border-radius: 14px; padding: 6px; margin: 0 0 12px }
.bgl-fig { display: block; width: 100%; height: auto }

.bgl-line { margin: 0 0 6px; font-size: 1.06rem; line-height: 1.38; font-weight: 650 }
.bgl-note { margin: 0; font-size: .88rem; line-height: 1.45; color: #a8b0c2 }

/* ------------------------------------------------------------------ check */

.bgl-q { margin: 0 0 12px; font-size: 1.02rem; line-height: 1.36; font-weight: 700 }
.bgl-opts { display: grid; gap: 8px }
.bgl-opt {
  width: 100%; text-align: left; font-family: inherit; font-size: .95rem; font-weight: 600;
  background: rgba(255, 255, 255, .07); color: #fff; border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 12px; padding: 13px 14px; cursor: pointer;
}
.bgl-opt.ok { background: #1d3a24; border-color: #3f7a4e; color: #d6f0d9 }
.bgl-opt.no { background: #3a1d21; border-color: #7a3f47; color: #f0d6d9 }
.bgl-opt.dim { opacity: .45 }
.bgl-why { margin: 12px 0 0; font-size: .88rem; line-height: 1.45; color: #a8b0c2 }
.bgl-why.ok { color: #a7d8b0 }
.bgl-why.no { color: #d8a7ad }
.bgl-why[hidden] { display: none }

/* ------------------------------------------------------------------- foot */

.bgl-foot { display: flex; align-items: center; gap: 12px; padding-top: 14px }

.bgl-dots { display: flex; align-items: center; gap: 6px; flex: 1 }
.bgl-dots i {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255, 255, 255, .18); transition: background .2s, transform .2s;
}
.bgl-dots i.on { background: rgba(255, 255, 255, .45) }
.bgl-dots i.here { background: var(--bgr-gold, #fac410); transform: scale(1.35) }
/* The check is drawn as a ring, not a dot: it is the way out, not a fifth rung. */
.bgl-dots i.chk { background: none; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .28) }
.bgl-dots i.chk.here { box-shadow: inset 0 0 0 2px var(--bgr-gold, #fac410); transform: scale(1.35) }

.bgl-go {
  flex: none; font-family: inherit; font-size: .92rem; font-weight: 800; cursor: pointer;
  background: var(--bgr-gold, #fac410); color: #141018; border: 0; border-radius: 12px;
  padding: 12px 20px;
}
.bgl-go[hidden] { display: none }

/* Loading is a state, not a blank. An empty sheet that never fills is this
   repo's #1 bug class wearing a spinner's clothes. */
#bgl.loading .bgl-hook { color: #8b93a6; font-weight: 600 }

/* ------------------------------------------------- the rail icon in Watch */

.rail button[data-act="ladder"] { font-size: 1.05rem }
.rail button[data-act="ladder"][hidden] { display: none }
