:root {
  --bg: #fbfaf7; --fg: #1d1d1f; --muted: #6b6b73; --surface: #f0eee8; --line: #e6e3db;
  --accent: #2f6bff; --accent-fg: #fff; --radius: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max: 960px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141416; --fg: #ececef; --muted: #9a9aa3; --surface: #1e1e22; --line: #2a2a30; --accent: #6b95ff; }
}

.study-head { padding: 56px 0 32px; max-width: 640px; }
.eyebrow { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; margin: 0 0 8px; }
.study-head h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); letter-spacing: -.02em; }
.lead { font-size: 1.15rem; color: var(--muted); }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.course-card {
  position: relative; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg);
  transition: border-color .2s, transform .2s;
}
.course-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.course-card h2 { font-size: 1.4rem; }
.course-card p { color: var(--muted); margin: 0; }
.badge { display: inline-block; margin-bottom: 16px; padding: 2px 10px; border-radius: 99px; background: var(--surface); color: var(--muted); font-size: .8rem; }

a.course-card { display: block; color: inherit; text-decoration: none; }
.course-cover { width: calc(100% + 48px); max-width: none; margin: -24px -24px 16px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 13px 13px 0 0; }
.course-soon { opacity: .7; }
.course-soon:hover { transform: none; border-color: var(--line); }
.course-progress { display: block; margin-top: 12px; font-size: .85rem; color: var(--accent); }

.crumbs { padding-top: 24px; color: var(--muted); font-size: .9rem; }
.crumbs a { color: var(--muted); }

.course-head { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; align-items: center; padding: 32px 0; }
.course-head h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.02em; }
.course-head .btn { margin-top: 8px; }
.course-head-cover { width: 100%; border-radius: 14px; aspect-ratio: 16 / 10; object-fit: cover; }
@media (max-width: 720px) { .course-head { grid-template-columns: 1fr; } .course-head-cover { order: -1; } }
.course-about { max-width: 68ch; }
.muted-s { color: var(--muted); }

.toc-full { margin-top: 40px; max-width: 720px; }
.toc-full h2 { font-size: 1.5rem; }
.toc-module { margin-top: 24px; }
.toc-module h3 { font-size: 1rem; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.toc-list { list-style: none; margin: 0; padding: 0; counter-reset: lesson; }
.toc-list a {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px;
  color: var(--fg); text-decoration: none; transition: background .15s;
}
.toc-list a:hover { background: var(--surface); }
.toc-list a[aria-current] { background: var(--surface); font-weight: 600; }
.toc-check { flex: none; width: 18px; height: 18px; border: 1.5px solid var(--line); border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: #fff; }
.is-done .toc-check { background: var(--accent); border-color: var(--accent); }
.is-done .toc-check::before { content: "✓"; }
.toc-video { margin-left: auto; color: var(--muted); font-size: .75rem; }

.lesson-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 48px; padding-top: 32px; align-items: start; }
.lesson-toc { position: sticky; top: 16px; max-height: calc(100dvh - 32px); overflow: auto; font-size: .92rem; }
.lesson-toc .toc-list a { padding: 8px 10px; }
.toc-course { display: block; margin-bottom: 4px; font-weight: 600; color: var(--fg); text-decoration: none; }
.toc-progress { margin: 0 0 12px; color: var(--muted); font-size: .85rem; }
.toc-module-title { margin: 16px 0 4px; color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: none; }
@media (max-width: 860px) {
  .lesson-layout { grid-template-columns: 1fr; gap: 24px; }
  .lesson-toc { position: static; max-height: none; order: 2; border-top: 1px solid var(--line); padding-top: 24px; }
}

.lesson { max-width: 70ch; }
.lesson h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); letter-spacing: -.02em; }
.video { position: relative; aspect-ratio: 16 / 9; margin: 24px 0; border-radius: 12px; overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.lesson-done { margin: 40px 0 24px; }
[data-mark-done].is-done { background: var(--surface); color: var(--fg); }
.lesson-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 24px; border-top: 1px solid var(--line); }
.lesson-nav a { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--fg); text-decoration: none; }
.lesson-nav a:hover { border-color: var(--accent); }
.lesson-nav small { color: var(--muted); }
.ln-next { text-align: right; }

/* Markdown content of lessons and course descriptions. */
.prose { font-size: 1.075rem; line-height: 1.75; }
.prose > * { margin: 0 0 1em; }
.prose h2 { font-size: 1.5rem; margin-top: 1.8em; letter-spacing: -.01em; }
.prose h3 { font-size: 1.2rem; margin-top: 1.5em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .3em; }
.prose a { color: var(--accent); }
.prose code { padding: 1px 6px; border-radius: 5px; background: var(--surface); font-size: .9em; }
.prose pre { padding: 16px; overflow-x: auto; background: var(--surface); border-radius: 10px; }
.prose pre code { padding: 0; background: none; }
.prose blockquote { margin-left: 0; padding: 12px 16px; border-radius: 10px; background: var(--surface); color: var(--fg); }
.prose figure { margin: 1.5em 0; }
.prose img { border-radius: 10px; border: 1px solid var(--line); }
