/* ============================================================
   MCQ SCHOLAR — styles.css
   Academic Modern Theme | Light + Dark
   Fonts: Playfair Display + DM Sans
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=DM+Sans:wght@300;400;500;600&display=swap");
@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@0,400;0,500;1,400&family=Source+Serif+Pro:wght@0,300;0,600;1,300&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400;600&display=swap");

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
/* ============================================================
   CSS VARIABLES — LIGHT THEME (default)
   ============================================================ */
:root {
  /* Core palette (cool / BMJ-style) */
  --bg-base: #f5f9fc; /* very light blue-gray background */
  --bg-surface: #fbfdff; /* near-white, slightly cooler */
  --bg-card: #ffffff; /* keep pure white for clarity */
  --bg-card-hover: #f0f6fb; /* subtle blue hover state */

  /* BMJ-style light blue primary */
  --primary: #2f80ed; /* main light blue */
  --primary-light: #56a3f3; /* softer hover/light variant */
  --primary-dim: #e8f1fd; /* very light background tint */

  /* Cool accent (replaces warm amber) */
  --accent: #2d9cdb; /* fresh blue accent (slightly different from primary) */
  --accent-light: #6fbced; /* lighter highlight */
  --accent-dim: #eaf4fd; /* soft background tint */

  /* Text (cooler, more neutral) */
  --text-heading: #1f2d3d; /* deep blue-gray */
  --text-body: #445b66; /* balanced readability */
  --text-muted: #8aa0a8; /* softer muted tone */
  --text-inverse: #ffffff; /* clean white for blue backgrounds */

  /* Borders & dividers (cool gray instead of beige) */
  --border: #e1e8ed; /* subtle cool gray */
  --border-strong: #c7d3db; /* slightly stronger separation */

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(26, 46, 53, 0.08);
  --shadow-md: 0 4px 16px rgba(26, 46, 53, 0.1);
  --shadow-lg: 0 8px 32px rgba(26, 46, 53, 0.14);
  --shadow-card:
    0 2px 8px rgba(26, 46, 53, 0.07), 0 1px 2px rgba(26, 46, 53, 0.05);

  --btn-bs-dark: 6px 6px 12px rgba(0, 0, 0, 0.15); /* dark shadow (bottom-right) */
  --btn-bs-light: -6px -6px 12px rgba(255, 255, 255, 0.7); /* light highlight (top-left) */
  --btn-bs: var(--btn-bs-dark), var(--btn-bs-light);

  /* Transitions */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography scale */
  --font-display: "Source Serif Pro", Georgia, serif;
  --font-body: "Source Sans Pro", system-ui, sans-serif;

  /* Spacing */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

/* ============================================================
   DARK THEME
   ============================================================ */
[data-theme="dark"] {
  --bg-base: #0f1720;
  --bg-surface: #141f2a;
  --bg-card: #1a2733;
  --bg-card-hover: #213445;

  --primary: #4da3ff;
  --primary-light: #7ab8ff;
  --primary-dim: #11293d;

  --accent: #56b4d3;
  --accent-light: #7ec9e0;
  --accent-dim: #123544;

  --text-heading: #e6edf3;
  --text-body: #b6c6cf;
  --text-muted: #7f97a3;
  --text-inverse: #0f1720;

  --border: #223240;
  --border-strong: #314657;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.55);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.25);

  /* Subtle dark theme shadows */
  --btn-bs-dark: 6px 6px 12px rgba(0, 0, 0, 0.3);
  --btn-bs-light: -6px -6px 12px rgba(255, 255, 255, 0.05);
  --btn-bs: var(--btn-bs-dark), var(--btn-bs-light);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-base);
  color: var(--text-body);
  line-height: 1.6;
  transition:
    background-color 0.35s ease,
    color 0.35s ease;
  min-height: 100vh;
}

/* Subtle grain texture overlay */
body::before {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-light);
}

img {
  display: block;
  max-width: 100%;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--text-heading);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
}
h3 {
  font-size: 1.25rem;
  font-weight: 600;
}
h4 {
  font-size: 1rem;
  font-weight: 600;
}

p {
  font-size: 1rem;
  font-weight: 300;
}

