/* Orderflow Academy — course map. Builds on /mb.css tokens. */

/* ---------------- hero ---------------- */
.map-hero {
  position: relative;
  padding: calc(var(--header-h) + clamp(40px, 7vw, 96px)) 0 clamp(48px, 6vw, 80px);
  overflow: hidden;
}
.map-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(120, 160, 190, 0.05) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(120, 160, 190, 0.04) 0 1px, transparent 1px 72px);
  mask-image: radial-gradient(70% 70% at 70% 40%, #000, transparent 75%);
  pointer-events: none;
}
.map-hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero-copy {
  display: grid;
  gap: 26px;
}
.hero-copy .mb-h1 {
  font-size: clamp(48px, 6.2vw, 104px);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.reel {
  margin: 0;
  perspective: 1400px;
}
.reel-frame {
  padding: 12px;
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(20, 33, 45, 0.8), rgba(10, 17, 26, 0.85));
  box-shadow:
    inset 0 0 0 1px var(--line-2),
    0 50px 120px -40px rgba(0, 0, 0, 0.95),
    0 0 120px -50px rgba(120, 225, 213, 0.45);
  transform: rotateY(-7deg) rotateX(3deg);
  transform-origin: 30% 50%;
  transition: transform 1.2s var(--ease);
}
.reel:hover .reel-frame {
  transform: none;
}
.reel-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 8px 12px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
}
.reel-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.reel-live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sell);
  box-shadow: 0 0 10px var(--sell);
  animation: live 1.4s infinite;
}
@keyframes live {
  50% {
    opacity: 0.25;
  }
}
.reel-view {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-l);
  overflow: hidden;
  background: #060b13;
}
.reel-view canvas {
  width: 100%;
  height: 100%;
}
.reel-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #060b13;
  transition: opacity 0.8s;
}
.reel-loading::after {
  content: "";
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(120, 225, 213, 0.25);
  border-top-color: var(--teal);
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    rotate: 360deg;
  }
}
.reel.ready .reel-loading {
  opacity: 0;
  pointer-events: none;
}
.reel-caption {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 8px 6px;
}
.reel-caption strong {
  font-size: 20px;
  font-weight: 900;
}
.reel-progress {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 0;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.reel-progress i {
  display: block;
  height: 100%;
  transform-origin: left;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--teal), var(--gold));
}
.map-summary {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, auto) 1fr;
  align-items: end;
  gap: 0;
  margin-top: clamp(48px, 7vw, 88px);
  border-block: 1px solid var(--line);
}
.map-summary > div {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 22px 40px 22px 0;
  margin-right: 40px;
  border-right: 1px solid var(--line);
}
.map-summary strong {
  font-family: var(--f-display);
  font-size: clamp(48px, 5vw, 76px);
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(180deg, var(--text), rgba(237, 242, 237, 0.35));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.map-summary span {
  color: var(--muted);
  font-size: 14px;
}
.map-summary p {
  justify-self: end;
  padding-block: 22px;
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

/* ---------------- paths ---------------- */
.path-section {
  padding-block: clamp(64px, 9vw, 120px) clamp(32px, 4vw, 56px);
}
.path-heading {
  display: grid;
  gap: 20px;
  max-width: 760px;
  margin-bottom: 40px;
}
.learning-paths {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.learning-path {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: 14px 18px;
  align-items: center;
  padding: 26px 26px 22px;
  border: 0;
  border-radius: var(--r-l);
  background: linear-gradient(180deg, rgba(20, 33, 45, 0.7), rgba(10, 17, 26, 0.75));
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
  transition:
    transform 0.5s var(--ease),
    box-shadow 0.4s;
}
.learning-path:hover {
  transform: translateY(-4px);
}
.learning-path[aria-pressed="true"] {
  box-shadow:
    inset 0 0 0 1px rgba(120, 225, 213, 0.6),
    0 20px 60px -30px rgba(120, 225, 213, 0.6);
}
.path-index {
  font-size: 44px;
  line-height: 0.9;
  color: var(--teal);
}
.path-text strong {
  display: block;
  font-size: 20px;
  font-weight: 900;
}
.path-text small {
  color: var(--muted);
  font-size: 13px;
}
.path-arrow {
  grid-row: 1;
  grid-column: 3;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(120, 225, 213, 0.12);
  color: var(--teal);
  transition: transform 0.5s var(--ease);
}
.learning-path:hover .path-arrow {
  transform: rotate(45deg);
}
.path-steps {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-2);
}
.path-steps i {
  position: relative;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(5, 9, 15, 0.6);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-2);
  font-size: 12px;
  font-style: normal;
}

/* ---------------- browse ---------------- */
.browse-section {
  padding-block: clamp(48px, 6vw, 80px) clamp(64px, 8vw, 110px);
}
.browse-head {
  display: grid;
  gap: 18px;
  margin-bottom: 28px;
}
.filter-bar {
  position: sticky;
  top: 12px;
  transition: top 0.5s var(--ease);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(8, 14, 24, 0.82);
  box-shadow:
    inset 0 0 0 1px var(--line-2),
    0 20px 40px -20px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(16px);
}
.mb-header:not(.is-hidden) ~ main .filter-bar {
  top: calc(var(--header-h) + 8px);
}
.view-filters {
  display: flex;
  gap: 4px;
}
.view-filters button {
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  transition:
    background 0.3s,
    color 0.3s;
}
.view-filters button[aria-pressed="true"] {
  background: var(--teal);
  color: var(--teal-ink);
}
.course-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(340px, 45%);
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(5, 9, 15, 0.7);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
}
.course-search input {
  flex: 1;
  min-width: 0;
  padding: 11px 0;
  border: 0;
  background: transparent;
  outline: none;
}
.course-search:focus-within {
  box-shadow: inset 0 0 0 1px rgba(120, 225, 213, 0.6);
}
.filter-result {
  margin: 18px 4px 8px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--dim);
}
.course-section {
  margin-top: 48px;
}
.section-heading {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.section-emblem svg {
  width: 52px;
  height: 36px;
  fill: none;
  stroke: var(--teal);
  stroke-width: 2;
}
.section-emblem .solid {
  fill: rgba(120, 225, 213, 0.35);
}
.section-heading h2 {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-top: 6px;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 900;
}
.section-heading h2 span {
  font-size: 0.8em;
  color: var(--dim);
}
.section-description {
  color: var(--muted);
  font-size: 14px;
}
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.lesson-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-l);
  background: linear-gradient(180deg, rgba(20, 33, 45, 0.72), rgba(10, 17, 26, 0.8));
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
  transition:
    transform 0.6s var(--ease),
    box-shadow 0.4s;
}
a.lesson-card:hover {
  transform: translateY(-6px);
  box-shadow:
    inset 0 0 0 1px rgba(120, 225, 213, 0.35),
    0 30px 70px -30px rgba(120, 225, 213, 0.45);
}
.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: radial-gradient(60% 70% at 50% 50%, rgba(120, 225, 213, 0.1), transparent 70%), #060b13;
  overflow: hidden;
}
.card-poster {
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(1.04);
  transition:
    opacity 0.8s var(--ease),
    transform 1.2s var(--ease);
}
.card-poster.is-ready {
  opacity: 1;
  transform: none;
}
a.lesson-card:hover .card-poster {
  transform: scale(1.03);
}
.card-media::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 40%;
  background: linear-gradient(0deg, rgba(10, 17, 26, 0.9), transparent);
  pointer-events: none;
}
.card-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  translate: -50% -50%;
  border-radius: 50%;
  background: rgba(5, 9, 15, 0.55);
  box-shadow: inset 0 0 0 1.5px rgba(120, 225, 213, 0.7);
  backdrop-filter: blur(6px);
  opacity: 0;
  scale: 0.8;
  transition:
    opacity 0.4s,
    scale 0.5s var(--ease);
}
.card-play::after {
  content: "";
  position: absolute;
  left: 23px;
  top: 19px;
  border-left: 17px solid var(--teal);
  border-block: 10px solid transparent;
}
a.lesson-card:hover .card-play,
a.lesson-card:focus-visible .card-play {
  opacity: 1;
  scale: 1;
}
.lesson-card.is-live .card-play {
  opacity: 0;
}
.card-time {
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 1;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(5, 9, 15, 0.7);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-2);
}
.card-planned {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--dim);
  font-size: 13px;
  font-weight: 700;
}
.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding: 18px 20px 20px;
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-id {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--dim);
}
.course-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.course-status.new {
  color: var(--gold);
}
.course-status.new::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
}
.lesson-card h3 {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.4;
}
.lesson-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.card-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 12px;
}
.card-arrow {
  color: var(--teal);
  font-size: 16px;
  transition: transform 0.5s var(--ease);
}
a.lesson-card:hover .card-arrow {
  transform: rotate(45deg);
}
.lesson-card.planned {
  opacity: 0.7;
}
.empty-state {
  display: grid;
  justify-items: start;
  gap: 16px;
  padding: 40px;
  border-radius: var(--r-l);
  box-shadow: inset 0 0 0 1px var(--line);
}
.empty-state button {
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--teal);
  color: var(--teal-ink);
  font-weight: 800;
}

