.site-shell {
  position: relative;
}
.subtle-bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 80% 25%, rgba(255, 81, 0, 0.08), transparent 40%),
    url("../img/background.png");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0.14;
  filter: saturate(0.85) contrast(1.05);
}
.site-shell > :not(.subtle-bg-layer):not(.topbar) {
  position: relative;
  z-index: 1;
}

.library-main {
  padding-top: 132px;
}
.lib-hero {
  max-width: 1320px;
  margin: 0 auto;
  padding: 36px 8% 48px;
}
.lib-hero h1 {
  margin: 12px 0 16px;
  font-size: clamp(38px, 4.8vw, 66px);
  font-weight: 900;
  line-height: 1.18;
}
.lib-hero h1 span {
  color: var(--orange);
}
.lib-hero p {
  margin: 0;
  max-width: 720px;
  font-size: 18px;
  line-height: 1.85;
  color: #b5b5b5;
}
.lib-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.lib-pill {
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid #2b1e18;
  background: rgba(12, 10, 9, 0.85);
  color: #d4d4d4;
  font-size: 15px;
  font-weight: 700;
  transition: 0.2s;
}
.lib-pill:hover,
.lib-pill.active-pill {
  border-color: var(--orange);
  color: var(--orange);
}
.lib-section {
  max-width: 1320px;
  margin: 0 auto;
  padding: 36px 8% 85px;
}
.lib-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.lib-section-head h2 {
  margin: 8px 0 0;
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 900;
}
.lib-section-head h2 span {
  color: var(--orange);
}
.lib-count {
  font:
    700 13px/1 "Rajdhani",
    sans-serif;
  letter-spacing: 2px;
  color: #a3a3a3;
  padding: 8px 14px;
  border: 1px solid #261b15;
  border-radius: 999px;
  background: rgba(10, 9, 8, 0.85);
}
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.subject-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: right;
  padding: 24px 24px 22px;
  border-radius: 16px;
  border: 1px solid #261c17;
  background: rgba(11, 10, 9, 0.88);
  color: #fff;
  font-family: "Tajawal", sans-serif;
  cursor: pointer;
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    background 0.22s ease;
}
.subject-btn:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 81, 0, 0.65);
}
.subject-btn.active {
  border-color: var(--orange);
  background: linear-gradient(
    150deg,
    rgba(255, 81, 0, 0.14),
    rgba(12, 10, 9, 0.95)
  );
  box-shadow: 0 10px 30px rgba(255, 81, 0, 0.12);
}
.sub-code {
  font:
    700 12px/1 "Rajdhani",
    sans-serif;
  letter-spacing: 1.5px;
  color: var(--orange);
}
.subject-btn h3 {
  margin: 12px 0 6px;
  font-size: 20px;
  font-weight: 800;
}
.subject-btn p {
  margin: 0;
  font-size: 14px;
  color: #9c9c9c;
  line-height: 1.6;
}
.subject-workspace {
  margin-top: 28px;
  padding: 32px;
  border-radius: 20px;
  border: 1px solid rgba(255, 81, 0, 0.35);
  background: rgba(9, 8, 8, 0.92);
  backdrop-filter: blur(10px);
}
.workspace-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid #221814;
  margin-bottom: 24px;
}
.workspace-top h3 {
  margin: 6px 0 0;
  font-size: 26px;
  font-weight: 900;
}
.workspace-note {
  font-size: 14px;
  color: #a6a6a6;
}
.chapters-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.chapter-box {
  padding: 22px;
  border-radius: 14px;
  border: 1px solid #241a16;
  background: #070707;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chapter-box.is-locked {
  opacity: 0.62;
  border-style: dashed;
}
.chapter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.chapter-code {
  font:
    700 12px/1 "Rajdhani",
    sans-serif;
  letter-spacing: 1.5px;
  color: var(--orange);
}
.chapter-badge {
  font:
    700 11px/1 "Rajdhani",
    sans-serif;
  padding: 5px 9px;
  border-radius: 6px;
  background: rgba(255, 81, 0, 0.12);
  color: #ffb085;
}
.chapter-box.is-locked .chapter-badge {
  background: rgba(255, 255, 255, 0.06);
  color: #999;
}
.chapter-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #f5f5f5;
}
.chapter-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.doc-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid #261b16;
  background: #0d0b0a;
  color: #d8d8d8;
  font-size: 14px;
  font-weight: 700;
  transition: 0.2s;
}
.doc-link:hover {
  border-color: var(--orange);
  color: var(--orange);
}
.locked-msg {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: #888;
  font-size: 13px;
}
.chapter2-section {
  padding-top: 24px;
  padding-bottom: 110px;
}
.chapter2-banner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 32px 36px;
  border-radius: 20px;
  border: 1px solid rgba(255, 81, 0, 0.4);
  background: linear-gradient(
    135deg,
    rgba(255, 81, 0, 0.09),
    rgba(9, 8, 8, 0.94) 60%
  );
  margin-bottom: 24px;
}
.chapter2-banner h2 {
  margin: 8px 0 10px;
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 900;
}
.chapter2-banner h2 span {
  color: var(--orange);
}
.chapter2-banner p {
  margin: 0;
  max-width: 640px;
  color: #b0b0b0;
  font-size: 16px;
  line-height: 1.75;
}
.chapter2-badge {
  shrink: 0;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--orange);
  color: #050505;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}
.videos-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.video-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid #261c17;
  background: rgba(10, 9, 8, 0.92);
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}
.video-card:hover {
  transform: translateY(-4px);
  border-color: var(--orange);
  box-shadow: 0 12px 32px rgba(255, 81, 0, 0.1);
}
.video-index {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 81, 0, 0.45);
  background: rgba(255, 81, 0, 0.08);
  color: var(--orange);
  font:
    700 20px/1 "Rajdhani",
    sans-serif;
  display: grid;
  place-items: center;
}
.video-body {
  flex: 1;
}
.video-meta {
  font:
    700 11px/1 "Rajdhani",
    sans-serif;
  letter-spacing: 1.5px;
  color: #ff8847;
}
.video-body h3 {
  margin: 6px 0 6px;
  font-size: 19px;
  font-weight: 800;
  color: #fff;
}
.video-body p {
  margin: 0;
  font-size: 14px;
  color: #9e9e9e;
  line-height: 1.65;
}
.video-cta {
  flex-shrink: 0;
  color: var(--orange);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}
@media (max-width: 1024px) {
  .subjects-grid,
  .chapters-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .videos-list {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 680px) {
  .library-main {
    padding-top: 112px;
  }
  .subjects-grid,
  .chapters-grid {
    grid-template-columns: 1fr;
  }
  .subject-workspace {
    padding: 20px;
  }
  .chapter2-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
  }
  .video-card {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (max-width: 920px) {
  .topbar {
    z-index: 1000 !important;
  }
  .navigation {
    position: fixed !important;
    z-index: 9999 !important;
    background: #080808 !important;
    opacity: 1 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid rgba(255, 81, 0, 0.3);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
  }
}
