:root {
  --ink: #20252b;
  --muted: #64717a;
  --soft: #f4f5f4;
  --card: #ffffff;
  --line: #d9dedf;
  --orange: #f04f23;
  --orange-dark: #c83d1a;
  --blue: #7faebe;
  --slate: #536466;
  --navy: #112c3f;
  --red: #d81032;
  --green: #28735a;
  --shadow: 0 18px 48px rgba(28, 37, 44, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--soft);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Barlow, Arial, sans-serif;
  background:
    linear-gradient(180deg, #ffffff 0, #ffffff 360px, var(--soft) 360px),
    var(--soft);
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(2.5rem, 7vw, 5.9rem);
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.65rem, 3vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.08;
  letter-spacing: 0;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.primary-button,
.secondary-button,
.ghost-button,
.completion-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 900;
  letter-spacing: 0;
}

.primary-button {
  background: var(--orange);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--orange-dark);
}

.secondary-button {
  border-color: var(--line);
  background: #ffffff;
  color: var(--navy);
}

.secondary-button:hover {
  border-color: var(--navy);
}

.secondary-button:disabled,
.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.54;
}

.ghost-button {
  min-height: 38px;
  border-color: rgba(255, 255, 255, 0.28);
  background: transparent;
  color: #ffffff;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(180px, 1fr);
  gap: 18px;
  align-items: center;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(17, 44, 63, 0.96);
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(17, 44, 63, 0.16);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  font-weight: 900;
}

.brand-link img {
  width: 148px;
  height: auto;
  filter: brightness(0) invert(1);
}

.brand-link span {
  padding-left: 13px;
  border-left: 1px solid rgba(255, 255, 255, 0.24);
}

.topnav {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}

.topnav a {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 800;
  line-height: 34px;
}

.topnav a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.account-cluster {
  display: inline-flex;
  justify-content: end;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.account-cluster span {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main {
  padding: 0 clamp(18px, 4vw, 56px) 54px;
}

.course-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  padding: clamp(18px, 3vw, 34px) 0 clamp(28px, 5vw, 54px);
}

.course-hero-copy {
  max-width: 880px;
}

.course-hero .eyebrow {
  color: var(--orange);
}

.course-hero p:not(.eyebrow) {
  max-width: 720px;
  font-size: 1.18rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-media {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--navy);
  box-shadow: var(--shadow);
}

.hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}

.progress-band,
.workbook-band {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.course-guidance {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 24px;
  padding: 28px 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.course-guidance-copy {
  min-width: 0;
  padding-right: clamp(28px, 4vw, 56px);
}

.course-guidance-copy + .course-guidance-copy {
  padding-right: 0;
  padding-left: clamp(28px, 4vw, 56px);
  border-left: 1px solid var(--line);
}

.course-guidance h2 {
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.15;
}

.course-guidance p {
  max-width: 42rem;
  margin-bottom: 14px;
  color: #52636f;
  font-size: 0.96rem;
  line-height: 1.55;
}

.course-guidance p:last-child {
  margin-bottom: 0;
}

.progress-band div:first-child,
.progress-band div:last-child {
  display: grid;
  gap: 2px;
}

.progress-band span {
  color: var(--orange);
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1;
}

.progress-band strong {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ecec;
}

.progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--red));
}

.workbook-band {
  grid-template-columns: minmax(0, 1fr) auto;
}

.workbook-band h2 {
  max-width: 820px;
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.section-heading {
  margin: 34px 0 18px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.module-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(28, 37, 44, 0.09);
}

.module-card a {
  display: flex;
  min-height: 100%;
  flex-direction: column;
}

.module-card:hover {
  transform: translateY(-2px);
  transition: transform 160ms ease;
}

.module-card.is-locked {
  opacity: 0.52;
}

.module-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 18px;
}

.module-card p {
  margin-bottom: 18px;
}

.module-poster {
  position: relative;
  display: grid;
  min-height: 360px;
  align-content: center;
  overflow: hidden;
  padding: 28px;
  color: #ffffff;
}

.module-poster.is-compact {
  min-height: 210px;
}

.tone-orange {
  background: var(--orange);
}

.tone-blue {
  background: var(--blue);
}

.tone-slate {
  background: var(--slate);
}

.tone-brick {
  background:
    linear-gradient(135deg, rgba(17, 44, 63, 0.72), rgba(240, 79, 35, 0.7)),
    var(--navy);
}

.poster-title span {
  display: block;
  font-size: clamp(2.4rem, 5vw, 5rem);
  font-weight: 900;
  line-height: 0.9;
  text-transform: uppercase;
}

