:root {
  /* Light theme defaults */
  --page-bg: #f4f7fc;
  --page-bg-soft: #e5edf8;
  --card: #ffffff;
  --accent: #16a34a;
  --accent-soft: rgba(22, 163, 74, 0.12);
  --accent2: #eab308;
  --text-main: #0f172a;
  --text-soft: #4b5563;
  --border-soft: rgba(148, 163, 184, 0.5);

  --chip-learn: #0284c7;
  --chip-solve: #ea580c;
  --chip-connect: #7c3aed;
  --chip-career: #b45309;

  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.15);
  --radius-lg: 18px;
  --radius-sm: 999px;
  --max-width: 1150px;
}

/* Dark theme overrides via CSS variables */
body.theme-dark {
  --page-bg: #020617;
  --page-bg-soft: #0f172a;
  --card: #0b1220;
  --accent: #22c55e;
  --accent-soft: rgba(34, 197, 94, 0.12);
  --accent2: #eab308;
  --text-main: #e5e7eb;
  --text-soft: #9ca3af;
  --border-soft: rgba(148, 163, 184, 0.35);

  --chip-learn: #38bdf8;
  --chip-solve: #f97316;
  --chip-connect: #a855f7;
  --chip-career: #eab308;

  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.75);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, var(--page-bg-soft) 0, var(--page-bg) 55%);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.4rem 3rem;
}

@media (max-width: 600px) {
  main {
    padding: 2rem 1.4rem 3rem;
    /* Restore padding */
  }

  /* .brand-text is already hidden globally */

  /* Hide text on mobile as requested */
  .brand {
    gap: 0;
  }

  .brand-logo {
    height: 30px !important;
    /* Reduce logo size on mobile */
  }

  .site-header-inner {
    gap: 0.5rem;
  }
}

/* Header + brand */

header.site-header {
  margin-bottom: 2.8rem;
  position: relative;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.logo-orb {
  width: 40px;
  height: 40px;
  border-radius: 28px;
  background: conic-gradient(from 210deg, #22c55e, #22c55e, #0ea5e9, #a855f7, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.35);
  position: relative;
}

.logo-orb::after {
  content: "∑";
  font-weight: 700;
  font-size: 1.3rem;
  color: #f9fafb;
  text-shadow: 0 0 10px rgba(15, 23, 42, 0.9);
}

.brand-logo {
  height: 32px;
  width: auto;
  display: block;
  /* Improve logo rendering */
  image-rendering: -webkit-optimize-contrast;
}

/* Light mode correction: invert colors so white text becomes dark */
body:not(.theme-dark) .brand-logo {
  filter: invert(1) hue-rotate(180deg) brightness(0.9);
}

/* Global brand text hide (redundant with logo) */
.brand-text {
  display: none !important;
}


/* Header controls (theme toggle + hamburger) */

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Theme toggle */

/* Generic header button (search, etc) */
.header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--card);
  cursor: pointer;
  color: var(--text-soft);
  transition: all 0.15s;
}

.header-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.16rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--card);
  cursor: pointer;
  outline: none;
}

.theme-toggle-thumb {
  position: absolute;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent-soft);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
  transform: translateX(0);
  transition: transform 0.2s ease-out;
}

body.theme-dark .theme-toggle-thumb {
  transform: translateX(22px);
}

.theme-toggle-icon {
  font-size: 0.75rem;
  z-index: 1;
}

.theme-toggle-sun {
  color: #f59e0b;
  opacity: 1;
}

.theme-toggle-moon {
  color: #6b7280;
  opacity: 0.5;
}

body.theme-dark .theme-toggle-sun {
  opacity: 0.4;
}

body.theme-dark .theme-toggle-moon {
  opacity: 1;
}

/* Nav */

nav.primary-nav {
  display: flex;
  gap: 0.8rem;
  font-size: 0.85rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
}

nav.primary-nav a {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--text-soft);
  transition: 0.18s ease-out;
}

nav.primary-nav a:hover {
  border-color: var(--border-soft);
  color: var(--text-main);
  background: rgba(148, 163, 184, 0.08);
}

nav.primary-nav a.active {
  border-color: rgba(34, 197, 94, 0.9);
  background: var(--accent-soft);
  color: var(--accent);
}

