/* ===== AL Academy — Masterclasses · shared UI ===== */
:root {
  --bg: #0d1117;
  --bg-2: #111722;
  --bg-3: #161d29;
  --panel: #0f1521;
  --border: #233044;
  --text: #d7e0ee;
  --text-dim: #8a98ad;
  --accent: #ffb454;          /* masterclasses = amber, to distinguish from the programs */
  --accent-ink: #2a1c02;
  --accent-2: #6aa6ff;
  --warn: #ffcc66;
  --danger: #ff6b6b;
  --ok: #56d364;
  --radius: 12px;
  --mono: "JetBrains Mono", "Fira Code", "SF Mono", Consolas, "Liberation Mono", monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --maxw: 980px;
}
[data-theme="light"] {
  --bg: #f6f8fb; --bg-2: #ffffff; --bg-3: #eef2f7; --panel: #ffffff;
  --border: #d8e0ea; --text: #1b2430; --text-dim: #5b6675;
  --accent: #c9760a; --accent-ink: #fff;
  --accent-2: #2f6fe0;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 22px;
  background: rgba(13,17,23,.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .topbar { background: rgba(246,248,251,.9); }
.topbar .brand { display: flex; align-items: center; gap: 11px; }
.brand, .brand:hover { text-decoration: none; }   /* clickable, but no underline on hover */
.topbar .logo { font-size: 24px; }
.topbar .brand-title { font-weight: 800; letter-spacing: .2px; }
.topbar .brand-sub { font-size: 12px; color: var(--text-dim); }
.topbar .spacer { flex: 1; }
.ghost-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 8px; padding: 7px 11px; cursor: pointer; font-size: 13px; font-family: var(--sans);
}
.ghost-btn:hover { color: var(--text); border-color: var(--accent); }

/* ---------- Shared containers ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.pill {
  font-size: 11.5px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-dim); background: var(--bg-2);
  white-space: nowrap;
}
.pill.cat { color: var(--accent-2); border-color: var(--accent-2); }
.pill.level { color: var(--text); }
.pill.free { color: var(--accent-ink); background: var(--accent); border-color: transparent; font-weight: 700; }
.pill.date { font-variant-numeric: tabular-nums; }

/* ================= ROOT CATALOG ================= */
.hero-catalog { padding: 54px 22px 26px; text-align: center; }
.hero-catalog h1 { font-size: 38px; margin: 0 0 10px; line-height: 1.1; }
.hero-catalog .tagline { color: var(--text-dim); max-width: 680px; margin: 0 auto; font-size: 16px; }
.stat-row {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
  margin: 26px auto 4px; max-width: 720px;
}
.stat { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 20px; min-width: 120px; }
.stat-num { font-size: 24px; font-weight: 800; }
.stat-label { font-size: 11.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .4px; margin-top: 4px; }

.cat-section { margin: 40px 0; }
.cat-head { display: flex; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 16px; }
.cat-head .emoji { font-size: 20px; }
.cat-head h2 { font-size: 20px; margin: 0; }
.cat-head .count { margin-left: auto; font-size: 12px; color: var(--text-dim); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; text-decoration: none; color: var(--text);
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.card h3 { margin: 0; font-size: 17px; line-height: 1.3; }
.card .summary { font-size: 13.5px; color: var(--text-dim); flex: 1; }
.card .meta-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.card .go { font-size: 13px; color: var(--accent); font-weight: 600; }

/* ================= MASTERCLASS PAGE ================= */
.mc-hero { padding: 44px 0 26px; }
.crumbs { font-size: 12.5px; color: var(--text-dim); margin-bottom: 14px; }
.crumbs a { color: var(--text-dim); }
.mc-hero h1 { font-size: 34px; margin: 0 0 12px; line-height: 1.12; }
.mc-hero .lede { font-size: 17px; color: var(--text-dim); max-width: 760px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }

.layout { display: grid; grid-template-columns: 1fr 260px; gap: 36px; align-items: start; padding-bottom: 100px; }
@media (max-width: 880px) { .layout { grid-template-columns: 1fr; } }

/* Sidebar (agenda + downloads) */
/* aside follows you while scrolling (sticky) */
.aside { position: sticky; top: 70px; display: flex; flex-direction: column; gap: 18px; align-self: start; }
.aside-box { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.aside-box h4 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-dim); }
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li { margin: 0; }
.agenda a { display: block; padding: 5px 0; font-size: 13.5px; color: var(--text-dim); border-left: 2px solid transparent; padding-left: 10px; }
.agenda a:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }
.dl-btn {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: var(--accent); color: var(--accent-ink); font-weight: 700;
  border: none; border-radius: 9px; padding: 10px 14px; font-size: 13.5px; cursor: pointer;
  text-decoration: none; margin-bottom: 8px;
}
.dl-btn:hover { filter: brightness(1.05); text-decoration: none; }
.dl-btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }

/* Markdown body */
.md { font-size: 16px; line-height: 1.7; }
.md > section { scroll-margin-top: 70px; }
.md h2 { font-size: 24px; margin: 38px 0 12px; padding-bottom: 7px; border-bottom: 1px solid var(--border); }
.md h3 { font-size: 19px; margin: 26px 0 8px; }
.md p, .md li { color: var(--text); }
.md ul, .md ol { padding-left: 22px; }
.md li { margin: 5px 0; }
.md code { font-family: var(--mono); font-size: .88em; background: var(--bg-3); padding: 2px 6px; border-radius: 5px; }
.md pre { position: relative; background: #0a0e16; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; overflow-x: auto; }
.md pre code { background: none; padding: 0; font-size: 13.5px; line-height: 1.55; }
.md blockquote { border-left: 3px solid var(--accent); margin: 16px 0; padding: 6px 16px; color: var(--text-dim); background: var(--bg-2); border-radius: 0 8px 8px 0; }
.md table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 14.5px; }
.md th, .md td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.md th { background: var(--bg-3); }
.md a { color: var(--accent-2); }
.md hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

/* copy button on code blocks */
.copy-btn {
  position: absolute; top: 8px; right: 8px;
  background: var(--bg-3); border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 6px; padding: 3px 9px; font-size: 11.5px; cursor: pointer; font-family: var(--sans);
}
.copy-btn:hover { color: var(--text); border-color: var(--accent); }
.copy-btn.done { color: var(--ok); border-color: var(--ok); }

/* Workshop */
.workshop-step {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel);
  padding: 4px 20px 14px; margin: 16px 0;
}
.workshop-step > h3:first-child { display: flex; align-items: center; gap: 10px; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 800; flex: none;
}

/* callouts (blockquote with leading emoji handled by author) */
.note { margin: 18px 0; padding: 12px 16px; border-radius: var(--radius);
  border: 1px solid rgba(106,166,255,.35); background: rgba(106,166,255,.08); }

/* Resources page block */
.res-group { margin: 24px 0; }
.res-group h3 { font-size: 17px; }

footer.site-foot { border-top: 1px solid var(--border); margin-top: 60px; padding: 26px 22px; color: var(--text-dim); font-size: 13px; text-align: center; }

/* loading / error */
.loading { padding: 80px 20px; text-align: center; color: var(--text-dim); }