.poster-title strong {
  display: block;
  max-width: 620px;
  margin-top: 8px;
  font-size: clamp(1.25rem, 2.8vw, 2.5rem);
  line-height: 0.96;
  text-transform: uppercase;
}

.poster-duration {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.module-poster.is-compact .poster-title span {
  font-size: 2.35rem;
}

.module-poster.is-compact .poster-title strong {
  font-size: 1.2rem;
}

.module-poster.is-compact .poster-duration {
  top: 14px;
  right: 14px;
}

.module-page {
  padding-top: clamp(18px, 3vw, 32px);
}

.module-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  gap: 24px;
  align-items: start;
}

.video-shell,
.lesson-panel,
.module-rail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.video-shell {
  padding: 18px;
}

.video-title-row {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.video-title-row h2 {
  max-width: 920px;
  margin-bottom: 0;
}

.duration-pill {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--navy);
  font-weight: 900;
}

.video-frame {
  position: relative;
  display: block;
  width: 100%;
  max-height: min(48vh, 470px);
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  background: #101010;
  text-align: left;
}

.video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-frame .module-poster {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: clamp(18px, 2.4vw, 28px);
}

.video-frame .poster-title span {
  font-size: clamp(2.4rem, 4vw, 4.4rem);
}

.video-frame .poster-title strong {
  font-size: clamp(1.15rem, 2.2vw, 2rem);
}

.play-control {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 68px;
  height: 54px;
  border-radius: 8px;
  background: #050505;
  transform: translate(-50%, -50%);
}

.play-control::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-left: 20px solid #ffffff;
  content: "";
  transform: translate(-38%, -50%);
}

.video-frame.was-played .play-control {
  background: var(--orange);
}

.completion-button {
  width: 100%;
  margin-top: 14px;
  border-color: var(--line);
  background: #ffffff;
  color: var(--navy);
}

.completion-button.is-complete {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.module-nav-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.module-side {
  display: grid;
  gap: 18px;
}

.lesson-panel {
  padding: 24px;
}

.lesson-panel h3 {
  margin-bottom: 18px;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
}

.lesson-panel p:not(.eyebrow) {
  color: #4f5a60;
  font-size: 1.08rem;
}

.module-rail {
  display: grid;
  overflow: hidden;
}

.module-rail a {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.module-rail a:last-child {
  border-bottom: 0;
}

.module-rail a:hover,
.module-rail a.is-active {
  background: #f7fafb;
}

.module-rail a.is-locked {
  opacity: 0.45;
}

.module-rail span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--soft);
  color: var(--navy);
  font-weight: 900;
}

.module-rail a.is-active span {
  background: var(--orange);
  color: #ffffff;
}

.module-rail a.is-complete span {
  background: var(--green);
  color: #ffffff;
}

.module-rail strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.locked-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(17, 44, 63, 0.94), rgba(83, 100, 102, 0.86)),
    var(--navy);
}

.locked-panel {
  width: min(640px, 100%);
  padding: clamp(28px, 6vw, 52px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.locked-logo {
  width: 260px;
  margin-bottom: 34px;
}

.locked-panel h1 {
  font-size: clamp(2.3rem, 7vw, 4.5rem);
}

.status-message {
  padding: 12px 14px;
  border-radius: 6px;
  background: #fff3ee;
  color: var(--orange-dark);
  font-weight: 800;
}

.loading-mark {
  width: 28px;
  height: 28px;
  border: 3px solid #d8e1e5;
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .topnav,
  .account-cluster {
    justify-content: start;
  }

  .course-hero,
  .course-guidance,
  .module-layout {
    grid-template-columns: 1fr;
  }

  .course-guidance-copy {
    padding-right: 0;
  }

  .course-guidance-copy + .course-guidance-copy {
    margin-top: 24px;
    padding-top: 24px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  main {
    padding-inline: 14px;
  }

  .topbar {
    padding-inline: 14px;
  }

  .brand-link {
    align-items: start;
    flex-direction: column;
  }

  .brand-link span {
    padding-left: 0;
    border-left: 0;
  }

  .topnav {
    width: 100%;
    overflow-x: auto;
  }

  .course-hero {
    min-height: 0;
  }

  .progress-band,
  .course-guidance,
  .workbook-band {
    grid-template-columns: 1fr;
  }

  .module-grid {
    grid-template-columns: 1fr;
  }

  .module-poster,
  .module-poster.is-compact {
    min-height: 260px;
  }

  .video-frame {
    max-height: none;
  }

  .poster-title span,
  .module-poster.is-compact .poster-title span {
    font-size: 2.25rem;
  }

  .poster-title strong,
  .module-poster.is-compact .poster-title strong {
    font-size: 1.15rem;
  }

  .video-title-row,
  .module-nav-row {
    flex-direction: column;
  }
}