.cta-pill {
  background: linear-gradient(120deg, #22c55e, #16a34a);
  color: #022c22;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.35);
}

.cta-pill:hover {
  background: linear-gradient(120deg, #16a34a, #22c55e);
  border-color: transparent;
  color: #022c22;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.5fr);
  gap: 2rem;
  padding: 1.8rem;
  margin-bottom: 3rem;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, var(--accent-soft) 0, var(--page-bg) 50%);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 0 0, var(--accent-soft), transparent 55%),
    radial-gradient(circle at 100% 0, rgba(56, 189, 248, 0.16), transparent 55%),
    radial-gradient(circle at 50% 100%, rgba(168, 85, 247, 0.12), transparent 55%);
  opacity: 0.9;
  pointer-events: none;
}

.hero-left,
.hero-right {
  position: relative;
  z-index: 1;
}

.hero-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  font-size: 0.78rem;
}

.hero-badge {
  border-radius: 999px;
  padding: 0.18rem 0.7rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #e5e7eb;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hero-badge strong {
  color: #f9fafb;
  font-weight: 600;
}

.hero-title {
  font-size: clamp(1.9rem, 3vw, 2.4rem);
  line-height: 1.2;
  margin-bottom: 0.6rem;
}

.hero-title span {
  background: linear-gradient(120deg, #22c55e, #38bdf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-text {
  font-size: 0.98rem;
  color: var(--text-soft);
  max-width: 33rem;
  margin-bottom: 1.3rem;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 1.1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  padding: 0.55rem 1.0rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: 0.18s ease-out;
  text-decoration: none;
  color: var(--text-main);
}

body.theme-dark .btn {
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
}

.btn:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(148, 163, 184, 0.9);
  transform: translateY(-1px);
}

body.theme-dark .btn:hover {
  background: rgba(15, 23, 42, 1);
  border-color: rgba(226, 232, 240, 0.8);
}

.btn-primary {
  background: linear-gradient(120deg, #22c55e, #16a34a);
  border-color: transparent;
  color: #022c22;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(34, 197, 94, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(120deg, #16a34a, #22c55e);
  transform: translateY(-1px) translateX(1px);
}

.btn-ghost {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.6);
}

.hero-footnote {
  font-size: 0.78rem;
  color: var(--text-soft);
}

/* Quick Access Strip */
.home-help-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.help-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  padding: 0.35rem 0.8rem;
  border-radius: 99px;
  background: var(--bg-soft);
  /* Fallback or existing var */
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border-soft);
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
}

body.theme-dark .help-pill {
  background: rgba(30, 41, 59, 0.6);
}

.help-pill:hover {
  background: var(--card);
  border-color: var(--accent);
  /* Assuming --accent exists */
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Animation slot */

.animation-slot {
  background: var(--card);
  border-radius: 1.1rem;
  border: 1px dashed var(--border-soft);
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-soft);
  margin-bottom: 0.9rem;
  position: relative;
  overflow: hidden;
}

.animation-slot span {
  pointer-events: none;
  text-align: center;
  padding: 0 0.5rem;
}

/* Right-side hero card */

.track-card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: 1.2rem;
  padding: 1rem;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.track-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.3rem;
}

.track-header h2 {
  font-size: 0.98rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-main);
}

.track-header span {
  font-size: 0.78rem;
  color: var(--text-soft);
}

.track-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.track-chip {
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(148, 163, 184, 0.06);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.track-chip span.dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  display: inline-block;
}

.dot-learn {
  background: var(--chip-learn);
}

.dot-solve {
  background: var(--chip-solve);
}

.dot-connect {
  background: var(--chip-connect);
}

.dot-career {
  background: var(--chip-career);
}

.mini-timeline {
  margin-top: 0.7rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.5);
  padding-top: 0.6rem;
  display: grid;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.timeline-item {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  color: var(--text-soft);
  min-width: 0;
}

.timeline-label {
  max-width: 60%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-tag {
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  font-size: 0.72rem;
  white-space: nowrap;
}

/* Sections / headings */

section {
  margin-bottom: 3rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.4rem;
  gap: 0.8rem;
}

.section-title {
  font-size: 1.05rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-main);
}

.section-subtitle {
  font-size: 0.86rem;
  color: var(--text-soft);
  max-width: 28rem;
  word-break: break-word;
  /* Ensure text wraps */
}

/* Page-level heading for Problems & archive */

.page-heading {
  margin-bottom: 1.8rem;
}

.page-heading h1 {
  font-size: 1.4rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
  color: var(--text-main);
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-soft);
  max-width: 32rem;
}

/* Wrapper for simple pages (archive, etc.) */

.page-section {
  margin-bottom: 3rem;
}

/* Right side of section heading for problems page */

.section-heading-right {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  align-items: flex-end;
}

/* Weekly challenge card */

