:root {
  --ink: #242424;
  --ink-2: #303030;
  --paper: #ffffff;
  --muted: #62656c;
  --purple: #6f2dbd;
  --purple-2: #a663cc;
  --lavender: #b298dc;
  --blue: #b8d0eb;
  --mint: #a7fff2;
  --danger: #ef6351;
  --ok: #49a078;
  --shadow: 0 22px 60px rgba(0, 0, 0, .18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: #f4f4f6;
  overflow: hidden;
}

button {
  font: inherit;
}

.app-shell {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 290px 1fr;
}

.sidebar {
  background: #202020;
  color: #fff;
  padding: 28px 18px;
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 8px;
}

.brand-lockup strong {
  display: block;
  font-size: 21px;
  line-height: .95;
  text-transform: uppercase;
}

.brand-lockup small {
  color: #d9d9d9;
}

.pin-mark {
  width: 38px;
  height: 50px;
  background: #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  position: relative;
  flex: 0 0 auto;
}

.pin-mark::after {
  content: "";
  width: 15px;
  height: 15px;
  background: var(--purple);
  border-radius: 50%;
  position: absolute;
  left: 12px;
  top: 12px;
}

.slide-nav {
  overflow: auto;
  padding-right: 4px;
}

.slide-nav button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #f4f4f4;
  text-align: left;
  padding: 12px 12px;
  margin-bottom: 6px;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  cursor: pointer;
}

.slide-nav button:hover,
.slide-nav button.active {
  background: rgba(255, 255, 255, .1);
}

.slide-nav span {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--purple);
  font-weight: 800;
}

.slide-nav small {
  display: block;
  color: #c9c9c9;
  line-height: 1.25;
}

.stage {
  min-width: 0;
  min-height: 0;
  width: 100%;
  display: grid;
  grid-template-rows: 96px minmax(0, 1fr) 94px;
  height: 100vh;
}

.topbar {
  min-width: 0;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 32px;
  position: relative;
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 12px;
  background: linear-gradient(90deg, var(--purple), var(--purple-2), var(--blue), var(--mint));
}

.course-title {
  min-width: 0;
  flex: 1 1 auto;
  font-weight: 800;
  font-size: clamp(20px, 2.2vw, 34px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.glass-icon {
  margin-left: auto;
  width: 44px;
  height: 64px;
  border: 7px solid #fff;
  border-top: 0;
  position: relative;
}

.glass-icon::before {
  content: "";
  position: absolute;
  left: -7px;
  right: -7px;
  top: 18px;
  border-top: 7px solid #fff;
}

.glass-icon::after {
  content: "";
  width: 10px;
  height: 30px;
  background: #fff;
  position: absolute;
  left: 10px;
  bottom: -30px;
  box-shadow: -16px 30px 0 -2px #fff, 16px 30px 0 -2px #fff;
}

.menu-toggle {
  display: none;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 0;
  background: rgba(255, 255, 255, .1);
  cursor: pointer;
}

.icon-button span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  margin: 5px auto;
}

.slide-frame {
  min-height: 0;
  min-width: 0;
  position: relative;
  background: #fff;
  overflow: hidden;
  display: grid;
  grid-template-rows: 5px minmax(0, 1fr);
}

.progress-line {
  height: 5px;
  background: #e4e4e8;
}

.progress-line span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--purple), var(--mint));
  transition: width .3s ease;
}

.slide {
  min-height: 0;
  padding: clamp(22px, 3vw, 48px);
  overflow: auto;
}

.cover-slide {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(280px, 1.05fr);
  align-items: center;
  gap: 42px;
  background: #252525;
  color: #fff;
  margin: calc(clamp(22px, 3vw, 48px) * -1);
  padding: clamp(42px, 6vw, 86px);
  position: relative;
  overflow: hidden;
}

.cover-slide::after {
  content: "1";
  position: absolute;
  right: -18px;
  bottom: -124px;
  font-weight: 900;
  font-size: min(52vw, 760px);
  line-height: .8;
  color: rgba(111, 45, 189, .42);
}

.cover-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.eyebrow {
  width: min(520px, 70%);
  height: 20px;
  border-radius: 999px;
  background: var(--purple);
  margin: 34px 0;
  box-shadow: 0 8px 12px rgba(0, 0, 0, .25);
}

.cover-copy h1 {
  font-size: clamp(44px, 5vw, 82px);
  line-height: .92;
  margin: 0 0 28px;
  letter-spacing: 0;
}

.cover-copy p {
  font-size: clamp(22px, 2.2vw, 34px);
  line-height: 1.18;
  max-width: 760px;
  font-weight: 800;
}

