:root {
  --bg: #05070c;
  --bg-elevated: #12151c;
  --bg-card: #1a1d26;
  --text: #f4f5f7;
  --text-muted: #9a9ea8;
  --text-faint: #7d818c;
  --accent: #e11d48;
  --accent-hover: #f43f5e;
  --border: rgba(255, 255, 255, 0.08);
  --font-display: "Arial Narrow", "Helvetica Neue Condensed", system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 8px;
  z-index: 100;
  background: var(--bg-elevated);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 700;
}

.skip-link:focus {
  top: 8px;
}

/* ---------- Page load entrance ---------- */

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Landing page sections cascade in one after another... */
hero-banner,
episode-rail,
resource-rail {
  display: block;
  animation: fade-in-up 0.6s ease-out both;
}

episode-rail {
  animation-delay: 0.1s;
}

resource-rail {
  animation-delay: 0.2s;
}

/* ...and the cards within each rail cascade in after that. */
.rail__track > *,
.resource-sidebar > * {
  animation: fade-in-up 0.45s ease-out both;
}

.rail__track > *:nth-child(2),
.resource-sidebar > *:nth-child(2) {
  animation-delay: 0.06s;
}

.rail__track > *:nth-child(3),
.resource-sidebar > *:nth-child(3) {
  animation-delay: 0.12s;
}

.rail__track > *:nth-child(4),
.resource-sidebar > *:nth-child(4) {
  animation-delay: 0.18s;
}

.rail__track > *:nth-child(5),
.resource-sidebar > *:nth-child(5) {
  animation-delay: 0.24s;
}

.rail__track > *:nth-child(n + 6),
.resource-sidebar > *:nth-child(n + 6) {
  animation-delay: 0.3s;
}

@media (prefers-reduced-motion: reduce) {
  hero-banner,
  episode-rail,
  resource-rail,
  .rail__track > *,
  .resource-sidebar > * {
    animation: none;
  }
}

/* ---------- Top nav ---------- */

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(5, 7, 12, 0.9), transparent);
}

.top-nav__left {
  display: flex;
  align-items: center;
  gap: 40px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.5px;
  text-decoration: none;
  color: var(--text);
}

.brand__mark {
  width: 20px;
  height: 20px;
  border-radius: 50% 50% 50% 0;
  background: var(--accent);
  flex-shrink: 0;
}

.top-nav__links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.top-nav__links a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.top-nav__links a[aria-current="page"] {
  color: var(--text);
}

.top-nav__right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 14px;
  color: var(--text-faint);
  font-size: 13px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 640px;
  display: flex;
  align-items: flex-end;
  padding: 0 40px 56px;
  margin-top: -84px;
}

.hero__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-color: #0d1420;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to top, var(--bg) 5%, rgba(5, 7, 12, 0.2) 45%, rgba(5, 7, 12, 0.55) 100%),
    linear-gradient(to right, rgba(5, 7, 12, 0.85) 0%, rgba(5, 7, 12, 0.2) 60%);
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 640px;
}

.hero__eyebrow {
  color: var(--accent-hover);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.hero__title {
  font-family: var(--font-display);
  font-size: 64px;
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 0 0 16px;
}

.hero__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin: 0 0 18px;
  text-transform: uppercase;
}

.hero__meta .tag--category {
  color: var(--accent-hover);
}

.hero__description {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 32px;
}

.hero__actions {
  display: flex;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 4px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
}

.btn--primary {
  position: relative;
  overflow: hidden;
  background: var(--text);
  color: #05070c;
}

.btn--primary:hover {
  background: #d8dadf;
}

.btn__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.btn--secondary {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.btn--secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ---------- Rails ---------- */

.rail {
  padding: 0 40px 48px;
}

.rail__heading {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin: 0 0 20px;
}

.rail__track {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}

/* ---------- Episode card ---------- */

.episode-card {
  display: block;
  width: 100%;
  text-align: left;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}

button.episode-card:disabled {
  cursor: not-allowed;
}

.episode-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-card);
  background-size: cover;
  background-position: center;
  background-clip: padding-box;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.episode-card--active .episode-card__thumb {
  border-color: var(--accent);
}