.weekly-challenge-card {
  background: var(--card);
  border-radius: 0.9rem;
  border: 1px solid var(--border-soft);
  padding: 0.6rem 0.8rem;
  box-shadow: var(--shadow-soft);
  max-width: 260px;
  font-size: 0.78rem;
}

.weekly-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  color: var(--accent);
  margin-bottom: 0.2rem;
}

.weekly-title {
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.weekly-meta {
  color: var(--text-soft);
  margin-bottom: 0.25rem;
}

.weekly-link {
  font-size: 0.76rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  color: var(--accent);
}

/* Rooms */

.problem-rooms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.room-pill {
  font-size: 0.78rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(148, 163, 184, 0.06);
  cursor: pointer;
}

.room-pill.active {
  border-color: rgba(34, 197, 94, 0.9);
  background: var(--accent-soft);
  color: var(--accent);
}

/* Card grid */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}

.activity-card {
  background: var(--card);
  border-radius: 1.1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-soft);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.activity-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  opacity: 0.05;
  background: radial-gradient(circle at 0 0, var(--accent), transparent 45%);
  pointer-events: none;
}

.activity-tag-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  position: relative;
  z-index: 1;
}

.activity-chip {
  font-size: 0.7rem;
  padding: 0.18rem 0.6rem;
  border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, 0.10);
  border: 1px solid rgba(148, 163, 184, 0.6);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.activity-chip.learn {
  border-color: var(--chip-learn);
}

.activity-chip.solve {
  border-color: var(--chip-solve);
}

.activity-chip.connect {
  border-color: var(--chip-connect);
}

.activity-chip.career {
  border-color: var(--chip-career);
}

.activity-level {
  font-size: 0.7rem;
  color: var(--text-soft);
}

.activity-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  position: relative;
  z-index: 1;
}

.activity-desc {
  font-size: 0.8rem;
  color: var(--text-soft);
  margin-bottom: 0.7rem;
  position: relative;
  z-index: 1;
}

.activity-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  position: relative;
  z-index: 1;
  gap: 0.5rem;
}

.activity-actions a {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  color: var(--accent);
}

.meta-dots {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.meta-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.8);
}

/* Details inside activity cards */

.activity-detail {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.5);
  font-size: 0.78rem;
  color: var(--text-soft);
  display: none;
}


.activity-card.show-detail .activity-detail {
  display: block;
}

/* Shared Lab Styles - Fix for mobile overflow on code blocks */

/* Shared Lab Styles - Fix for mobile overflow on code blocks */
.lesson-body pre,
.lesson-body .code-block,
pre {
  display: block;
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
  white-space: pre;
  background: rgba(15, 23, 42, 0.03);
  /* Unified background */
  border-radius: 0.5rem;
  padding: 12px 14px;
  /* Fixed px padding to avoid compounding */
  margin: 0.5rem 0;
  border: 1px solid rgba(148, 163, 184, 0.2);

  /* Prevent autoscaling */
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* Ensure code inside pre doesn't break layout or double-up backgrounds */
.lesson-body pre code,
pre code {
  white-space: pre;
  display: inline-block;
  min-width: 100%;
  background: transparent !important;
  /* Remove inline code bg inside pre */
  padding: 0 !important;
  border: none !important;

  /* Locked font metrics */
  font-size: 14px;
  line-height: 1.45;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

code {
  font-size: 14px;
  /* Locked px */
  line-height: 1.45;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

.btn-detail {
  font-size: 0.75rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border-color: rgba(148, 163, 184, 0.55);
  background: transparent;
  color: var(--text-soft);
}

/* Generic content blocks */

.content-block {
  background: var(--card);
  border-radius: 1.1rem;
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  font-size: 0.9rem;
  color: var(--text-soft);
}

.content-block h2 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.content-block+.content-block {
  margin-top: 1rem;
}

/* Simple lists */

ul.clean-list {
  list-style: none;
  padding-left: 0;
  font-size: 0.9rem;
}

ul.clean-list li {
  margin-bottom: 0.3rem;
}

/* Anchored headings on subpages */

.anchor-heading {
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 0.6rem;
}

/* Filter buttons on Programmes / Problems page */

.btn-filter {
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.06);
}

.btn-filter.active {
  background: var(--accent-soft);
  border-color: rgba(34, 197, 94, 0.9);
  color: var(--accent);
}

/* Footer */

footer {
  border-top: 1px solid rgba(148, 163, 184, 0.5);
  padding-top: 1.5rem;
  font-size: 0.78rem;
  color: var(--text-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.7rem;
}

footer a {
  color: var(--text-soft);
  text-decoration: underline;
  text-decoration-style: dotted;
}

/* Hamburger button (hidden on desktop) */

.hamburger {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.9);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.hamburger-line {
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: #e5e7eb;
  position: relative;
}

.hamburger-line::before,
.hamburger-line::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: #e5e7eb;
  left: 0;
}

.hamburger-line::before {
  top: -5px;
}

.hamburger-line::after {
  top: 5px;
}

.hamburger.active .hamburger-line {
  background: transparent;
}

.hamburger.active .hamburger-line::before {
  transform: translateY(5px) rotate(45deg);
}

.hamburger.active .hamburger-line::after {
  transform: translateY(-5px) rotate(-45deg);
}


/* --- Problems & discussion layout --- */

.problem-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr);
  gap: 1.4rem;
  align-items: flex-start;
}

