.background-video--lessons {
  opacity: 0.55;
}

.theory-page {
  position: relative;
  z-index: 2;
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
  padding: clamp(2.4rem, 6vw, 4rem) clamp(1.6rem, 5vw, 5rem) clamp(3rem, 8vw, 5rem);
}

.theory-hero {
  display: grid;
  gap: 1.4rem;
  max-width: 960px;
}

.theory-hero__eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}

.theory-hero__title {
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 3.8rem);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.theory-hero__lead {
  margin: 0;
  color: var(--muted, #8b94b4);
  line-height: 1.7;
  max-width: 720px;
}

.theory-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem clamp(1.6rem, 4vw, 2.4rem);
}

.theory-stat {
  display: grid;
  gap: 0.25rem;
}

.theory-stat__value {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.theory-stat__label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.theory-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: clamp(1.6rem, 5vw, 3rem);
}

@media (max-width: 1080px) {
  .theory-layout {
    grid-template-columns: 1fr;
  }
}

.theory-sidebar {
  display: grid;
  gap: 1.4rem;
  align-content: start;
}

.theory-search {
  display: grid;
  gap: 0.6rem;
  padding: 1.2rem;
  border-radius: 1.2rem;
  border: 1px solid rgba(120, 0, 255, 0.28);
  background: rgba(10, 14, 24, 0.78);
  backdrop-filter: blur(8px);
}

.theory-search__label {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.theory-search input[type="search"] {
  padding: 0.75rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(120, 0, 255, 0.35);
  background: rgba(5, 7, 13, 0.82);
  color: #f2f6ff;
  font-family: inherit;
}

.theory-search input[type="search"]::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.theory-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.theory-filter__item {
  border: 1px solid rgba(120, 0, 255, 0.35);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.theory-filter__item:hover {
  border-color: rgba(63, 157, 255, 0.65);
  color: #f2f6ff;
}

.theory-filter__item.is-active {
  background: rgba(120, 0, 255, 0.35);
  color: #f2f6ff;
  border-color: rgba(120, 0, 255, 0.72);
}

.theory-list {
  display: grid;
  gap: 0.9rem;
  max-height: calc(100vh - 18rem);
  overflow: auto;
  padding-right: 0.4rem;
}

.theory-list::-webkit-scrollbar {
  width: 0.4rem;
}

.theory-list::-webkit-scrollbar-thumb {
  background: rgba(120, 0, 255, 0.5);
  border-radius: 999px;
}

.theory-card {
  border: 1px solid rgba(120, 0, 255, 0.28);
  border-radius: 1.4rem;
  padding: 1.1rem 1.2rem;
  background: rgba(10, 14, 24, 0.78);
  backdrop-filter: blur(8px);
  display: grid;
  gap: 0.6rem;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.theory-card:hover {
  border-color: rgba(63, 157, 255, 0.65);
  transform: translateY(-2px);
}

.theory-card.is-active {
  border-color: rgba(120, 0, 255, 0.85);
  background: rgba(15, 20, 34, 0.92);
}

.theory-card__category {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.45);
}

.theory-card__title {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.theory-card__summary {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
}

.theory-card__meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
}

.theory-content {
  border: 1px solid rgba(120, 0, 255, 0.28);
  border-radius: 1.6rem;
  background: rgba(5, 7, 13, 0.9);
  padding: clamp(1.6rem, 3vw, 2.4rem);
  min-height: 520px;
  display: grid;
}

.lesson-placeholder {
  display: grid;
  gap: 0.8rem;
  align-content: center;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

.lesson-view {
  display: grid;
  gap: 1.6rem;
}

.lesson-view__header {
  display: grid;
  gap: 0.6rem;
}

.lesson-view__category {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.lesson-view__title {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: 0.08em;
}

.lesson-view__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
}

.lesson-view__body {
  display: grid;
  gap: 1rem;
  color: rgba(242, 246, 255, 0.88);
  line-height: 1.68;
}

.lesson-view__body h2,
.lesson-view__body h3 {
  margin-top: 1.4rem;
  letter-spacing: 0.06em;
}

.lesson-view__body pre {
  background: rgba(15, 20, 34, 0.92);
  border-radius: 0.9rem;
  padding: 1rem 1.2rem;
  overflow: auto;
  border: 1px solid rgba(63, 157, 255, 0.28);
}

.lesson-view__body code {
  font-family: "IBM Plex Mono", "Fira Code", Consolas, "Courier New", monospace;
  font-size: 0.85rem;
}

.lesson-view__footer {
  border-top: 1px solid rgba(120, 0, 255, 0.28);
  padding-top: 1.2rem;
  display: grid;
  gap: 0.8rem;
}

.lesson-view__labs {
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  list-style: none;
}

.lesson-view__labs a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(63, 157, 255, 0.4);
  color: rgba(242, 246, 255, 0.85);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.lesson-view__labs a:hover {
  background: rgba(63, 157, 255, 0.22);
  border-color: rgba(63, 157, 255, 0.6);
}

.theory-empty {
  padding: 1rem;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  border: 1px dashed rgba(120, 0, 255, 0.35);
  border-radius: 1.1rem;
}