.episode-card--locked .episode-card__thumb {
  filter: grayscale(1) brightness(0.5);
}

.episode-card__icon {
  position: absolute;
  left: 10px;
  bottom: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(8, 10, 16, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #fff;
}

.episode-card__badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #22c55e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.episode-card__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
}

.episode-card__progress span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.episode-card__title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px;
}

.episode-card--locked .episode-card__title {
  color: var(--text-faint);
}

.episode-card__meta {
  font-size: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

/* ---------- Resource card ---------- */

.resource-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 32px 20px;
  text-align: center;
}

.resource-card__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  border: 2px solid currentColor;
  border-radius: 50%;
}

.resource-card__type {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-hover);
  margin: 0 0 6px;
}

.resource-card__label {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
}

/* ---------- Fullscreen modal dialogs (episode player, trailer) ---------- */

.modal-dialog {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  background: var(--bg);
  color: var(--text);
  overflow-y: auto;
}

.modal-dialog::backdrop {
  background: #000;
}

/* ---------- Trailer open transition ---------- */

/* Just the video growing in on open — the rest of the site stays put,
   nothing about it fades or shrinks. */
@keyframes trailer-grow-in {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.trailer-grow-in {
  animation: trailer-grow-in 320ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .trailer-grow-in {
    animation: none;
  }
}

/* ---------- Episode player view ---------- */

.player-view {
  padding-bottom: 60px;
}

.player-view__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 20px 40px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.player-view__video-wrap {
  padding: 12px 24px 0;
  display: flex;
  justify-content: center;
}

.player-view video {
  width: auto;
  max-width: 100%;
  height: 82vh;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 4px;
  display: block;
}

.player-view__body {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 48px;
  padding: 32px 40px 0;
  align-items: start;
}

.player-view__title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.player-view__meta {
  color: var(--accent-hover);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 0 0 20px;
}

.player-view__description {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 36px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 18px;
}

.section-heading::before {
  content: "";
  width: 4px;
  height: 20px;
  background: var(--accent);
  display: inline-block;
}

.knowledge-check__locked {
  color: var(--text-muted);
  font-size: 14px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 6px;
}

.episode-complete {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.episode-complete__message {
  margin: 0 0 16px;
  font-weight: 700;
  color: #22c55e;
}

.episode-complete__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.quiz-question {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 16px;
}

.quiz-question__prompt {
  display: block;
  width: 100%;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  color: inherit;
  margin: 0 0 14px;
}

.quiz-question__choice {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
  padding: 4px 0;
}

.quiz-question__choice input {
  accent-color: var(--accent);
}

/* Disabled (graded/reviewed) radios get heavily dimmed by browsers'
   native styling, which can make the checked dot nearly invisible on a
   dark background — so the picked choice also gets its own highlight. */
.quiz-question__choice--selected {
  color: var(--text);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 4px 8px;
  margin: 0 -8px;
}

.quiz-question__choice-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #22c55e;
}

.quiz-question--correct {
  border-color: #22c55e;
}

.quiz-question--incorrect {
  border-color: var(--accent);
}

.quiz-feedback {
  font-size: 12px;
  font-weight: 700;
  margin-top: 10px;
}

.quiz-feedback--correct {
  color: #22c55e;
}

.quiz-feedback--incorrect {
  color: var(--accent-hover);
}

.resource-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.resource-sidebar .resource-card {
  padding: 26px 16px;
}

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 40px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 12px;
}

.site-footer__links {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.site-footer__reset {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.site-footer__reset:hover {
  color: var(--accent-hover);
}

@media (max-width: 900px) {
  .player-view__body {
    grid-template-columns: 1fr;
  }

  .hero__title {
    font-size: 44px;
  }
}