@media (max-width: 900px) {
  .problem-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.problems-main {
  min-width: 0;
}

.problem-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.problem-card {
  background: var(--card);
  border-radius: 1rem;
  border: 1px solid var(--border-soft);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow-soft);
}

.problem-title-row {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: baseline;
  margin-bottom: 0.4rem;
}

.problem-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.problem-score {
  font-size: 0.8rem;
  color: var(--text-soft);
  white-space: nowrap;
}

.problem-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.4rem;
}

.problem-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-size: 0.75rem;
}

.tag {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(148, 163, 184, 0.06);
  color: var(--text-soft);
}

.tag-primary {
  border-color: var(--accent);
  color: var(--accent);
}

.problem-meta-right {
  font-size: 0.75rem;
  color: var(--text-soft);
  white-space: nowrap;
}

.problem-body {
  font-size: 0.85rem;
  color: var(--text-soft);
}

/* submission form / preview */

.form-card {
  background: var(--card);
  border-radius: 1.1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  font-size: 0.86rem;
  color: var(--text-soft);
}

.form-card h2 {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.field-group {
  margin-bottom: 0.7rem;
}

.field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.field-help {
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-bottom: 0.2rem;
}

input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  border-radius: 0.6rem;
  border: 1px solid var(--border-soft);
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.9);
}

body.theme-dark input[type="text"],
body.theme-dark input[type="email"],
body.theme-dark textarea,
body.theme-dark select {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.preview-box {
  margin-top: 0.4rem;
  padding: 0.6rem 0.7rem;
  border-radius: 0.7rem;
  border: 1px dashed var(--border-soft);
  background: rgba(148, 163, 184, 0.04);
  font-size: 0.85rem;
  color: var(--text-soft);
}

/* --- People / leadership page --- */

.people-section {
  margin-bottom: 2.6rem;
}

.people-header {
  margin-bottom: 0.7rem;
}

.people-header h2 {
  font-size: 1rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-main);
}

.people-header p {
  font-size: 0.85rem;
  color: var(--text-soft);
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 960px) {
  .people-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .people-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.person-card {
  background: var(--card);
  border-radius: 1rem;
  border: 1px solid var(--border-soft);
  padding: 0.8rem 0.9rem;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.person-top {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.person-avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: linear-gradient(135deg, #22c55e, #0ea5e9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f9fafb;
  font-weight: 700;
  font-size: 1.1rem;
}

.person-info {
  flex: 1;
}

.person-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.person-role {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.person-meta {
  font-size: 0.75rem;
  color: var(--text-soft);
}

.person-tag {
  display: inline-block;
  margin-top: 0.1rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  font-size: 0.72rem;
}

.person-bio {
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* ---------------------------
   Problems community extras
----------------------------*/

.problem-stats-pill {
  display: flex;
  gap: 1.2rem;
  background: var(--card);
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  font-size: 0.78rem;
}

.problem-stats-pill>div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.problem-stats-pill strong {
  font-size: 0.95rem;
  color: var(--text-main);
}

.problem-stats-pill span {
  color: var(--text-soft);
}

.problem-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 2fr) auto;
  gap: 0.8rem;
  margin-bottom: 1.6rem;
  align-items: center;
}

.problem-search input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.9);
}

body.theme-dark .problem-search input {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
}

.problem-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.problem-sort {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.problem-sort select {
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.9);
}

body.theme-dark .problem-sort select {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
}

/* Thread-style cards */

.problem-card-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.8rem;
}

.problem-stats {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 72px;
  align-items: stretch;
}

.stat-box {
  border-radius: 0.7rem;
  padding: 0.35rem 0.5rem;
  text-align: center;
  border: 1px solid rgba(148, 163, 184, 0.6);
  font-size: 0.7rem;
}

.stat-box .stat-count {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
}

.stat-box .stat-label {
  color: var(--text-soft);
}

