/* ── Page header / hero ─────────────────────────────────────── */
.hero { position: relative; margin-bottom: 52px; }
.hero__title { font-size: var(--fs-display); margin: 18px 0 16px; max-width: 16ch; }
.hero__title em { font-style: italic; color: var(--gold-bright); }
.hero__lead { font-size: var(--fs-lead); color: var(--muted); max-width: 56ch; }

.page-head { margin-bottom: 40px; }
.page-head__title { font-size: var(--fs-h1); margin: 14px 0 12px; }
.page-head__lead { color: var(--muted); max-width: 64ch; font-size: var(--fs-lead); }

/* ── Stat row ───────────────────────────────────────────────── */
.stats { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.stat {
  flex: 1 1 150px;
  padding: 20px 22px;
  border-radius: var(--r);
  border: 1px solid var(--line-soft);
  background: linear-gradient(160deg, var(--panel), rgba(17, 19, 36, 0.35));
}
.stat__num { font-family: var(--serif); font-size: 2.1rem; color: var(--ink); line-height: 1; }
.stat__num b { color: var(--gold-bright); font-weight: 600; }
.stat__label { font-size: var(--fs-xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-top: 10px; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: var(--fs-sm); font-weight: 600;
  border: 1px solid var(--line);
  color: var(--text);
  transition: transform 0.25s var(--ease), box-shadow 0.3s var(--ease), background 0.3s, color 0.3s;
}
.btn:hover { transform: translateY(-2px); }
.btn--gold {
  border: none;
  color: var(--void);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep));
  box-shadow: 0 12px 30px -12px rgba(201, 169, 106, 0.7);
}
.btn--gold:hover { box-shadow: 0 18px 40px -12px rgba(201, 169, 106, 0.85); }
.btn--ghost:hover { background: var(--line-soft); color: var(--ink); border-color: var(--gold-dim); }

/* ── Continue card ──────────────────────────────────────────── */
.continue {
  position: relative;
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  padding: 26px 30px;
  margin-bottom: 52px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(600px 200px at 100% 0%, rgba(124, 108, 240, 0.16), transparent 70%),
    linear-gradient(135deg, var(--panel-2), var(--panel));
  overflow: hidden;
}
.continue__body { flex: 1 1 280px; min-width: 0; }
.continue__title { font-family: var(--serif); font-size: 1.5rem; color: var(--ink); margin: 8px 0 6px; }
.continue__meta { color: var(--muted); font-size: var(--fs-sm); }

/* ── Section heading ────────────────────────────────────────── */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 8px 0 26px; }
.section-head h2 { font-size: var(--fs-h2); }
.section-head__hint { font-size: var(--fs-sm); color: var(--faint); }

/* ── Course grid + cards ────────────────────────────────────── */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; perspective: 1200px; }

.course-card {
  position: relative;
  display: block;
  padding: 28px 26px 24px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-soft);
  background: linear-gradient(160deg, var(--panel-2), var(--panel) 70%);
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.4s var(--ease-out), border-color 0.4s, box-shadow 0.4s;
}
.course-card::before { /* glow that follows hover via --mx/--my from JS */
  content: "";
  position: absolute; inset: -1px;
  z-index: -1;
  opacity: 0;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%), rgba(201, 169, 106, 0.20), transparent 60%);
  transition: opacity 0.4s var(--ease);
}
.course-card:hover { transform: translateY(-6px); border-color: var(--gold-dim); box-shadow: var(--shadow-lg); }
.course-card:hover::before { opacity: 1; }

.course-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.roman {
  font-family: var(--serif);
  font-size: 2.6rem;
  font-style: italic;
  color: var(--gold);
  line-height: 1;
  text-shadow: 0 0 26px rgba(201, 169, 106, 0.35);
}
.course-card__title { font-size: 1.5rem; margin: 22px 0 8px; }
.course-card__sub { color: var(--muted); font-size: var(--fs-sm); min-height: 2.4em; }
.course-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; }
.course-card__count { font-size: var(--fs-sm); color: var(--faint); }

/* ── Progress ring (SVG) ────────────────────────────────────── */
.ring { --p: 0; width: 52px; height: 52px; position: relative; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring .ring__bg { stroke: var(--line-soft); }
.ring .ring__fg {
  stroke: url(#ringgrad);
  stroke-linecap: round;
  stroke-dasharray: var(--circ);
  stroke-dashoffset: calc(var(--circ) - var(--circ) * var(--p) / 100);
  transition: stroke-dashoffset 1s var(--ease-out);
}
.ring__val { position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.72rem; font-weight: 700; color: var(--gold); }

/* slim linear progress */
.bar { height: 4px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.bar__fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--gold), var(--violet)); transition: width 1s var(--ease-out); }

/* ── Lesson list ────────────────────────────────────────────── */
.lesson-list { display: flex; flex-direction: column; gap: 12px; }
.lesson-row {
  position: relative;
  display: flex; align-items: center; gap: 22px;
  padding: 20px 24px;
  border-radius: var(--r);
  border: 1px solid var(--line-soft);
  background: linear-gradient(120deg, var(--panel), rgba(17, 19, 36, 0.3));
  transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s;
}
.lesson-row:hover { transform: translateX(6px); border-color: var(--gold-dim); }
.lesson-row__num {
  font-family: var(--serif); font-size: 1.4rem; font-style: italic;
  color: var(--gold); width: 2ch; flex: none; text-align: center;
}
.lesson-row__body { flex: 1; min-width: 0; }
.lesson-row__title { font-family: var(--serif); font-size: 1.16rem; color: var(--ink); margin-bottom: 4px; }
.lesson-row__excerpt {
  color: var(--muted); font-size: var(--fs-sm);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lesson-row__meta { display: flex; align-items: center; gap: 14px; flex: none; color: var(--faint); font-size: var(--fs-xs); }
.lesson-row__check {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line);
  color: transparent; transition: all 0.3s var(--ease);
}
.lesson-row.is-done .lesson-row__check { background: var(--gold); border-color: var(--gold); color: var(--void); }
.lesson-row.is-done .lesson-row__num { color: var(--faint); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line-soft); font-size: var(--fs-xs); color: var(--muted); }

/* ── Search ─────────────────────────────────────────────────── */
.searchbar { position: relative; max-width: 620px; margin-bottom: 36px; }
.searchbar input {
  width: 100%;
  padding: 16px 20px 16px 52px;
  font: inherit; font-size: 1.05rem;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.searchbar input::placeholder { color: var(--faint); }
.searchbar input:focus { border-color: var(--gold-dim); box-shadow: var(--glow-gold); }
.searchbar__icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--gold); }

mark { background: rgba(201, 169, 106, 0.28); color: var(--ink); border-radius: 3px; padding: 0 2px; }

.empty { text-align: center; padding: 80px 20px; color: var(--muted); }
.empty__sigil { width: 64px; height: 64px; margin: 0 auto 20px; color: var(--gold-dim); }

.flash {
  padding: 12px 18px; border-radius: var(--r-sm);
  border: 1px solid rgba(231, 100, 100, 0.4);
  background: rgba(231, 100, 100, 0.12);
  color: #f0b4b4; font-size: var(--fs-sm); margin-bottom: 18px;
}
