:root {
  color-scheme: dark;
  --bg: #0b1220;
  --panel: rgba(17, 24, 39, 0.78);
  --panel-strong: rgba(31, 41, 55, 0.88);
  --stroke: rgba(255, 255, 255, 0.1);
  --muted: #94a3b8;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, rgba(79, 70, 229, 0.26), transparent 34rem),
    radial-gradient(circle at 78% 8%, rgba(6, 182, 212, 0.16), transparent 30rem),
    linear-gradient(180deg, #0b1220 0%, #111827 42%, #0b1220 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent 78%);
}

a,
button,
summary {
  transition: all 180ms ease;
}

.loader-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--stroke);
  border-radius: 24px;
  padding: 1.1rem 1.25rem;
  background: rgba(17, 24, 39, 0.78);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.42);
}

.loader-mark {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: conic-gradient(from 90deg, #06b6d4, #7c3aed, #4f46e5, #06b6d4);
  animation: spin 1.4s linear infinite;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: 340px;
  overflow-y: auto;
  border-right: 1px solid var(--stroke);
  background: rgba(11, 18, 32, 0.86);
  backdrop-filter: blur(22px);
  box-shadow: 30px 0 80px rgba(0, 0, 0, 0.32);
}

.sidebar-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem;
  background: linear-gradient(180deg, rgba(11, 18, 32, 0.96), rgba(11, 18, 32, 0.72));
  backdrop-filter: blur(20px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed 56%, #06b6d4);
  box-shadow: 0 16px 42px rgba(79, 70, 229, 0.42);
  font-family: Manrope, Inter, sans-serif;
  font-weight: 900;
}

.sidebar-search {
  position: sticky;
  top: 74px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 1rem 0.75rem;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 0.75rem 0.9rem;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
}

.sidebar-search svg {
  width: 17px;
  color: #67e8f9;
}

.sidebar-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 0.9rem;
}

.search-results {
  margin: 0 1rem 1rem;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: rgba(17, 24, 39, 0.92);
  overflow: hidden;
}

.search-results a {
  display: block;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.search-results a:hover {
  background: rgba(79, 70, 229, 0.18);
}

.sidebar-nav {
  padding: 0.3rem 0.85rem 2rem;
}

.nav-link,
.module-summary,
.lesson-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  border-radius: 14px;
  padding: 0.72rem 0.8rem;
  color: #cbd5e1;
  text-align: left;
}

.nav-link:hover,
.module-summary:hover,
.lesson-link:hover,
.active-nav {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.nav-link svg,
.module-summary svg {
  width: 17px;
  min-width: 17px;
}

.module-block {
  margin-top: 0.35rem;
}

.module-summary {
  cursor: pointer;
  list-style: none;
  justify-content: space-between;
}

.module-summary::-webkit-details-marker {
  display: none;
}

.module-lessons {
  margin: 0.15rem 0 0.55rem 0.95rem;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding-left: 0.65rem;
}

.lesson-link {
  align-items: flex-start;
  padding: 0.58rem 0.65rem;
  font-size: 0.83rem;
}

.lesson-dot {
  margin-top: 0.22rem;
  width: 0.62rem;
  height: 0.62rem;
  min-width: 0.62rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
}

.lesson-dot.done {
  border-color: transparent;
  background: linear-gradient(135deg, #06b6d4, #7c3aed);
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.34);
}

.sidebar-backdrop {
  display: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 78px;
  border-bottom: 1px solid var(--stroke);
  padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(11, 18, 32, 0.7);
  backdrop-filter: blur(22px);
}

.icon-btn {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.icon-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
}

.icon-btn svg {
  width: 18px;
}

.top-progress {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  background: rgba(255, 255, 255, 0.055);
}

.top-progress span {
  font-size: 0.78rem;
  color: #e2e8f0;
}

.top-progress div {
  width: 84px;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
}

.top-progress div span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4f46e5, #7c3aed, #06b6d4);
}