.stat-answers.answered {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.problem-content {
  min-width: 0;
}

.problem-status {
  font-size: 0.7rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  text-transform: lowercase;
}

.status-answered {
  border-color: var(--accent);
  color: var(--accent);
}

.status-open {
  border-color: #f97316;
  color: #f97316;
}

.answer-snippet {
  margin-top: 0.6rem;
  padding: 0.6rem 0.7rem;
  border-radius: 0.7rem;
  font-size: 0.8rem;
}

.accepted-answer-snippet {
  border-left: 3px solid var(--accent);
  background: rgba(34, 197, 94, 0.05);
}

.answer-snippet-label {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-main);
}

.answer-snippet-body {
  color: var(--text-soft);
}

.problem-footer-row {
  margin-top: 0.5rem;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-soft);
}

.problem-link {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  color: var(--accent);
}

.problem-footer-meta {
  white-space: nowrap;
}

/* Hint ladder */

.hint-ladder {
  margin-top: 0.6rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.6);
  padding-top: 0.4rem;
}

.hint-block {
  margin-bottom: 0.3rem;
  font-size: 0.8rem;
}

.hint-block summary {
  cursor: pointer;
  list-style: none;
  color: var(--accent);
}

.hint-block summary::-webkit-details-marker {
  display: none;
}

.hint-block summary::before {
  content: "▸ ";
  font-size: 0.7rem;
}

.hint-block[open] summary::before {
  content: "▾ ";
}

.hint-body {
  margin-top: 0.25rem;
  padding-left: 1rem;
  color: var(--text-soft);
}

/* Archive */

.archive-section {
  margin-top: 1.8rem;
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.archive-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.7rem;
  border-radius: 0.8rem;
  border: 1px dashed var(--border-soft);
  background: rgba(148, 163, 184, 0.04);
  font-size: 0.8rem;
}

.archive-title {
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.1rem;
}

.archive-meta {
  color: var(--text-soft);
  font-size: 0.75rem;
}

.archive-more {
  margin-top: 0.4rem;
  font-size: 0.8rem;
}

/* Submit strip */

.submit-strip {
  margin-top: 1.8rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--border-soft);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-soft);
}

.submit-strip-title {
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

/* Sidebar bits */

.activity-feed {
  list-style: none;
  padding-left: 0;
  font-size: 0.8rem;
}

.activity-feed li+li {
  margin-top: 0.4rem;
}

.feed-title {
  display: block;
  color: var(--text-main);
}

.feed-meta {
  display: block;
  color: var(--text-soft);
  font-size: 0.75rem;
}

.contrib-list {
  list-style: none;
  padding-left: 0;
  font-size: 0.8rem;
}

.contrib-list li+li {
  margin-top: 0.3rem;
}

.contrib-name {
  font-weight: 600;
  color: var(--text-main);
}

.contrib-meta {
  margin-left: 0.3rem;
  color: var(--text-soft);
}

/* LaTeX toolbar */

.latex-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.3rem;
  font-size: 0.76rem;
  color: var(--text-soft);
}

.latex-toolbar-label {
  font-weight: 600;
  margin-right: 0.2rem;
}

.latex-btn {
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(148, 163, 184, 0.06);
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
}

/* Answer cards on thread page */

.answer-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1.6rem;
}

.answer-card {
  background: var(--card);
  border-radius: 0.9rem;
  border: 1px solid var(--border-soft);
  padding: 0.8rem 0.9rem;
  font-size: 0.86rem;
  box-shadow: var(--shadow-soft);
}

.answer-card.answer-accepted {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft), var(--shadow-soft);
}

.answer-header {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
  font-size: 0.8rem;
}

.answer-author {
  font-weight: 600;
  color: var(--text-main);
}

.answer-meta {
  color: var(--text-soft);
}

.answer-body {
  font-size: 0.86rem;
  color: var(--text-soft);
}

.answer-form {
  margin-top: 0.4rem;
}

.answer-form .form-row {
  margin-bottom: 0.7rem;
}

.answer-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.answer-form textarea {
  min-height: 140px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-top: 0.3rem;
}

/* Responsive tweaks for toolbar & stats */

@media (max-width: 960px) {
  .problem-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .problem-stats-pill {
    width: 100%;
    justify-content: space-between;
  }

  .problem-footer-meta {
    white-space: normal;
  }

  .section-heading-right {
    align-items: stretch;
  }

  .weekly-challenge-card {
    max-width: 100%;
  }
}

