:root {
  --bg: #ffffff;
  --bg-warm: #fff7f2;
  --bg-raised: #ffffff;
  --bg-hover: #fff1ea;
  --border: #eadfd8;
  --text: #252422;
  --muted: #4a4a4a;
  --orange: #eb5e28;
  --orange-soft: #fff1ea;
  --green: #2f7d4a;
  --green-soft: #eaf6ee;
  --accent: var(--orange);
  --accent-soft: var(--orange-soft);
  --sidebar-width: 300px;
  --radius: 12px;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

button,
a {
  font: inherit;
  color: inherit;
}

a {
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--orange);
  color: #fff;
}

.site-header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.learn-page .site-header-inner {
  max-width: none;
}

.site-logo {
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
}

.site-nav {
  display: flex;
  gap: 0.35rem;
}

.site-nav-link {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  color: #fff;
}

.site-nav-link:hover,
.site-nav-link.is-active {
  background: rgba(255, 255, 255, 0.18);
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.page.narrow {
  max-width: 720px;
}

.site-notice {
  max-width: 40rem;
  margin: 0 0 2rem;
  padding: 1.15rem 1.25rem 1.25rem;
  background: var(--orange-soft);
  border: 1px solid var(--border);
  border-left: 4px solid var(--orange);
  border-radius: var(--radius);
}

.site-notice h2 {
  margin: 0.2rem 0 0.7rem;
  font-size: 1.15rem;
  line-height: 1.35;
}

.site-notice p {
  margin: 0 0 0.65rem;
  color: var(--muted);
  line-height: 1.6;
}

.site-notice p:last-child {
  margin-bottom: 0;
}

.hero,
.page-intro {
  max-width: 40rem;
  margin-bottom: 2.5rem;
}

.hero h1,
.page-intro h1,
.landing-copy h1 {
  margin: 0.35rem 0 0.75rem;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
}

.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.lede {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 1.05rem;
}

.hero-actions,
.section-head {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.35rem;
}

.section-head {
  justify-content: space-between;
  margin: 0 0 1rem;
}

.section-head h2 {
  margin: 0;
}

.section-head a,
.back-link {
  color: var(--muted);
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
}

.back-link.compact {
  font-size: 0.8rem;
  margin-bottom: 0.45rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 0.75rem 1.1rem;
  border: 1px solid var(--border);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-ghost {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.course-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.course-card:hover {
  border-color: var(--accent);
}

.course-card img,
.card-fallback {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg-hover);
}

.card-fallback.large {
  min-height: 220px;
}

.card-body {
  padding: 1rem 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.card-body h3 {
  margin: 0;
  font-size: 1.05rem;
}

.card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  flex: 1;
}

.card-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.landing {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
  margin-bottom: 2.5rem;
}

.landing-media img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}

.landing-copy .btn {
  margin-top: 1.1rem;
}

.outline {
  display: grid;
  gap: 1rem;
}

.outline-module {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--orange);
}

.outline-module:nth-child(even) {
  border-left-color: var(--green);
}

.outline-module h3 {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--orange);
}

.outline-module:nth-child(even) h3 {
  color: var(--green);
}

.outline-module ol {
  margin: 0;
  padding-left: 1.15rem;
}

.outline-module li {
  margin: 0.3rem 0;
}

.outline-module a:hover {
  color: var(--accent);
}

.contact-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.5rem;
}

.contact-card p {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.contact-card p.contact-email {
  margin: 0;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.learn-page {
  height: 100%;
}

.learn-page html,
.learn-page,
.learn-page .app {
  height: 100%;
}

.learn-page .app {
  min-height: calc(100vh - 58px);
}

.player-empty a {
  color: var(--accent);
}

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

  .site-header-inner {
    flex-wrap: wrap;
  }
}

.app {
  display: flex;
  min-height: 100%;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-warm);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 58px);
  position: sticky;
  top: 58px;
}

.sidebar-header {
  padding: 1.1rem 1.15rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.brand {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.course-title {
  margin: 0.35rem 0 0;
  font-size: 1.05rem;
  line-height: 1.3;
}

.progress-wrap {
  margin-top: 0.85rem;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.progress-track {
  height: 6px;
  background: var(--orange-soft);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid #f3d2c4;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--green);
  border-radius: inherit;
  transition: width 0.2s ease;
}

.nav {
  overflow: auto;
  padding: 0.75rem 0.65rem 1.25rem;
  flex: 1;
}

.module {
  margin-bottom: 0.55rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid transparent;
}

.module.tone-orange {
  background: var(--orange-soft);
  border-color: #f3d2c4;
}

.module.tone-green {
  background: var(--green-soft);
  border-color: #cfe6d6;
}

.module-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: transparent;
  color: var(--orange);
  border: 0;
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.module.tone-green .module-toggle {
  color: var(--green);
}

.module-toggle:hover {
  filter: brightness(0.95);
}

.module-toggle .chevron {
  transition: transform 0.15s ease;
}

.module.collapsed .chevron {
  transform: rotate(-90deg);
}

.module.collapsed .lessons {
  display: none;
}

.lessons {
  list-style: none;
  margin: 0;
  padding: 0 0 0.35rem;
}

.lesson-link {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--text);
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.35;
}

.lesson-link:hover {
  background: var(--bg-hover);
}

.lesson-link.active {
  background: #fff;
  box-shadow: inset 4px 0 0 var(--orange);
  font-weight: 600;
}

.module.tone-green .lesson-link.active {
  box-shadow: inset 4px 0 0 var(--green);
}

.main {
  flex: 1;
  min-width: 0;
  padding: 1.25rem 1.5rem 2.5rem;
}

.topbar {
  display: none;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.menu-btn {
  background: var(--bg-raised);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}

.lesson-heading {
  margin: 0 0 1rem;
  font-size: 1.55rem;
  font-weight: 650;
  line-height: 1.25;
}

.player-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.player-frame iframe,
.player-frame video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

.player-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 1.5rem;
  text-align: center;
}

.nav-buttons {
  display: flex;
  gap: 0.75rem;
  margin: 1rem 0 0;
}

.nav-buttons button {
  flex: 1;
  background: var(--bg-raised);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  cursor: pointer;
}

.nav-buttons button:hover:not(:disabled) {
  border-color: var(--orange);
  color: var(--orange);
}

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

.description {
  margin-top: 1.35rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 70ch;
}

.description:empty {
  display: none;
}

.backdrop {
  display: none;
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    z-index: 20;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    height: 100%;
  }

  .sidebar.open {
    transform: none;
  }

  .topbar {
    display: flex;
  }

  .backdrop.visible {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 15;
  }

  .main {
    padding: 1rem 1rem 2rem;
  }
}