.cover-image {
  position: relative;
  z-index: 1;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.cover-image img,
.media-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.content-slide {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(320px, .95fr) minmax(360px, 1.05fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}

.copy-block h2 {
  font-size: clamp(30px, 3.4vw, 56px);
  line-height: 1;
  margin: 6px 0 18px;
}

.copy-block,
.cover-image,
.media-panel {
  min-width: 0;
}

.unit {
  color: var(--purple);
  text-transform: uppercase;
  font-weight: 900;
  font-size: 18px;
}

.intro {
  font-size: clamp(17px, 1.4vw, 23px);
  line-height: 1.45;
  color: #343434;
}

.media-panel {
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #ddd;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.info-card {
  border: 0;
  min-height: 104px;
  text-align: left;
  border-radius: 8px;
  padding: 18px;
  background: #f1edf8;
  border-left: 8px solid var(--purple);
  color: var(--ink);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease;
}

.info-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(111, 45, 189, .18);
}

.info-card strong {
  display: block;
  font-size: 19px;
  margin-bottom: 8px;
}

.info-card small {
  color: var(--muted);
  line-height: 1.35;
}

.quote-strip {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 8px;
  background: #242424;
  color: #fff;
  font-weight: 700;
}

.quiz-slide {
  max-width: 1160px;
  margin: 0 auto;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.quiz-options button {
  border: 2px solid #dfd8eb;
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  min-height: 90px;
  text-align: left;
  cursor: pointer;
}

.quiz-options button.correct {
  border-color: var(--ok);
  background: #eaf7ef;
}

.quiz-options button.wrong {
  border-color: var(--danger);
  background: #fdecea;
}

.controlbar {
  min-width: 0;
  background: #f7f7f8;
  border-top: 1px solid #dedee4;
  display: grid;
  grid-template-columns: 80px 1fr 80px;
  align-items: center;
  gap: 18px;
  padding: 14px 24px;
}

.nav-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: var(--ink);
  box-shadow: 0 7px 16px rgba(0, 0, 0, .22);
  cursor: pointer;
}

.nav-button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.chevron {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-top: 4px solid #fff;
  border-right: 4px solid #fff;
}

.chevron.left { transform: rotate(-135deg) translate(-2px, -2px); }
.chevron.right { transform: rotate(45deg) translate(-2px, 2px); }

.audio-panel {
  min-width: 0;
  max-width: 920px;
  justify-self: center;
  width: 100%;
  display: grid;
  grid-template-columns: 52px minmax(120px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 20px rgba(0, 0, 0, .08);
}

.play-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--purple);
  cursor: pointer;
  display: grid;
  place-items: center;
}

#playIcon {
  width: 0;
  height: 0;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 17px solid #fff;
  margin-left: 3px;
}

#playIcon.pause {
  width: 18px;
  height: 22px;
  border: 0;
  border-left: 6px solid #fff;
  border-right: 6px solid #fff;
  margin-left: 0;
}

.audio-meta {
  min-width: 0;
  font-weight: 700;
}

.audio-track {
  height: 8px;
  margin-top: 6px;
  border-radius: 999px;
  background: #ececf0;
  overflow: hidden;
}

.audio-track span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--purple), var(--blue));
}

.ghost-button {
  border: 2px solid var(--purple);
  color: var(--purple);
  background: #fff;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

.info-dialog {
  width: min(760px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.info-dialog::backdrop {
  background: rgba(0, 0, 0, .56);
}

#dialogContent {
  padding: 36px;
  background: linear-gradient(180deg, #fff, #f6f2fb);
}

#dialogContent h3 {
  margin: 0 0 12px;
  font-size: 30px;
}

#dialogContent p {
  font-size: 19px;
  line-height: 1.5;
}

.dialog-close {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: #fff;
  color: var(--purple);
  font-size: 28px;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 5;
    inset: 0 auto 0 0;
    width: min(320px, 88vw);
    transform: translateX(-102%);
    transition: transform .22s ease;
    box-shadow: var(--shadow);
  }

  body.menu-open .sidebar {
    transform: translateX(0);
  }

  .menu-toggle {
    display: block;
  }

  .stage {
    grid-template-rows: 82px minmax(0, 1fr) auto;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
  }

  .topbar {
    padding: 0 16px;
  }

  .glass-icon {
    display: none;
  }

  .cover-slide,
  .content-slide {
    grid-template-columns: 1fr;
  }

  .cover-image,
  .media-panel {
    aspect-ratio: 16 / 9;
  }

  .card-grid,
  .quiz-options {
    grid-template-columns: 1fr;
  }

  .controlbar {
    grid-template-columns: 56px minmax(0, 1fr) 56px;
    gap: 8px;
    padding: 10px;
  }

  .audio-panel {
    grid-template-columns: 44px 1fr;
  }

  .ghost-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}
