:root {
  --bg: #050506;
  --bg-elevated: #0c0c0e;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --border: rgba(255, 255, 255, 0.08);
  --accent: #f97316;
  --accent-soft: rgba(249, 115, 22, 0.15);
  --orange: #f97316;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(249, 115, 22, 0.1), transparent 50%),
    radial-gradient(ellipse 60% 40% at 85% 20%, rgba(56, 189, 248, 0.05), transparent 45%),
    linear-gradient(180deg, #050506 0%, #08080a 100%);
}

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

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

@media (min-width: 768px) {
  .wrap { padding: 0 28px 64px; }
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand img {
  height: 36px;
  width: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(249, 115, 22, 0.4);
  display: block;
}

.brand .accent { color: var(--accent); }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.nav a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
  transition: color 0.15s;
}
.back:hover { color: var(--accent); }

.page-head { margin-bottom: 24px; }
.page-head h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}
.page-head p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.hero {
  text-align: center;
  padding: 24px 0 36px;
}
.hero-logo {
  height: 64px;
  width: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(249, 115, 22, 0.35);
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  margin-bottom: 10px;
  background: linear-gradient(180deg, #fff 30%, #a1a1aa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero h1 .orange {
  -webkit-text-fill-color: var(--accent);
  background: none;
}
.hero p {
  color: var(--muted);
  font-size: 15px;
  max-width: 420px;
  margin: 0 auto;
  font-weight: 500;
}

.select-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 28px;
}
@media (min-width: 640px) {
  .select-grid { grid-template-columns: 1fr 1fr; }
}

.select-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 22px;
  transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 160px;
}
.select-card:hover {
  transform: translateY(-4px);
  border-color: rgba(249, 115, 22, 0.35);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}
.select-card .num {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}
.select-card .num span {
  font-size: 18px;
  color: var(--accent);
  font-weight: 800;
}
.select-card h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.select-card p {
  color: var(--muted);
  font-size: 13px;
  flex: 1;
}
.select-card .arrow {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 8px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 28px;
}
.stat {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
}
.stat .n {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 2px;
}
.stat .l {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.how-to {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 32px;
}
.how-to ol {
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
}
.how-to li { margin-bottom: 6px; }
.how-to strong { color: var(--text); }

.subject-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 560px) {
  .subject-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .subject-grid { grid-template-columns: repeat(3, 1fr); }
}

.subject-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.18s, border-color 0.18s, background 0.18s, box-shadow 0.18s;
  min-height: 150px;
}
.subject-card:hover {
  transform: translateY(-3px);
  border-color: rgba(249, 115, 22, 0.35);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3);
}
.subject-card .code {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.subject-card h3 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.subject-card p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  flex: 1;
}
.subject-card .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.subject-card .badge {
  color: var(--accent);
  font-weight: 700;
}

footer {
  text-align: center;
  padding: 28px 0 8px;
  font-size: 12px;
  color: #52525b;
  border-top: 1px solid var(--border);
  margin-top: 36px;
}
footer a { color: var(--muted); }

.class-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.class-tabs a {
  flex: 1;
  text-align: center;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  transition: 0.15s;
}
.class-tabs a.active,
.class-tabs a:hover {
  background: var(--accent-soft);
  border-color: rgba(249, 115, 22, 0.4);
  color: var(--accent);
}

/* Chapter/lesson selector — boxed grid cards (used by subject index pages
   such as class-10/mathematics/index.html). Previously .lesson-list had no
   rules here at all, so it rendered as a bare bullet list. */
.lesson-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 4px;
}
@media (max-width: 900px) {
  .lesson-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .lesson-list { grid-template-columns: 1fr; }
}
.lesson-list li { list-style: none; }
.lesson-list li a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  padding: 16px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  transition: transform 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
}
.lesson-list li a:hover {
  transform: translateY(-2px);
  border-color: rgba(249, 115, 22, 0.4);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}
.lesson-list li a .title { color: var(--text); }