.text-muted {
  color: var(--text-muted);
}
.text-accent {
  color: var(--accent);
}

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.container--narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 2rem !important;
  padding-right: 2rem !important;
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.navbar__logo-mark {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: white;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.navbar__brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-heading);
  letter-spacing: -0.01em;
}

.navbar__brand-name span {
  color: var(--accent);
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-body);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.navbar__link:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-dim);
}

.navbar__logo-mark {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none; /* remove previous background */
  padding: 0;
}

.navbar__logo-mark img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

/* ============================================================
   THEME TOGGLE BUTTON (LIGHT / DARK)
   ============================================================ */
.theme-toggle {
  position: relative;
  width: 52px;
  height: 28px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-strong);
  border-radius: 14px;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  outline: none;
}

.theme-toggle:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.theme-toggle:focus-visible {
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.theme-toggle__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

[data-theme="dark"] .theme-toggle__knob {
  transform: translateX(24px);
  background: var(--accent);
}

.theme-toggle__icon-sun,
.theme-toggle__icon-moon {
  position: absolute;
  font-size: 10px;
  transition: opacity 0.2s ease;
  user-select: none;
}

.theme-toggle__icon-sun {
  opacity: 1;
}
.theme-toggle__icon-moon {
  opacity: 0;
}

[data-theme="dark"] .theme-toggle__icon-sun {
  opacity: 0;
}
[data-theme="dark"] .theme-toggle__icon-moon {
  opacity: 1;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 2rem 2rem;
  position: relative;
  overflow: hidden;
}

/* Decorative background shape */
.hero::after {
  position: absolute;
  top: -120px;
  right: -180px;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-dim) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
  opacity: 0.6;
}

.hero__inner {
  width: 100%;
  max-width: 1200px; /* Changed: set a max width */
  margin: 0 auto;
  display: flex; /* Changed: from grid to flex */
  flex-direction: column; /* Added: stack content vertically */
  align-items: center; /* Added: center children horizontally */
  gap: 3rem;
  padding-left: 2rem !important;
  padding-right: 2rem !important;
}

.hero__content {
  max-width: 680px; /* Increased slightly for better centering */
  text-align: center; /* Added: center all text */
  margin: 0 auto; /* Added: ensure centering */
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center; /* Added: center the flex items */
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero__eyebrow::before {
  display: inline-block;
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.hero__title {
  margin-bottom: 1rem;
  text-align: center; /* Added: center title */
}

.hero__title em {
  color: var(--primary-light);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.5rem;
}

.hero__subtitle {
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--text-body);
  max-width: 520px;
  margin: 0 auto 2rem auto; /* Changed: center with auto margins */
  line-height: 1.7;
  text-align: center; /* Added: center text */
}

/* Make <em> non-italic globally in hero */
.hero__title em,
.hero__subtitle em,
.hero__eyebrow em {
  font-style: normal;
  font-weight: 400;
  font-family: var(--font-display);
}

/* ── Hero CTA buttons ── */
.hero__ctas {
  display: flex;
  align-items: center;
  justify-content: center; /* Added: center buttons */
  gap: 0.875rem;
  flex-wrap: wrap;
}

.hero__cta-primary {
  font-size: 0.95rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-md);
  gap: 0.5rem;
}

.hero__cta-secondary {
  font-size: 0.95rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-md);
}

/* ── Hero illustration ── */
.hero__illustration {
  flex-shrink: 0;
  text-align: center; /* Added: center illustration */
}

.hero__illus-svg {
  width: 320px;
  height: 280px;
  filter: drop-shadow(0 8px 24px rgba(47, 128, 237, 0.12));
  animation: illustFloat 5s ease-in-out infinite;
}

@keyframes illustFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.hero__stats {
  display: flex;
  justify-content: center; /* Added: center stats if used */
  gap: 2rem;
}

.hero__stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-heading);
  display: block;
  line-height: 1;
}

.hero__stat-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.3rem;
  display: block;
}

/* ============================================================
   FEATURES SECTION
   ============================================================ */
