
:root {
  --bg: #f0f8ff;
  --text: #111;
  --brand: #0b6bcb;
  --panel: #fff;
  --muted: #555;
  --radius: .8rem;
  --maxw: 1000px;
}
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #cfe8ff, #a7d0f5);
}
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100'><path d='M0 50 Q 25 0 50 50 T 100 50' fill='none' stroke='rgba(255,255,255,0.2)' stroke-width='2'/></svg>");
  background-repeat: repeat;
  z-index: -1;
}
.container {
  max-width: var(--maxw);
  margin: auto;
  padding: 0 1rem;
}
/* Header */
.header {
  background: #000;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .8rem 1rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}
.header .brand {
  font-weight: 600;
  font-size: 1.1rem;
}
.nav a {
  background: var(--brand);
  color: #fff;
  padding: .4rem .8rem;
  border-radius: var(--radius);
  margin-left: .5rem;
  text-decoration: none;
  font-size: .9rem;
  transition: background .2s;
}
.nav a:hover {
  background: #084a8a;
}
.page-title {
  text-align: center;
  font-size: 1.8rem;
  margin: 1rem 0;
}
img.portrait {
  max-width: 200px;
  border-radius: 50%;
  display: block;
}
.section {
  margin: 2rem 0;
  background: var(--panel);
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.footer {
  text-align: center;
  padding: 1rem;
  font-size: .9rem;
  color: var(--muted);
}
/* MathJax tweaks */
mjx-container[jax="CHTML"][display="true"] {
  margin: 1.2em auto !important;
  font-size: 1.2rem !important;
}
mjx-container[jax="CHTML"][display="false"] {
  font-weight: 500;
  font-size: 1.05rem;
}
/* Theorem & proof blocks */
.theorem, .proof {
  border-left: 4px solid var(--brand);
  background: #eef6ff;
  padding: .8rem;
  margin: 1rem 0;
  border-radius: var(--radius);
  counter-increment: theorem;
}
.theorem::before {
  content: "Theorem " counter(theorem) ". ";
  font-weight: bold;
}
.proof::before {
  content: "Proof. ";
  font-weight: bold;
}
body {
  counter-reset: theorem;
}
/* Accordion and search */
.accordion {
  border: 1px solid #ddd;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.accordion summary {
  background: #f0f0f0;
  cursor: pointer;
  padding: .5rem 1rem;
  font-weight: 600;
}
.accordion div {
  padding: .5rem 1rem;
}
.badge {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  font-size: .75rem;
  padding: .1rem .4rem;
  border-radius: .5rem;
  margin-left: .3rem;
}
.search-box {
  margin-bottom: 1rem;
}
.search-box input {
  width: 100%;
  padding: .5rem;
  border-radius: var(--radius);
  border: 1px solid #ccc;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-flex {
    flex-direction: column;
  }
  .hero-flex > div {
    flex: 100%;
    text-align: center !important;
    padding-right: 0 !important;
  }
}