/* ---------------- note & footer ---------------- */
.map-note {
  padding-bottom: 80px;
}
.map-note-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 28px 32px;
  border-radius: var(--r-l);
  background: radial-gradient(80% 140% at 0% 0%, rgba(120, 225, 213, 0.1), transparent 60%), rgba(14, 24, 34, 0.6);
  box-shadow: inset 0 0 0 1px var(--line);
}
.note-orbit {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(120, 225, 213, 0.5);
  color: var(--teal);
}
.map-note strong {
  font-size: 18px;
}
.map-note p {
  color: var(--muted);
  font-size: 14px;
}
.map-footer {
  padding-top: 0;
  border-top: 0;
}

/* ---------------- responsive ---------------- */
@media (max-width: 1080px) {
  .map-hero-grid {
    grid-template-columns: 1fr;
  }
  .reel-frame {
    transform: none;
  }
  .learning-paths {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .map-summary {
    grid-template-columns: repeat(3, 1fr);
  }
  .map-summary > div {
    flex-direction: column;
    gap: 2px;
    margin-right: 0;
    padding: 18px 0 18px 14px;
    border-right: 0;
    border-left: 1px solid var(--line);
  }
  .map-summary > div:first-child {
    border-left: 0;
    padding-left: 0;
  }
  .map-summary p {
    grid-column: 1 / -1;
    justify-self: start;
    text-align: left;
    border-top: 1px solid var(--line);
  }
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    border-radius: var(--r-l);
  }
  .view-filters button {
    flex: 1;
    padding-inline: 8px;
  }
  .course-search {
    width: auto;
  }
  .section-heading {
    grid-template-columns: auto 1fr;
  }
  .section-description {
    grid-column: 1 / -1;
  }
  .map-note-inner {
    grid-template-columns: 1fr;
  }
  .reel-caption {
    flex-direction: column;
    align-items: flex-start;
  }
  .reel-kicker {
    display: none;
  }
}