.features-section {
  padding: 4rem 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.features-header {
  margin-bottom: 2.5rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.feature-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
  flex-shrink: 0;
}

.feature-card__icon--blue {
  background: var(--primary-dim);
  color: var(--primary);
}

.feature-card__icon--teal {
  background: var(--accent-dim);
  color: var(--accent);
}

.feature-card__icon--purple {
  background: #f0ebfa;
  color: #7c3aed;
}

[data-theme="dark"] .feature-card__icon--purple {
  background: #2a1d3d;
  color: #a78bfa;
}

.feature-card__icon--amber {
  background: #fef3e2;
  color: #d97706;
}

[data-theme="dark"] .feature-card__icon--amber {
  background: #2d2007;
  color: #fbbf24;
}

.feature-card__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.feature-card__desc {
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--text-body);
  line-height: 1.65;
}

/* ============================================================
   HOW IT WORKS SECTION
   ============================================================ */
.how-section {
  padding: 4.5rem 0;
}

.how-header {
  margin-bottom: 3rem;
}

.how-steps {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

.how-step {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.how-step__connector {
  flex-shrink: 0;
  width: 4rem;
  height: 2px;
  background: var(--border-strong);
  margin-top: 1.4rem; /* aligns with centre of the number circle */
  position: relative;
}

.how-step__connector::after {
  position: absolute;
  right: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-top: 2px solid var(--border-strong);
  border-right: 2px solid var(--border-strong);
  transform: rotate(45deg);
}

.how-step__number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  opacity: 0.25;
  line-height: 1;
  margin-bottom: 0.75rem;
  letter-spacing: -0.03em;
}

.how-step__body {
  padding-right: 0;
}

.how-step__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 0.5rem;
}

.how-step__desc {
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--text-body);
  line-height: 1.65;
}

/* Inline pill chip used inside step descriptions */
.how-chip {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.15rem 0.55rem;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-heading);
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1.6;
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.section-label {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.3rem;
  display: block;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
}

.section-count {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
}

/* ============================================================
   ORGAN SYSTEM GRID
   ============================================================ */
.systems-section {
  padding: 2rem 0 4rem;
  position: relative;
  z-index: 1;
}

.systems-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

/* ============================================================
   ORGAN SYSTEM CARD
   ============================================================ */
.sys-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.3rem 1.5rem 0 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: visible;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  min-height: 200px;

  /* Staggered entrance animation */
  opacity: 0;
  transform: translateY(18px);
  animation: cardEntrance 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes cardEntrance {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Coloured left bar */

.sys-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.sys-card:hover::before {
  width: 6px;
}

/* Top row: name + status badge */
.sys-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

/* Card body */
.sys-card__name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.3;
}

/* Progress bar - more spacing */
.sys-card__progress {
  margin-top: 0.25rem;
  margin-bottom: 1.2rem;
}

.progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--sys-color, var(--primary));
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.sys-card__progress-label {
  display: flex;
  justify-content: space-between;
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Folder-like bottom section */
.sys-card__footer {
  margin-top: auto; /* Pushes footer to bottom */
  margin-left: -1.5rem;
  margin-right: -1.5rem;
  margin-bottom: 0;
  background: var(--accent-dim);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  transition: var(--transition);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.sys-card__start-text {
  font-size: 0.875rem;
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--text-heading);
  letter-spacing: 0.3px;
}

.sys-card__start-icon {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.sys-card:hover .sys-card__start-icon {
  transform: translateX(4px);
}

/* ============================================================
   QUICK STATS BAR
   ============================================================ */
.stats-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.stats-bar__item {
  text-align: center;
  flex: 1;
  min-width: 80px;
}

.stats-bar__item + .stats-bar__item {
  border-left: 1px solid var(--border);
}

.stats-bar__value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  display: block;
  line-height: 1;
}

.stats-bar__label {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 0.3rem;
  display: block;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  margin-top: 0;
  position: relative;
  z-index: 1;
}

.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer__brand {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-heading);
}

.footer__brand span {
  color: var(--accent);
}

.footer__copy {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 300;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1;
}

.btn--primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 30%, transparent);
}

.btn--primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 35%, transparent);
  color: white;
}

.btn--ghost {
  background: transparent;
  color: var(--text-body);
  border: 1px solid var(--border-strong);
}