@media (max-width: 720px) {
  .problem-card-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .problem-stats {
    flex-direction: row;
    min-width: 0;
  }

  .stat-box {
    flex: 1;
  }

  .submit-strip {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Responsive */

@media (max-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 1.2rem 1.3rem;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  nav.primary-nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    padding: 0.75rem 1.2rem 1.2rem;
    background: var(--card);
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
    gap: 0.5rem;
    flex-wrap: wrap;
    transform: translateY(-16px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
    z-index: 99;
  }

  nav.primary-nav.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .hamburger {
    display: inline-flex;
    z-index: 100;
    position: relative;
  }
}

@media (max-width: 640px) {
  .card-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------------------------
   Math-art gallery
----------------------------*/

.gallery-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.3fr);
  gap: 1.1rem;
  align-items: flex-start;
}

.gallery-hero-left {
  min-width: 0;
}

.gallery-hero-right {
  min-width: 0;
}

.gallery-callout {
  background: radial-gradient(circle at 0 0,
      rgba(34, 197, 94, 0.16),
      transparent 55%);
  border-radius: 1rem;
  border: 1px solid var(--border-soft);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow-soft);
  font-size: 0.86rem;
  color: var(--text-soft);
}

.gallery-callout h3 {
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  color: var(--text-main);
}

.gallery-callout-foot {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-soft);
  font-style: italic;
}

.gallery-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
}

.gallery-filter-left {
  max-width: 360px;
}

.gallery-filter-sub {
  font-size: 0.8rem;
  color: var(--text-soft);
  margin-top: 0.2rem;
}

.gallery-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.gallery-chip {
  font-size: 0.78rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(148, 163, 184, 0.06);
  cursor: pointer;
}

.gallery-chip-active {
  border-color: rgba(34, 197, 94, 0.9);
  background: var(--accent-soft);
  color: var(--accent);
}

/* Gallery grid and cards */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}

@media (max-width: 960px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-hero {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.art-card {
  background: var(--card);
  border-radius: 1.1rem;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.16s ease-out, box-shadow 0.16s ease-out;
}

.art-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
}

.art-thumb {
  position: relative;
  padding: 0.6rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
}

.art-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.85;
  pointer-events: none;
  mix-blend-mode: screen;
}

.art-thumb img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 0.9rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.45);
}

/* Colour variants for gradient “aura” */
.art-thumb-blue::before {
  background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.5), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(59, 130, 246, 0.4), transparent 55%);
}

.art-thumb-gold::before {
  background: radial-gradient(circle at 0 0, rgba(234, 179, 8, 0.5), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(249, 115, 22, 0.4), transparent 55%);
}

.art-thumb-purple::before {
  background: radial-gradient(circle at 0 0, rgba(168, 85, 247, 0.5), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(59, 130, 246, 0.35), transparent 55%);
}

.art-thumb-green::before {
  background: radial-gradient(circle at 0 0, rgba(34, 197, 94, 0.5), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(52, 211, 153, 0.35), transparent 55%);
}

.art-thumb-orange::before {
  background: radial-gradient(circle at 0 0, rgba(249, 115, 22, 0.5), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(234, 179, 8, 0.4), transparent 55%);
}

.art-thumb-pink::before {
  background: radial-gradient(circle at 0 0, rgba(236, 72, 153, 0.5), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(168, 85, 247, 0.35), transparent 55%);
}

.art-body {
  padding: 0.8rem 0.95rem 0.9rem;
  font-size: 0.86rem;
  color: var(--text-soft);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.art-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.art-chip {
  font-size: 0.72rem;
  padding: 0.14rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(148, 163, 184, 0.08);
  white-space: nowrap;
}

.art-chip-beginner {
  border-color: #22c55e;
}

.art-chip-intermediate {
  border-color: #38bdf8;
}

.art-chip-advanced {
  border-color: #a855f7;
}

.art-title {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-main);
}

.art-caption {
  font-size: 0.84rem;
}

.art-howto {
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* =========================================
   From index (Hero Animation & Local)
   ========================================= */
.hero-right .animation-slot {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 1.1rem;
  border: 1px solid var(--border-soft);
  background:
    radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.18), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(34, 197, 94, 0.16), transparent 55%),
    var(--card);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0.4rem;
}

.hero-right .animation-slot span {
  font-size: 0.84rem;
  color: var(--text-soft);
  text-align: center;
  max-width: 90%;
  line-height: 1.4;
}

.hero-right .animation-slot iframe,
.hero-right .animation-slot video,
.hero-right .animation-slot canvas {
  width: 100%;
  height: 100%;
  border-radius: 0.9rem;
  border: none;
  display: block;
}

@media (max-width: 900px) {
  .hero-right .animation-slot {
    margin-top: 0.6rem;
  }
}