.page-wrap {
  min-height: calc(100vh - 78px);
  padding: clamp(1rem, 4vw, 2.5rem);
}

.hero-panel,
.glass-card,
.resource-card,
.lesson-section,
.stat-card {
  border: 1px solid var(--stroke);
  background: var(--panel);
  backdrop-filter: blur(22px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.hero-panel {
  overflow: hidden;
  border-radius: 30px;
}

.hero-art {
  min-height: 320px;
  background-image: linear-gradient(90deg, rgba(11, 18, 32, 0.06), rgba(11, 18, 32, 0.72)), url("./assets/course-cover.png");
  background-size: cover;
  background-position: center;
}

.gradient-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-radius: 16px;
  padding: 0.82rem 1rem;
  background: linear-gradient(135deg, #4f46e5, #7c3aed 58%, #06b6d4);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 18px 42px rgba(79, 70, 229, 0.34);
}

.gradient-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 60px rgba(6, 182, 212, 0.24);
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 0.82rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 700;
}

.secondary-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.stat-card {
  border-radius: 22px;
  padding: 1rem;
}

.stat-card .value {
  font-family: Manrope, Inter, sans-serif;
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  font-weight: 900;
}

.progress-rail {
  height: 0.62rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4f46e5, #7c3aed, #06b6d4);
}

.lesson-section {
  border-radius: 22px;
  overflow: hidden;
}

.lesson-section summary {
  display: flex;
  cursor: pointer;
  list-style: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.2rem;
}

.lesson-section summary::-webkit-details-marker {
  display: none;
}

.lesson-section[open] summary {
  border-bottom: 1px solid var(--stroke);
}

.lesson-content {
  padding: 1.2rem;
  color: #dbe5f2;
}

.lesson-content h1,
.lesson-content h2,
.lesson-content h3 {
  margin: 1.2rem 0 0.5rem;
  color: #fff;
  font-family: Manrope, Inter, sans-serif;
  font-weight: 850;
}

.lesson-content h1 {
  font-size: 1.5rem;
}

.lesson-content h2 {
  font-size: 1.22rem;
}

.lesson-content h3 {
  font-size: 1.05rem;
}

.lesson-content p {
  margin: 0.85rem 0;
  line-height: 1.78;
}

.lesson-content ul,
.lesson-content ol {
  margin: 0.8rem 0 1rem 1.2rem;
}

.lesson-content li {
  margin: 0.45rem 0;
  line-height: 1.68;
}

.lesson-content ul {
  list-style: disc;
}

.lesson-content ol {
  list-style: decimal;
}

.lesson-content a {
  color: #67e8f9;
  text-decoration: underline;
  text-decoration-color: rgba(103, 232, 249, 0.38);
}

.taskbox {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  margin-right: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 0.25rem;
  vertical-align: -0.1rem;
}

.toc-card {
  position: sticky;
  top: 100px;
  border: 1px solid var(--stroke);
  border-radius: 22px;
  padding: 1rem;
  background: rgba(17, 24, 39, 0.72);
  backdrop-filter: blur(20px);
}

.resource-card {
  border-radius: 22px;
  padding: 1rem;
}

.resource-card:hover,
.glass-card:hover,
.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(103, 232, 249, 0.28);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(103, 232, 249, 0.22);
  border-radius: 999px;
  padding: 0.34rem 0.62rem;
  background: rgba(6, 182, 212, 0.08);
  color: #a5f3fc;
  font-size: 0.78rem;
  font-weight: 700;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--stroke);
  padding: 1.5rem clamp(1rem, 4vw, 2.5rem);
}

@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-105%);
  }

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

  .sidebar-backdrop.open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
  }
}

@media (max-width: 640px) {
  .sidebar {
    width: min(92vw, 340px);
  }

  .top-progress div {
    width: 58px;
  }

  .hero-art {
    min-height: 220px;
  }
}
