/* Mathematical accents over the original course design. */
:root { --math-grid: rgba(37, 99, 235, .055); }
[data-theme="dark"] { --math-grid: rgba(125, 211, 252, .055); }
body {
  background-image: linear-gradient(var(--math-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--math-grid) 1px, transparent 1px);
  background-size: 32px 32px;
}
.math-ribbon {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: .65rem; margin: 0 0 1.5rem; position: relative; z-index: 1;
  pointer-events: none; user-select: none;
}
.math-ribbon span {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .45rem .85rem; border-radius: 12px;
  font-family: 'Fira Code', Consolas, monospace; font-size: .95rem;
  font-weight: 500; letter-spacing: -.025em; color: #1d4ed8;
  background: #eff6ff; border: 1px solid #bfdbfe;
  box-shadow: 0 3px 0 rgba(37, 99, 235, .08);
}
.math-ribbon span:nth-child(2) { color: #6d28d9; background: #f5f3ff; border-color: #ddd6fe; transform: rotate(3deg); }
.math-ribbon span:nth-child(3) { color: #047857; background: #ecfdf5; border-color: #a7f3d0; transform: rotate(-3deg); }
.math-ribbon span:nth-child(4) { color: #b45309; background: #fffbeb; border-color: #fde68a; }
[data-theme="dark"] .math-ribbon span { color: #93c5fd; background: #172b4a; border-color: #315384; }
[data-theme="dark"] .math-ribbon span:nth-child(2) { color: #c4b5fd; background: #302449; border-color: #5b4580; }
[data-theme="dark"] .math-ribbon span:nth-child(3) { color: #6ee7b7; background: #143c35; border-color: #276558; }
[data-theme="dark"] .math-ribbon span:nth-child(4) { color: #fcd34d; background: #3d321e; border-color: #766137; }
.hero-content > .math-ribbon { justify-content: flex-start; }
.math-course-symbol {
  font-family: 'Fira Code', Consolas, monospace;
  font-size: 2.4rem; font-weight: 600; color: var(--primary);
  letter-spacing: -.075em; line-height: 1.25;
}
.portal-card .math-course-symbol { width: fit-content; padding: .35rem .8rem; background: var(--primary-light); border-radius: 14px; }
@media (max-width: 600px) {
  .math-ribbon { gap: .5rem; }
  .math-ribbon span { padding: .35rem .6rem; font-size: .85rem; }
  .portal-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  body { background-image: none; }
  .math-ribbon { display: none; }
}