/* =========================================
   From alumni (Alumni Profiles)
   ========================================= */
.alumni-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.3fr);
  gap: 1.4rem;
  align-items: stretch;
}

@media (max-width: 900px) {
  .alumni-hero {
    grid-template-columns: minmax(0, 1fr);
  }
}

.alumni-hero-main {
  background: radial-gradient(circle at top left,
      rgba(34, 197, 94, 0.18),
      rgba(15, 23, 42, 0.02));
  border-radius: 1.2rem;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  padding: 1.2rem 1.3rem;
  position: relative;
  overflow: hidden;
}

.alumni-hero-main::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.18), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(168, 85, 247, 0.16), transparent 55%);
  opacity: 0.7;
  pointer-events: none;
}

.alumni-hero-main-inner {
  position: relative;
  z-index: 1;
}

.alumni-hero-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
  font-size: 0.78rem;
}

.alumni-hero-badge {
  border-radius: 999px;
  padding: 0.16rem 0.7rem;
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.6);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.alumni-hero-badge strong {
  font-weight: 600;
  color: #f9fafb;
}

.alumni-hero-title {
  font-size: clamp(1.55rem, 2.6vw, 1.9rem);
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.alumni-hero-title span {
  background: linear-gradient(120deg, #22c55e, #38bdf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.alumni-hero-text {
  font-size: 0.9rem;
  color: var(--text-soft);
  max-width: 32rem;
  margin-bottom: 0.8rem;
}

.alumni-hero-footnote {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.alumni-hero-side {
  background: var(--card);
  border-radius: 1.2rem;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  padding: 1rem 1.1rem;
  font-size: 0.85rem;
}

.alumni-hero-side h2 {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.alumni-hero-side ul {
  margin-top: 0.3rem;
}

.alumni-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.2rem;
  align-items: center;
  font-size: 0.8rem;
}

.alumni-filter-label {
  color: var(--text-soft);
  margin-right: 0.25rem;
}

.btn-alumni-filter {
  font-size: 0.78rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(148, 163, 184, 0.06);
  cursor: pointer;
  transition: 0.16s ease-out;
}

.btn-alumni-filter.active {
  border-color: rgba(34, 197, 94, 0.9);
  background: var(--accent-soft);
  color: var(--accent);
}

/* People cards */

.person-card.alumni-card {
  position: relative;
  overflow: hidden;
}

.person-card.alumni-card::before {
  content: "";
  position: absolute;
  inset: -35%;
  background:
    radial-gradient(circle at 0 0, rgba(34, 197, 94, 0.16), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(56, 189, 248, 0.16), transparent 55%);
  opacity: 0.7;
  pointer-events: none;
}

.alumni-card-inner {
  position: relative;
  z-index: 1;
}

.alumni-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.3rem;
  font-size: 0.72rem;
}

.alumni-chip {
  padding: 0.14rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.75);
  background: rgba(15, 23, 42, 0.02);
}

.alumni-chip-academic {
  border-color: #0ea5e9;
}

.alumni-chip-industry {
  border-color: #f97316;
}

.alumni-chip-outreach {
  border-color: #a855f7;
}

.alumni-pathline {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-soft);
  border-top: 1px dashed rgba(148, 163, 184, 0.6);
  padding-top: 0.4rem;
}

.alumni-pathline span {
  display: inline-block;
  margin-right: 0.2rem;
}

.alumni-path-bullet {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Soft avatar system */

.person-top {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.5rem;
}

.person-avatar {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, rgba(34, 197, 94, 0.10), transparent 55%),
    radial-gradient(circle at 80% 90%, rgba(56, 189, 248, 0.08), transparent 55%),
    var(--card);
  border: 1px solid rgba(148, 163, 184, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-main);
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
}

body.theme-dark .person-avatar {
  background: radial-gradient(circle at 30% 20%, rgba(56, 189, 248, 0.18), transparent 55%),
    radial-gradient(circle at 80% 90%, rgba(34, 197, 94, 0.16), transparent 55%),
    rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.9);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
}

.avatar-initial {
  position: relative;
  z-index: 1;
  letter-spacing: 0.04em;
}

.person-avatar img.avatar-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.person-avatar.has-photo img.avatar-photo {
  display: block;
}

.person-avatar.has-photo .avatar-initial {
  opacity: 0;
}

.person-info {
  flex: 1;
  min-width: 0;
}

.person-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}

.person-role {
  font-size: 0.82rem;
  color: var(--text-soft);
}

.person-meta {
  font-size: 0.76rem;
  color: var(--text-soft);
  margin-top: 0.15rem;
}