.btn--ghost:hover {
  background: var(--bg-card);
  border-color: var(--border-strong);
  color: var(--text-heading);
}

/* ============================================================
   CHIP / TAG
   ============================================================ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ============================================================
   LOADING & ERROR STATES
   ============================================================ */
.loading-state {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 3rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 400;
}

.loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

.error-state {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  color: var(--text-body);
  font-size: 0.88rem;
  margin-top: 1rem;
}

.error-state p {
  margin: 0;
  line-height: 1.6;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================================
   MCQ OF THE DAY SECTION
   ============================================================ */
.motd-section {
  padding: 2rem 2rem 3rem;
  display: flex;
  justify-content: center;
}

.motd-wrapper {
  width: 100%;
  max-width: 600px;
}

.motd-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.motd-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: var(--primary);
  gap: 0.5rem;
}

.motd-card__label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
}

.motd-card__date {
  font-size: 0.72rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
}

.motd-loading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 2rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.motd-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.motd-difficulty {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.motd-stem {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-body);
  line-height: 1.65;
  margin: 0;
  text-align: left;
}

.motd-options {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.motd-option {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  width: 100%;
  background: var(--accent-dim);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  font-family: var(--font-body);
  color: var(--text-body);
}

.motd-option:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-dim);
  color: var(--text-heading);
}

.motd-option:disabled {
  cursor: default;
}

.motd-option__radio {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  margin-top: 2px;
}

.motd-option__radio::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  transition: var(--transition);
}

.motd-option:hover:not(:disabled) .motd-option__radio {
  border-color: var(--primary);
}

.motd-option:hover:not(:disabled) .motd-option__radio::after {
  background: var(--primary);
}

.motd-option--correct .motd-option__radio {
  border-color: #27ae60;
}

.motd-option--correct .motd-option__radio::after {
  background: #27ae60;
}

.motd-option--wrong .motd-option__radio {
  border-color: #e74c3c;
}

.motd-option--wrong .motd-option__radio::after {
  background: #e74c3c;
}

.motd-option__letter {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
  margin-top: 1px;
}

.motd-option__text {
  font-size: 0.8rem;
  line-height: 1.5;
}

.motd-option--correct {
  border-color: #27ae60 !important;
  background: #eafaf1 !important;
  color: #1a7340 !important;
}

[data-theme="dark"] .motd-option--correct {
  background: #0d2e1a !important;
  color: #6fcf97 !important;
}

.motd-option--correct .motd-option__letter {
  background: #27ae60;
  color: #fff;
}

.motd-option--wrong {
  border-color: #e74c3c !important;
  background: #fdf0ef !important;
  color: #a93226 !important;
}

[data-theme="dark"] .motd-option--wrong {
  background: #2e0d0d !important;
  color: #f1948a !important;
}

.motd-option--wrong .motd-option__letter {
  background: #e74c3c;
  color: #fff;
}

/* "See explanation" button */
.motd-see-explanation {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.25rem;
  padding: 0.5rem 1rem;
  background: var(--primary-dim);
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  align-self: flex-start;
  animation: motdFadeIn 0.25s ease;
}

.motd-see-explanation:hover {
  background: var(--primary);
  color: #fff;
}

@keyframes motdFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   EXPLANATION OVERLAY
   ============================================================ */
.motd-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.motd-overlay--open {
  pointer-events: all;
  opacity: 1;
}

.motd-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 32, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.motd-overlay__panel {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.motd-overlay--open .motd-overlay__panel {
  transform: translateY(0) scale(1);
}

.motd-overlay__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.motd-overlay__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.motd-overlay__title .bi-lightbulb-fill {
  color: var(--primary);
}

.motd-overlay__close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-base);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: var(--transition);
  flex-shrink: 0;
}

.motd-overlay__close:hover {
  background: var(--border);
  color: var(--text-heading);
}

.motd-overlay__body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-body);
  line-height: 1.7;
}

.motd-overlay__body strong {
  color: var(--text-heading);
}

.motd-overlay__body .explanation-footnote {
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  font-style: italic;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}

.motd-overlay__footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .motd-section {
    padding: 1.5rem 1.5rem 2.5rem;
  }
}

