:root {
  --bg: #020617;
  --bg-alt: #0b1220;
  --card: #020617;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.1);
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #1f2937;
  --radius-xl: 18px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.75);
}

* {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #0f172a 0, #020617 55%, #000 100%);
  color: var(--text);
  line-height: 1.6;
}

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

/* Header / Navigation */

header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.95),
    rgba(15, 23, 42, 0.75),
    transparent
  );
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.nav {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.brand-badge {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #fbbf24, #22d3ee 40%, #1d4ed8);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.7);
}

.brand span {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}

.nav-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  font-size: 0.83rem;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  transition: all 0.15s ease;
  background: transparent;
}

.nav-links a:hover {
  border-color: rgba(148, 163, 184, 0.5);
  color: var(--text);
  background: rgba(15, 23, 42, 0.7);
}

.nav-links a.final-link {
  border-color: rgba(56, 189, 248, 0.8);
  color: #e0f2fe;
  background: linear-gradient(
    to right,
    rgba(56, 189, 248, 0.18),
    rgba(129, 140, 248, 0.25)
  );
}

.nav-links a.active {
  border-color: rgba(56, 189, 248, 0.9);
  color: #e0f2fe;
}

/* Layout */

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 18px 60px;
}

.hero {
  margin-top: 10px;
  margin-bottom: 28px;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2.2fr);
  gap: 20px;
  align-items: center;
}

@media (max-width: 880px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
}

.hero-main {
  padding: 20px;
  border-radius: 22px;
  background: radial-gradient(circle at top left, #0ea5e9 0, #020617 55%);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.77rem;
  color: #bae6fd;
  margin-bottom: 6px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.9rem, 3vw, 2.3rem);
}

.hero-sub {
  font-size: 0.98rem;
  color: #e5e7eb;
  max-width: 32rem;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  font-size: 0.8rem;
}

.hero-badges span {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: #d1d5db;
}

.hero-side {
  border-radius: 22px;
  padding: 18px 17px;
  background: radial-gradient(circle at top, #1d4ed8, #020617);
  border: 1px solid rgba(129, 140, 248, 0.8);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.9);
}

.hero-side h2 {
  margin-top: 0;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.pill-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: #e5e7eb;
}

.pill-list li::before {
  content: "• ";
  color: #a5b4fc;
}

.note {
  margin-top: 12px;
  font-size: 0.8rem;
  color: #c4b5fd;
  opacity: 0.9;
}

/* Generic sections */

section {
  margin: 26px 0;
  padding: 22px 20px;
  border-radius: var(--radius-xl);
  background: radial-gradient(circle at top left, #020617, #020617 40%, #020617);
  border: 1px solid var(--border);
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.9);
}

.page-title {
  margin-top: 0;
  font-size: 1.5rem;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.code-tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: var(--muted);
}

.section-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.definition {
  font-size: 0.95rem;
  color: #e5e7eb;
  margin-bottom: 12px;
}

.definition ul {
  padding-left: 20px;
  margin: 5px 0 8px;
}

.definition li {
  margin-bottom: 4px;
}

.subheading {
  font-size: 0.9rem;
  margin-top: 14px;
  margin-bottom: 6px;
  color: #bfdbfe;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.sub-card {
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(51, 65, 85, 0.9);
  margin-bottom: 8px;
}

/* Old open-answer quiz blocks */

.quiz {
  margin-top: 12px;
  padding: 10px 12px 4px;
  border-radius: 16px;
  background: radial-gradient(
    circle at top left,
    var(--accent-soft),
    rgba(15, 23, 42, 0.9)
  );
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.quiz-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #7dd3fc;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.quiz-title span {
  font-size: 0.78rem;
  color: #bae6fd;
}

.quiz-question {
  margin-bottom: 9px;
}

.quiz-question p {
  margin: 0 0 4px;
}

.toggle-answer {
  font-size: 0.76rem;
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.6);
  color: #e0f2fe;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toggle-answer:hover {
  background: rgba(56, 189, 248, 0.15);
}

.answer {
  margin-top: 5px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.98);
  border-left: 2px solid rgba(56, 189, 248, 0.8);
  font-size: 0.83rem;
  color: #cbd5f5;
  display: none;
}

.answer.visible {
  display: block;
}

.answer strong {
  color: #e5e7eb;
}

/* Multiple choice quiz styling */

.mc-quiz {
  margin-top: 18px;
  padding: 14px 14px 10px;
  border-radius: 18px;
  background: radial-gradient(
    circle at top,
    rgba(56, 189, 248, 0.22),
    rgba(15, 23, 42, 0.95)
  );
  border: 1px solid rgba(56, 189, 248, 0.55);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
}

.mc-quiz-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e0f2fe;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.mc-quiz-title span {
  font-size: 0.8rem;
  color: #bae6fd;
}

.mc-question {
  margin-top: 10px;
  margin-bottom: 12px;
  padding: 10px 10px 8px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.mc-q-header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 6px;
}

.mc-q-number {
  min-width: 32px;
  height: 32px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #22d3ee, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #e5e7eb;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.7);
}

.mc-q-text {
  font-size: 0.9rem;
  color: #e5e7eb;
}

.mc-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px;
  margin-top: 4px;
}

.mc-option {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
  padding: 8px 10px;
  font-size: 0.86rem;
  text-align: left;
  color: #e5e7eb;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mc-option:hover {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(30, 64, 175, 0.5);
}

.mc-option.correct {
  border-color: rgba(34, 197, 94, 0.9);
  background: rgba(22, 163, 74, 0.28);
}

.mc-option.incorrect {
  border-color: rgba(248, 113, 113, 0.95);
  background: rgba(185, 28, 28, 0.35);
}

.mc-feedback {
  margin-top: 5px;
  font-size: 0.8rem;
  min-height: 18px;
}

.mc-feedback.correct {
  color: #bbf7d0;
}

.mc-feedback.incorrect {
  color: #fecaca;
}

.back-top {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: right;
}

.back-top a {
  color: #93c5fd;
}

.back-top a:hover {
  text-decoration: underline;
}

/* Final quiz page */

.final-quiz-note {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 8px;
}

/* Footer */

footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 18px 28px;
  font-size: 0.78rem;
  color: var(--muted);
  border-top: 1px solid rgba(30, 64, 175, 0.7);
}