.person-bio {
  font-size: 0.84rem;
  color: var(--text-soft);
  margin-top: 0.35rem;
}

/* Mobile fix for section headings */
@media (max-width: 720px) {
  .section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .section-subtitle {
    max-width: 100%;
  }
}

/* CTA Group for buttons */
.cta-group {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

/* =========================================================================
   ✅ CENTRALIZED HEADER ACCENTS (Auth Cluster, Auth Menu, Dropdowns)
   Migrated from problems inline styles
   ========================================================================= */

/* make the header controls breathe a bit */
.header-controls {
  gap: 0.55rem;
  align-items: center;
}

/* auth cluster (button + dropdown) */
.auth-cluster {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

/* the button itself */
a.auth-cta,
button.auth-cta {
  width: auto !important;
  height: auto !important;
  min-height: 36px;
  padding: 0.48rem 0.78rem !important;
  line-height: 1 !important;

  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;

  border-radius: 999px;
  border: 1px solid var(--border-soft);
  text-decoration: none;
  white-space: nowrap;

  color: var(--text-main);
  font-weight: 850;
  letter-spacing: 0.01em;
  font-size: 0.88rem;

  background:
    radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.16), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(34, 197, 94, 0.18), transparent 55%),
    var(--card);

  box-shadow: var(--shadow-soft);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, filter .15s ease;
  cursor: pointer;
}

a.auth-cta:hover,
button.auth-cta:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow: 0 14px 28px rgba(34, 197, 94, 0.10);
  filter: saturate(1.05);
}

a.auth-cta:active,
button.auth-cta:active {
  transform: translateY(0px);
}

/* icon bubble */
.auth-cta .auth-ic {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;

  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.25);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.auth-cta .auth-ic svg {
  width: 14px;
  height: 14px;
}

/* label: allow ellipsis for long names */
.auth-cta .auth-label {
  display: inline-block;
  max-width: 18ch;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

/* logged-in state */
.auth-cta.logged-in {
  background: rgba(148, 163, 184, 0.12);
  border-color: var(--border-soft);
  color: var(--text-soft);
  box-shadow: none;
  filter: none;
}

.auth-cta.logged-in .auth-ic {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.30);
}

/* dropdown */
.auth-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.55rem);
  width: min(260px, 78vw);
  border-radius: 1rem;
  border: 1px solid var(--border-soft);
  background: var(--card);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  display: none;
  z-index: 50;
}

.auth-menu.open {
  display: block;
}

.auth-menu .head {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  color: var(--text-soft);
  font-size: 0.82rem;
  line-height: 1.35;
  background:
    radial-gradient(circle at 0 0, rgba(34, 197, 94, 0.10), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(56, 189, 248, 0.10), transparent 55%),
    var(--card);
}

.auth-menu .head strong {
  display: block;
  color: var(--text-main);
  font-size: 0.92rem;
  margin-top: 0.15rem;
}

.auth-menu a,
.auth-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.72rem 0.9rem;
  border: 0;
  background: transparent;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 750;
  cursor: pointer;
  font-size: 0.9rem;
}

.auth-menu a:hover,
.auth-menu button:hover {
  background: rgba(148, 163, 184, 0.08);
}

.auth-menu .danger {
  color: #ef4444;
}

.auth-menu .hint {
  font-size: 0.82rem;
  color: var(--text-soft);
  font-weight: 600;
}

/* small screens: show icon only */
@media (max-width: 520px) {

  a.auth-cta,
  button.auth-cta {
    padding: 0.45rem 0.55rem !important;
    gap: 0.45rem;
  }

  .auth-cta .auth-label {
    display: none;
  }
}

/* Nicer submit button hover (subtle) - used in problems tables/lists */
.submit-strip .btn.btn-primary {
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.submit-strip .btn.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.12);
  filter: saturate(1.05);
}

/* optional tiny lock note under submit button when gated */
.auth-lock-note {
  margin-top: 0.55rem;
  font-size: 0.82rem;
  color: var(--text-soft);
  line-height: 1.45;
}

.auth-lock-note a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

/* =========================================
   iOS Safari: safe-area + browser chrome tint (theme aware)
   (Fixes “white ray” without forcing dark tabs)
   ========================================= */

html, body {
  margin: 0;
  min-height: 100%;
  background-color: var(--page-bg);
}

/* Ensure page always fills viewport */
body {
  min-height: 100dvh;               /* modern dynamic viewport */
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}

/* main content should expand */
main {
  flex: 1 0 auto;
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
}

/* footer stays at the bottom naturally */
footer {
  flex-shrink: 0;
}


