/* The course page. Builds on learn.css: same sky, type, glass and buttons.
   One featured lesson full bleed, then every lesson as a poster you can preview by pointing at it. */

body.catalog { --night: 0.72; }

/* ---------- hero ---------- */
.hero { position: relative; height: min(88vh, 880px); min-height: 580px; display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; }
.hero-media { position: absolute; inset: 0; z-index: -2; background: #05080d; }
.hero-media img, .hero-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-media img { opacity: 0; transform: scale(1.08); transition: opacity 1.4s ease, transform 9s var(--ease); }
.hero.is-ready .hero-media img { opacity: 1; transform: scale(1.02); }
.hero-media video { opacity: 0; transition: opacity 1.6s ease; }
.hero-media video.on { opacity: 1; }
.hero-shade {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(4, 6, 10, 0.88) 0%, rgba(4, 6, 10, 0.55) 34%, rgba(4, 6, 10, 0) 64%),
    linear-gradient(0deg, #05080d 0%, rgba(5, 8, 13, 0.75) 16%, rgba(5, 8, 13, 0) 46%),
    linear-gradient(180deg, rgba(4, 6, 10, 0.7) 0%, rgba(4, 6, 10, 0) 22%);
}

.hero-inner { width: var(--wide); margin: 0 auto; padding-bottom: clamp(48px, 8vh, 88px); display: flex; justify-content: space-between; align-items: flex-end; gap: 48px; }
.hero-copy { max-width: 760px; }
.hero-copy .kicker { margin-bottom: 18px; }
.hero-title { font-size: clamp(28px, 3.7vw, 56px); line-height: 1.06; }
.hero-meta { margin-top: 20px; color: var(--ink-dim); }
.hero-summary { margin-top: 16px; max-width: 52ch; font-size: 17px; line-height: 1.6; color: var(--ink-dim); text-shadow: 0 1px 18px rgba(0, 0, 0, 0.6); }
.hero-progress { display: flex; align-items: center; gap: 14px; margin-top: 22px; color: var(--ink-dim); max-width: 620px; }
.hero-progress .mono { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-progress .meta-bar { flex: none; width: 160px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.hero-cta .btn { display: inline-flex; align-items: center; gap: 10px; border-radius: 999px; padding: 14px 22px; }
.hero-cta .btn svg { width: 13px; height: 13px; }

.course-card {
  flex: none; width: 290px; padding: 20px 22px 16px; border-radius: var(--radius);
  background: var(--glass-bg); border: 1px solid var(--glass-line); box-shadow: var(--glass-hi), 0 30px 80px -30px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5);
}
.course-label { color: var(--ink-muted); font-size: 9.5px; }
.course-big { margin-top: 10px; display: flex; align-items: baseline; gap: 8px; }
.course-big .num { font-size: 44px; line-height: 1; color: #fff; letter-spacing: -0.02em; }
.course-of { font-family: var(--mono); font-size: 18px; color: var(--ink-muted); }
.course-sub { margin-top: 6px; font-size: 13px; color: var(--ink-muted); }
.course-xp { display: flex; align-items: baseline; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.course-xp .mono { font-size: 9.5px; color: var(--ink-muted); }
.course-xp .num { font-size: 20px; color: var(--gold); text-shadow: 0 0 14px rgba(230, 198, 138, 0.45); }
.streak { margin-left: auto; font-size: 9.5px; color: var(--ink-faint); }
.streak.on { color: var(--hud); text-shadow: var(--hud-glow); }
.lc-foot .gold { color: var(--gold); }
.course-parts { list-style: none; margin-top: 16px; }
.course-parts li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.course-parts .mono { font-size: 9.5px; color: var(--ink-dim); }
.ticks { display: flex; gap: 4px; }
.ticks i { width: 22px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); }
.ticks i.live { background: rgba(255, 255, 255, 0.32); }
.ticks i.started { background: var(--hud); box-shadow: 0 0 8px rgba(169, 230, 255, 0.6); }
.ticks i.done { background: var(--gold); box-shadow: 0 0 8px rgba(230, 198, 138, 0.6); }

/* ---------- lessons ---------- */
.lessons { width: var(--wide); margin: 0 auto; padding: 36px 0 110px; scroll-margin-top: 80px; }
.lessons-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; margin-bottom: 34px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.lessons-title { font-size: clamp(22px, 2.6vw, 38px); }
.lessons-summary { margin-top: 14px; max-width: 62ch; font-size: 15px; line-height: 1.6; color: var(--ink-dim); }

.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button {
  height: 34px; padding: 0 14px; border-radius: 999px; cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; font-size: 10px;
  color: var(--ink-dim); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-line); transition: all 0.2s;
}
.filters button span { margin-left: 6px; color: var(--ink-faint); }
.filters button:hover { color: #fff; background: rgba(255, 255, 255, 0.09); }
.filters button[aria-selected="true"] { color: var(--hud); background: rgba(169, 230, 255, 0.1); border-color: var(--hud-dim); text-shadow: var(--hud-glow); }
.filters button[aria-selected="true"] span { color: var(--hud); }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 22px; }

.lc { min-width: 0; }
.lc.in { animation: lc-in 0.7s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes lc-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.lc-link { display: block; color: inherit; text-decoration: none; outline: none; cursor: pointer; }
.lc--soon .lc-link { cursor: default; }

.lc-media {
  position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #0b1016;
  border: 1px solid var(--glass-line); transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease), border-color 0.4s;
}
.lc-media img, .lc-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lc-media img { transition: transform 1.4s var(--ease), filter 0.6s; }
.lc-media video { opacity: 0; transition: opacity 0.6s ease; }
.lc-media video.on { opacity: 1; }
.lc-shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(3, 5, 9, 0.8), rgba(3, 5, 9, 0) 50%), linear-gradient(180deg, rgba(3, 5, 9, 0.45), rgba(3, 5, 9, 0) 30%); }

