/* ==========================================================================
   Base (layout + typography)
   ========================================================================== */

:root{
  --bg: #f7f8fb;
  --text: #0f172a;
  --muted: #475569;
  --card: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

*{ box-sizing: border-box; }

html, body{
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  line-height: 1.65;
}

body{
  padding: 28px 14px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Center page content width */
h1,
.intro-section,
.theory-section,
.examples-section,
.conclusion-section,
.section-badge{
  width: 100%;
  max-width: 920px;
}

h1{
  margin: 10px 0 18px;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.02em;
}

h2{
  margin: 18px 0 10px;
  font-size: clamp(18px, 2.2vw, 24px);
  letter-spacing: -0.01em;
}

p{ margin: 10px 0; }
.muted{ color: var(--muted); }

/* ==========================================================================
   Section badges (WORKS even without .textbook-preview wrapper)
   ========================================================================== */
/* =========================
   Section badges (pill style)
   Works even without .textbook-preview wrapper
   ========================= */

.section-badge{
  display: flex;
  justify-content: center;
  margin: 18px 0 14px;
}

/* the pill itself */
.section-badge.badge-theory,
.section-badge.badge-examples,
.section-badge.badge-conclusion{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 10px 26px;            /* pill size */
  border-radius: 9999px;         /* fully rounded */
  font-weight: 700;
  font-size: 20px;
  line-height: 1;

  border: 1px solid transparent;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

/* Theory (green) */
.section-badge.badge-theory{
  background: #86efac;           /* soft green */
  color: #064e3b;                 /* deep green text */
  border-color: #22c55e;          /* green border */
}

/* Examples (blue) */
.section-badge.badge-examples{
  background: #bfdbfe;
  color: #1e3a8a;
  border-color: #3b82f6;
}

/* Conclusion (amber) */
.section-badge.badge-conclusion{
  background: #fed7aa;
  color: #7c2d12;
  border-color: #fb923c;
}

/* Optional: if you DO wrap pages in .textbook-preview, keep same look */
.textbook-preview .section-badge{ display:flex; justify-content:center; margin: 18px 0 14px; }
.textbook-preview .section-badge.badge-theory,
.textbook-preview .section-badge.badge-examples,
.textbook-preview .section-badge.badge-conclusion{
  display:inline-flex; align-items:center; justify-content:center;
  padding:10px 26px; border-radius:9999px; font-weight:700; font-size:20px; line-height:1;
  border:1px solid transparent; box-shadow:0 8px 18px rgba(15,23,42,0.08);
}


/* ==========================================================================
   Cards / sections
   ========================================================================== */

.intro-section{
  background: linear-gradient(180deg, #ffffff, #fbfbff);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
}

.theory-section,
.examples-section,
.conclusion-section{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.definition-card{
  background: linear-gradient(180deg, #ffffff, #fcfcff);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 16px;
  padding: 14px;
  margin: 12px 0 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

/* Step marker */
.step-marker{
  display: inline-block;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.08);
  margin-right: 6px;
}

/* ==========================================================================
   Links
   ========================================================================== */

a.skill-link{
  text-decoration: none;
  font-weight: 650;
}
a.skill-link:hover{
  text-decoration: underline;
}

/* Tailwind-ish helper if present in HTML */
.text-green-600{ color: #16a34a; }

/* ==========================================================================
   Misc
   ========================================================================== */

hr{
  border: none;
  border-top: 1px solid rgba(15, 23, 42, 0.10);
  margin: 18px 0;
}

ul{
  margin: 8px 0 0 18px;
  padding: 0;
}
li{ margin: 6px 0; }

/* MathJax spacing tweaks */
mjx-container[display="true"]{
  margin: 0.9em 0;
}

/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 520px){
  .theory-section,
  .examples-section,
  .conclusion-section{
    padding: 16px;
  }
  .intro-section{
    padding: 16px;
  }
}