/* ============================================================
   HOW IT WORKS OVERLAY
   ============================================================ */
.how-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.how-overlay--open {
  pointer-events: all;
  opacity: 1;
}

.how-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 32, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.how-overlay__panel {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.how-overlay--open .how-overlay__panel {
  transform: translateY(0) scale(1);
}

.how-overlay__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.how-overlay__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.how-overlay__title .bi-info-circle-fill {
  color: var(--primary);
}

.how-overlay__body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.how-overlay__steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.how-overlay__steps .how-step {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.how-overlay__steps .how-step:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.how-overlay__steps .how-step__number {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  opacity: 0.25;
  line-height: 1;
  letter-spacing: -0.03em;
  flex-shrink: 0;
  min-width: 3.5rem;
  margin-bottom: 0;
}

/* ============================================================
   FEATURES OVERLAY GRID
   ============================================================ */
.features-overlay-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 560px) {
  .features-overlay-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero__content {
    max-width: 100%;
  }

  .hero__eyebrow {
    justify-content: center;
  }

  .hero__subtitle {
    margin-left: auto;
    margin-right: auto;
    font-size: 1rem;
  }

  .hero__ctas {
    justify-content: center;
  }

  .how-steps {
    flex-direction: column;
    gap: 2rem;
  }

  .how-step__connector {
    display: none;
  }

  .cta-banner__inner {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
}

@media (max-width: 768px) {
  .hero__badge {
    display: none;
  }

  .hero__stats {
    gap: 1.5rem;
  }

  .systems-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .stats-bar {
    padding: 1rem;
    gap: 0.5rem;
  }

  .stats-bar__value {
    font-size: 1.2rem;
  }

  .stats-bar__label {
    font-size: 0.65rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .navbar__link-text {
    display: none;
  }

  .features-grid {
    grid-template-columns: 1fr 1fr;
  }

  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  .cta-banner__inner {
    padding: 2rem 1.5rem;
  }

  .how-step__title {
    font-size: 1rem;
  }

  .how-step__desc {
    font-size: 0.85rem;
  }

  .feature-card__title {
    font-size: 0.95rem;
  }

  .feature-card__desc {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .systems-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 3rem 1.5rem 2.5rem;
  }

  .container {
    padding: 0 1.25rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .hero__subtitle {
    font-size: 0.95rem;
  }

  .hero__eyebrow {
    font-size: 0.72rem;
  }

  .stats-bar {
    padding: 0.75rem;
    gap: 0.25rem;
  }

  .stats-bar__value {
    font-size: 1.1rem;
  }

  .stats-bar__label {
    font-size: 0.6rem;
    letter-spacing: 0.04em;
  }

  .section-title {
    font-size: 1.25rem;
  }

  .section-label {
    font-size: 0.7rem;
  }

  .sys-card__name {
    font-size: 0.95rem;
  }

  .sys-card__progress-label {
    font-size: 0.68rem;
  }

  .how-step__number {
    font-size: 1.5rem;
  }

  .how-step__title {
    font-size: 0.95rem;
  }

  .how-step__desc {
    font-size: 0.83rem;
  }

  .feature-card {
    padding: 1.25rem 1.1rem;
  }

  .feature-card__title {
    font-size: 0.95rem;
  }

  .feature-card__desc {
    font-size: 0.83rem;
  }

  .navbar__brand-name {
    font-size: 0.95rem;
  }

  .motd-stem {
    font-size: 0.83rem;
  }

  .motd-option__text {
    font-size: 0.78rem;
  }

  .motd-see-explanation {
    font-size: 0.8rem;
    padding: 0.45rem 0.875rem;
  }
}

/* ============================================================
   RESPONSIVE — landscape on short screens (phones rotated)
   ============================================================ */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    padding: 2rem 2rem 1.5rem;
  }

  .hero__inner {
    gap: 1.5rem;
  }

  .hero__subtitle {
    margin-bottom: 1.25rem;
    font-size: 0.92rem;
  }

  .stats-bar {
    margin-bottom: 1.5rem;
    padding: 0.75rem 1.25rem;
  }

  .stats-bar__value {
    font-size: 1.1rem;
  }
}
