/* Shared page welcome intro (used by course and project pages) */
/* =========================================================
   Course welcome intro
   ========================================================= */
#course-intro { display: none; }
.intro-on #course-intro {
  --ci-rgb: 0, 123, 255;
  display: block;
  position: fixed;
  inset: 0;
  z-index: 5000;
  overflow: hidden;
  background-color: rgb(3, 9, 22);
  color: #f2f4f7;
  font-family: "Inter", "Segoe UI", sans-serif;
}
#course-intro.is-leaving {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 5000;
  overflow: hidden;
  pointer-events: none;
  animation: ci-out 1.15s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
@keyframes ci-out {
  to {
    opacity: 0;
    transform: scale(1.06);
    filter: blur(6px);
  }
}
.intro-on body { overflow: hidden; }

.ci-stars { position: absolute; inset: 0; width: 100%; height: 100%; }
/* soft edge darkening so captions sit in a lit centre */
#course-intro::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 50%, rgba(0, 0, 0, 0.55) 100%);
}
.ci-words { position: absolute; inset: 0; z-index: 1; }
.ci-word {
  position: absolute;
  width: max-content;
  max-width: 88vw;
  text-align: center;
  text-wrap: balance;
  font-size: calc(clamp(1.3rem, 3.6vw, 2.9rem) * var(--s, 1));
  font-weight: 600;
  letter-spacing: -0.025em;
  color: rgb(var(--ci-rgb));
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
  animation-name: ci-word;
  animation-timing-function: linear;
  animation-fill-mode: both;
  will-change: transform, opacity, filter;
}
.ci-word:nth-child(3n) { color: #f2f4f7; }
@keyframes ci-word {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.78); filter: blur(5px); }
  22% { opacity: 1; filter: blur(0); }
  70% { opacity: 0.95; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.32); filter: blur(7px); }
}

.ci-finale {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 0 24px;
  opacity: 0;
  transform: scale(0.86);
  filter: blur(8px);
  transition:
    opacity 1.1s ease,
    transform 1.8s cubic-bezier(0.22, 1, 0.36, 1),
    filter 1.1s ease;
}
#course-intro.is-finale .ci-finale { opacity: 1; transform: none; filter: none; }
#course-intro.is-finale .ci-words { opacity: 0; transition: opacity 0.6s ease; }
.ci-finale b {
  font-size: clamp(3.2rem, 11vw, 8rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  color: #f2f4f7;
}
.ci-finale span {
  margin-top: 14px;
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  font-weight: 600;
  color: rgb(var(--ci-rgb));
}

.ci-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 clamp(18px, 4vw, 40px);
  font-size: 0.85rem;
  color: rgba(242, 244, 247, 0.6);
}
.ci-load { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ci-bar {
  width: clamp(80px, 14vw, 160px);
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
  flex: none;
}
.ci-bar i {
  display: block;
  height: 100%;
  background: rgb(var(--ci-rgb));
  transform-origin: 0 50%;
  transform: scaleX(0);
}
.ci-pct { font-variant-numeric: tabular-nums; width: 3.2em; flex: none; }
.ci-status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) {
  .ci-status { display: none; }
}

