/* reel.css — The vertical video reel and its caption chrome.
   Split from app.module.css; load order in app.html preserves the original cascade. */

/* ---------- video reel ---------- */
.vcard {
  padding: 0 !important;
  background: #10161f;
}

.vcard video {
  position: absolute;
  inset: 0;
  width: 100%;
  /* The fixed navigation owns the bottom of the viewport. Keep the picture
     above it so the lessons' burned-in captions are never hidden underneath
     the nav on short screens. */
  height: calc(100% - 72px - var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  object-fit: cover;
  object-position: center;
  background: #10161f;
}

.mediaerror {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 24px;
  background: rgb(7 24 39 / 90%);
  color: #fff;
  text-align: center;
}

.mediaerror p {
  margin: 0 0 14px;
  font-size: 1.25rem;
  font-weight: 700;
}

.mediaerror .ghost {
  min-width: 148px;
  margin: 0;
}

.media-failed video {
  opacity: 0.2;
}

/* Bottom scrim, the way every short-video app does it: the caption needs a
   floor to sit on, and the burned-in subtitles at 79-81% of frame height get
   the same benefit. */
.vscrim {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgb(0 0 0 / 62%) 0%,
    rgb(0 0 0 / 34%) 40%,
    rgb(0 0 0 / 0%) 100%
  );
}

/* Caption sits bottom-left above the nav. It clears the burned-in subtitle
   band (measured at 79-81% of the video) rather than landing on top of it. */
.vcap {
  position: absolute;
  left: 16px;
  right: 104px;
  bottom: calc(86px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  z-index: 2;
  color: #fff;
  text-shadow: 0 1px 3px rgb(0 0 0 / 55%);
}

.vcap .t {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.3;
}

.vcap .f {
  margin-top: 2px;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  opacity: 0.92;
}

/* Identity over the feed. Sits opposite the mute button, on the scrim, and
   disappears the moment any panel takes the screen — it is the front door's
   job, not a permanent chrome bar. */
#feedMark {
  position: fixed;
  left: 16px;
  top: calc(18px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
  z-index: 3;
  pointer-events: none;
  color: #fff;
  text-shadow: 0 1px 4px rgb(0 0 0 / 60%);
}

#feedMark b {
  display: block;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
}

#feedMark span {
  display: block;
  margin-top: 1px;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.9;
}

/* Shown only while the video feed is the thing on screen. The quiz and the
   mock render into the same reel, so this has to be opt-in rather than a list
   of things to hide behind. */
#feedMark {
  display: none;
}

body.onvideo #feedMark {
  display: block;
}

.vmute {
  position: absolute;
  right: 16px;
  top: calc(14px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgb(255 255 255 / 26%);
  background: rgb(255 255 255 / 16%);
  color: #fff;
  backdrop-filter: blur(10px);
  transition:
    background 0.15s var(--ease),
    transform 0.1s var(--ease);
}

.vmute svg {
  width: 21px;
  height: 21px;
  fill: currentcolor;
}

.vmute:active {
  transform: scale(0.92);
  background: rgb(255 255 255 / 24%);
}

/* Muted is the state worth noticing: the lesson is narrated, so a silent feed
   is a thing to fix, not a neutral default. */
.vmute.off {
  background: rgb(255 255 255 / 92%);
  border-color: rgb(255 255 255 / 92%);
  color: var(--ink);
}

@media (min-width: 720px) {
  body {
    background: #071827;
  }

  #reel {
    left: 50%;
    right: auto;
    width: var(--feed-column, 540px);
    transform: translateX(-50%);
    background: var(--paper);
    border-inline: 1px solid rgb(255 255 255 / 12%);
  }

  #feedMark {
    left: calc(50% - 254px);
  }

  /* Wide viewports crop portrait lessons vertically, which moves their
     burned-in subtitle band towards the bottom navigation. Put the app's own
     title/fact block below the wordmark instead of competing with captions. */
  .vcap {
    top: calc(84px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
    bottom: auto;
  }
}

/* ---------- desktop workspace ----------
   The lesson itself stays portrait and focused. Everything around it becomes
   a desktop product: a permanent passport-blue rail and a wider study desk. */