.lc:hover .lc-media, .lc:focus-within .lc-media {
  transform: translateY(-6px); border-color: rgba(169, 230, 255, 0.35);
  box-shadow: 0 34px 60px -26px rgba(0, 0, 0, 0.85), 0 0 44px -12px rgba(169, 230, 255, 0.45);
}
.lc:hover .lc-media img { transform: scale(1.05); }

.lc-no { position: absolute; left: 14px; bottom: 11px; font-family: var(--display); font-size: 26px; line-height: 1; color: #fff; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7); }
.lc-dur { position: absolute; right: 12px; bottom: 14px; color: var(--ink); font-size: 10px; }
.lc-badge {
  position: absolute; left: 12px; top: 12px; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
  font: 500 9.5px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink);
  background: rgba(8, 12, 19, 0.55); border: 1px solid rgba(255, 255, 255, 0.14); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.lc-badge svg { width: 11px; height: 11px; }
.lc-badge--soon { color: var(--ink-dim); }
.lc-badge--new { color: #05080d; background: var(--ink); border-color: var(--ink); }
.lc-badge--now { color: var(--hud); border-color: rgba(169, 230, 255, 0.35); }
.lc-badge--done { color: var(--gold); border-color: var(--gold-dim); }
.lc-play {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; background: rgba(6, 10, 16, 0.4); border: 1px solid rgba(255, 255, 255, 0.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transform: scale(0.85); transition: opacity 0.3s, transform 0.5s var(--ease), background 0.25s, color 0.25s;
}
.lc-play svg { width: 16px; height: 16px; margin-left: 3px; }
.lc:hover .lc-play, .lc:focus-within .lc-play { opacity: 1; transform: none; }
.lc-link:hover .lc-play { background: var(--ink); color: #05080d; }
.lc-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.14); }
.lc-bar span { display: block; height: 100%; background: var(--hud); box-shadow: 0 0 10px rgba(169, 230, 255, 0.8); }
.lc.is-started .lc-no { bottom: 15px; }
.lc.is-started .lc-dur { bottom: 17px; }

/* lessons still to come: the same poster, quieter; a hover still gives a glimpse */
.lc--soon .lc-media img { filter: saturate(0.5) brightness(0.62); }
.lc--soon .lc-media video { filter: saturate(0.6) brightness(0.75); }
.lc--soon:hover .lc-media, .lc--soon:focus-within .lc-media { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.18); box-shadow: 0 26px 50px -26px rgba(0, 0, 0, 0.8); }
.lc--soon .lc-title { color: var(--ink-dim); }

.lc-body { padding: 16px 2px 0; }
.lc-part { color: var(--ink-muted); font-size: 9.5px; }
.lc-part span { color: var(--gold); margin-right: 8px; }
.lc-title { margin-top: 7px; font-size: 17px; font-weight: 500; line-height: 1.3; letter-spacing: -0.015em; color: #fff; transition: color 0.2s; }
.lc--live:hover .lc-title { color: var(--hud); }
.lc-sum { margin-top: 6px; font-size: 13.5px; line-height: 1.55; color: var(--ink-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lc-foot { margin-top: 12px; font-size: 9.5px; color: var(--ink-faint); }
.lc-foot .hud { color: var(--hud); }

/* ---------- narrow screens ---------- */
@media (max-width: 1200px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-inner { flex-direction: column; align-items: stretch; gap: 28px; }
  .course-card { width: 100%; display: grid; grid-template-columns: auto 1fr; column-gap: 24px; align-items: center; }
  .course-card .course-label, .course-card .course-big, .course-card .course-sub, .course-card .course-xp { grid-column: 1; }
  .course-parts { grid-column: 2; grid-row: 1 / span 4; margin-top: 0; }
}
@media (max-width: 720px) {
  .hero { height: auto; min-height: 92vh; }
  .hero-inner { padding-top: 120px; }
  .hero-summary { font-size: 15px; }
  /* on a phone the copy covers most of the picture, so the shade does more of the work */
  .hero-shade { background: linear-gradient(0deg, #05080d 0%, rgba(5, 8, 13, 0.86) 38%, rgba(5, 8, 13, 0.3) 70%, rgba(4, 6, 10, 0.6) 100%); }
  .course-card { display: block; }
  .course-parts { display: none; }
  .lessons-head { flex-direction: column; align-items: flex-start; }
  .filters { flex-wrap: nowrap; overflow-x: auto; width: calc(100% + var(--edge)); padding-right: var(--edge); scrollbar-width: none; }
  .filters button { flex: none; }
}
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; gap: 32px; } }

/* ---------- formats + live talks ---------- */
.lc-fmt {
  position: absolute; right: 12px; top: 12px; display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 8.5px; letter-spacing: 0.14em; color: var(--ink-dim); background: rgba(8, 12, 19, 0.45); border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.lc--talk .lc-fmt { color: var(--hud); border-color: rgba(169, 230, 255, 0.3); }

/* the live talks row sits under the series, a hairline apart */
.talks { padding-top: 0; }
.lc--talk .lc-media .slide-card { transition: transform 1.4s var(--ease); }
.lc--talk:hover .lc-media .slide-card { transform: scale(1.04); }
.lc--talk .lc-part span { color: var(--hud); }
.lc--upcoming .lc-link { cursor: pointer; }
.lc-badge--live { color: var(--gold); border-color: var(--gold-dim); }
.lc-badge--live i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px rgba(230, 198, 138, 0.9); animation: live-dot 1.6s ease-in-out infinite; }
@keyframes live-dot { 50% { opacity: 0.35; } }
