/* ---------- Tokens ---------- */
:root {
    --brand: #4f46e5;
    --brand-dark: #3730a3;
    --brand-deep: #1e1b4b;
    --brand-soft: #eef2ff;
    --violet: #7c3aed;
    --accent: #f59e0b;
    --text: #0f172a;
    --text-2: #334155;
    --muted: #64748b;
    --border: #e2e8f0;
    --bg: #ffffff;
    --bg-alt: #f6f7fb;
    --ink: #0b1020;
    --ok: #047857;
    --ok-soft: #d1fae5;
    --warn-soft: #fef3c7;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px rgba(15, 23, 42, .07);
    --shadow-lg: 0 2px 4px rgba(15, 23, 42, .06), 0 24px 48px rgba(15, 23, 42, .14);
    --grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.65; font-size: 16.5px; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; font-weight: 800; }
h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.12rem; font-weight: 700; letter-spacing: -.01em; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip-link:focus { left: 8px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
@media (max-width: 560px) { .container { padding: 0 16px; } }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .9); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 28px; min-height: 70px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo svg { flex: none; }
.main-nav { display: flex; align-items: center; gap: 2px; flex: 1; }
.main-nav > a { padding: 8px 12px; border-radius: 8px; color: var(--text-2); font-weight: 600; font-size: .94rem; }
.main-nav > a:hover { color: var(--text); background: var(--bg-alt); text-decoration: none; }
.main-nav > a.active { color: var(--brand); background: var(--brand-soft); }
.nav-end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav-search { position: relative; }
.nav-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.nav-search input { width: 220px; padding: 9px 14px 9px 36px; border: 1px solid var(--border); border-radius: 999px; font: inherit; font-size: .9rem; background: var(--bg-alt); transition: border-color .15s, background .15s, width .2s; }
.nav-search input:focus { outline: none; border-color: var(--brand); background: #fff; width: 260px; }
.nav-cta { padding: 9px 16px; font-size: .9rem; }
.nav-toggle, .nav-toggle-label { display: none; }

@media (max-width: 1020px) {
    .nav-toggle-label { display: block; margin-left: auto; width: 40px; height: 40px; cursor: pointer; position: relative; }
    .nav-toggle-label span, .nav-toggle-label span::before, .nav-toggle-label span::after {
        position: absolute; left: 9px; width: 22px; height: 2px; background: var(--text); content: ""; transition: .2s;
    }
    .nav-toggle-label span { top: 19px; }
    .nav-toggle-label span::before { top: -7px; left: 0; }
    .nav-toggle-label span::after { top: 7px; left: 0; }
    .main-nav { display: none; position: absolute; top: 70px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: #fff; border-bottom: 1px solid var(--border); padding: 12px 16px 16px; box-shadow: var(--shadow); }
    .main-nav > a { padding: 10px 12px; }
    .nav-end { flex-direction: column; align-items: stretch; margin: 8px 0 0; }
    .nav-search input, .nav-search input:focus { width: 100%; }
    .nav-toggle:checked ~ .main-nav { display: flex; }
}

/* ---------- Common ---------- */
.flash { margin: 16px 0 0; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--ok-soft); color: #064e3b; }
.flash-warn { background: var(--warn-soft); color: #78350f; margin: 0 0 16px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 18px auto 0; font-size: .85rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "›"; margin-right: 6px; }
.breadcrumbs a { color: var(--muted); }
.eyebrow { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: .82rem; font-weight: 700; }
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .2); }
.lead { font-size: 1.12rem; color: var(--text-2); }
.meta { color: var(--muted); font-size: .88rem; margin: 0; }
.empty { color: var(--muted); padding: 24px 0; }
.text-grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Full-bleed tinted band behind list-page headings (border-image outset does not cause page overflow). */
.page-head { padding-top: 40px; padding-bottom: 36px; margin-bottom: 32px; border-bottom: 1px solid var(--border);
    border-image: linear-gradient(180deg, #f3f4ff 0%, #fafaff 100%) fill 0 // 0 100vmax; }
.page-head h1 { margin-bottom: .3em; }
.page-head .lead { max-width: 720px; margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 12px; border: 1px solid transparent; cursor: pointer; font: inherit; font-weight: 700; font-size: .98rem; transition: background .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(79, 70, 229, .28); }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-light { background: #fff; color: var(--brand-deep); }
.btn-light:hover { background: #eef2ff; }
.btn-outline-light { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .25); color: #fff; }
.btn-outline-light:hover { background: rgba(255, 255, 255, .14); }
.btn-lg { padding: 15px 26px; font-size: 1.02rem; }
.btn-block { width: 100%; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: #f1f5f9; color: var(--text-2); font-size: .74rem; font-weight: 700; }
.badge-free, .badge-opensource { background: var(--ok-soft); color: var(--ok); }
.badge-freemium { background: #e0f2fe; color: #075985; }
.badge-paid { background: #fee2e2; color: #991b1b; }
.badge-video { position: absolute; left: 10px; bottom: 10px; background: rgba(15, 23, 42, .85); color: #fff; }
.badge-level-0 { background: #dcfce7; color: #166534; }
.badge-level-1 { background: #fef3c7; color: #92400e; }
.badge-level-2 { background: #fee2e2; color: #991b1b; }

.chip { display: inline-block; padding: 7px 15px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-2); font-size: .88rem; font-weight: 600; background: #fff; }
.chip:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.chip.active { background: var(--text); border-color: var(--text); color: #fff; }
.chip-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Home hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--ink); color: #e2e8f0; padding: 88px 0 96px; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
    background: radial-gradient(700px 420px at 12% 0%, rgba(99, 102, 241, .45), transparent 70%),
                radial-gradient(600px 400px at 95% 20%, rgba(168, 85, 247, .35), transparent 70%),
                radial-gradient(500px 300px at 60% 110%, rgba(14, 165, 233, .25), transparent 70%); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .35;
    background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 48px 48px; mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 56px; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.08; margin: 18px 0 18px; }
.hero h1 .text-grad { background: linear-gradient(90deg, #a5b4fc, #f0abfc 60%, #fcd34d); -webkit-background-clip: text; background-clip: text; }
.hero .lead { color: #cbd5e1; max-width: 560px; }
.hero .pill { background: rgba(255, 255, 255, .08); color: #e0e7ff; border: 1px solid rgba(255, 255, 255, .14); }
.hero-search { display: flex; gap: 8px; max-width: 540px; margin-top: 28px; padding: 6px; background: #fff; border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .35); }
.hero-search input { flex: 1; min-width: 0; border: 0; padding: 10px 12px; font: inherit; color: var(--text); background: transparent; }
.hero-search input:focus { outline: none; }
.hero-search .btn { padding: 10px 18px; box-shadow: none; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 12px 36px; margin: 36px 0 0; padding: 0; list-style: none; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { color: #fff; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.hero-stats span { color: #94a3b8; font-size: .85rem; }

.hero-visual { position: relative; }
.mock-card { position: relative; background: #fff; color: var(--text); border-radius: 20px; padding: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); transform: rotate(-1.5deg); }
.mock-cover { height: 132px; border-radius: 14px; margin-bottom: 18px; }
.mock-card h3 { margin: 6px 0 12px; font-size: 1.12rem; }
.progress { height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--grad); border-radius: inherit; transition: width .4s; }
.mock-progress-label { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin: 8px 0 14px; font-weight: 600; }
.mock-lessons { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.mock-lessons li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg-alt); font-size: .88rem; font-weight: 600; }
.mock-lessons li .tick { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; background: #e2e8f0; color: var(--muted); }
.mock-lessons li.done .tick { background: #22c55e; color: #fff; }
.mock-lessons li.now { background: var(--brand-soft); color: var(--brand-dark); }
.mock-lessons li.now .tick { background: var(--brand); color: #fff; }
.float-chip { position: absolute; display: inline-flex; align-items: center; gap: 8px; background: #fff; color: var(--text); padding: 10px 14px; border-radius: 12px; font-size: .84rem; font-weight: 700; box-shadow: var(--shadow-lg); }
.float-chip i { font-style: normal; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: .9rem; }
.float-chip-1 { top: -18px; right: -10px; transform: rotate(3deg); }
.float-chip-1 i { background: #dcfce7; color: #166534; }
.float-chip-2 { bottom: -22px; left: -18px; transform: rotate(-2deg); }
.float-chip-2 i { background: #fef3c7; color: #92400e; }

@media (max-width: 960px) {
    .hero { padding: 56px 0 72px; }
    .hero-grid { grid-template-columns: 1fr; gap: 56px; }
    .hero-visual { max-width: 440px; margin: 0 auto; width: 100%; }
    .float-chip-1 { right: 0; }
    .float-chip-2 { left: 0; }
}

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.section-head h2 { margin: 6px 0 0; }
.section-head p { margin: 6px 0 0; color: var(--muted); }
.section-link { font-weight: 700; white-space: nowrap; }
@media (max-width: 640px) { .section { padding: 52px 0; } .section-head { flex-direction: column; align-items: flex-start; } }

.trust { border-bottom: 1px solid var(--border); background: #fff; }
.trust-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 28px; padding: 18px 20px; color: var(--muted); font-size: .9rem; font-weight: 600; }
.trust-inner strong { color: var(--text); }
.trust-inner span::before { content: "✓"; color: #22c55e; margin-right: 8px; font-weight: 800; }

/* Topic tiles: colour rotates by position. */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.topic-chip { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); background: #fff; transition: border-color .15s, box-shadow .15s, transform .15s; }
.topic-chip:hover { border-color: #c7d2fe; text-decoration: none; box-shadow: var(--shadow); transform: translateY(-2px); }
.topic-chip strong { display: block; margin-bottom: 2px; }
.topic-chip div > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.topic-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 1.05rem; }
.tone-0 { --tone: #4f46e5; --tone-soft: #eef2ff; }
.tone-1 { --tone: #059669; --tone-soft: #ecfdf5; }
.tone-2 { --tone: #d97706; --tone-soft: #fffbeb; }
.tone-3 { --tone: #db2777; --tone-soft: #fdf2f8; }
.tone-4 { --tone: #0284c7; --tone-soft: #f0f9ff; }
.tone-5 { --tone: #7c3aed; --tone-soft: #f5f3ff; }
.topic-icon { background: var(--tone-soft); color: var(--tone); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step { position: relative; padding: 28px 24px 24px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.step::before { counter-increment: step; content: "0" counter(step); display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--grad); color: #fff; font-weight: 800; margin-bottom: 16px; }
.step h3 { margin-bottom: 6px; }
.step p { margin: 0; color: var(--muted); font-size: .95rem; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.feature { display: flex; gap: 16px; }
.feature-icon { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--tone-soft); color: var(--tone); }
.feature h3 { margin: 2px 0 6px; }
.feature p { margin: 0; color: var(--muted); font-size: .95rem; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr; } }

.cta-band { position: relative; overflow: hidden; border-radius: 24px; padding: 48px; background: var(--brand-deep); color: #c7d2fe; display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; isolation: isolate; }
.cta-band::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(500px 300px at 0% 0%, rgba(124, 58, 237, .55), transparent 70%), radial-gradient(400px 300px at 100% 100%, rgba(79, 70, 229, .6), transparent 70%); }
.cta-band h2 { color: #fff; margin-bottom: 8px; }
.cta-band p { margin: 0; }
.cta-band .newsletter input[type=email] { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); }
.cta-band .newsletter button { background: #fff; color: var(--brand-deep); }
@media (max-width: 800px) { .cta-band { grid-template-columns: 1fr; padding: 32px 24px; } }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
@media (max-width: 400px) { .grid, .grid-3 { grid-template-columns: 1fr; } }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s, transform .2s, border-color .2s; }
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: #dfe3f0; }
.card-link { display: flex; flex-direction: column; color: inherit; height: 100%; }
.card-link:hover { text-decoration: none; }
a.card { display: block; color: inherit; }
a.card:hover { text-decoration: none; }
.card-media { position: relative; aspect-ratio: 16 / 9; background: var(--bg-alt); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-title { font-size: 1.08rem; margin: 8px 0 6px; color: var(--text); line-height: 1.35; }
.card-text { color: var(--muted); font-size: .92rem; margin: 0 0 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .84rem; color: var(--muted); font-weight: 600; }
.card-foot .stat { display: inline-flex; align-items: center; gap: 6px; }
.card-foot .stat + .stat { margin-left: 12px; }

/* Generated course cover, used when a course has no cover image. */
.cover-gen { position: absolute; inset: 0; padding: 18px 20px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; overflow: hidden;
    background: linear-gradient(135deg, var(--tone) 0%, color-mix(in srgb, var(--tone) 55%, #0b1020) 100%); }
.cover-gen::before { content: ""; position: absolute; width: 220px; height: 220px; right: -60px; top: -70px; border-radius: 50%; border: 36px solid rgba(255, 255, 255, .1); }
.cover-gen::after { content: ""; position: absolute; width: 120px; height: 120px; right: 70px; bottom: -70px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.cover-gen .cover-topic { position: relative; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.cover-gen .cover-title { position: relative; font-size: 1.25rem; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; max-width: 85%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-media .badge-free { position: absolute; top: 12px; left: 12px; background: #fff; color: var(--ok); box-shadow: var(--shadow-sm); z-index: 1; }
.card-media .cover-gen ~ .badge-free { left: auto; right: 12px; }

.tool-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.tool-head .card-title { margin: 0 0 4px; }
.tool-logo { width: 44px; height: 44px; border-radius: 12px; object-fit: contain; flex: none; border: 1px solid var(--border); background: #fff; }
.tool-logo-text { display: inline-flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand-dark); font-weight: 800; border: 0; }
.tool-logo-lg { width: 72px; height: 72px; }
.topic-card .card-body { padding: 22px; }

/* ---------- Courses index ---------- */
.learn-hero { padding: 48px 0 40px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, #f3f4ff 0%, #fff 100%); }
.learn-hero h1 { margin: 10px 0 10px; }
.learn-hero .lead { max-width: 680px; margin: 0; }
.learn-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.learn-stats span { padding: 8px 14px; border-radius: 10px; background: #fff; border: 1px solid var(--border); font-size: .88rem; font-weight: 600; color: var(--text-2); }
.learn-stats strong { color: var(--text); }
.learn-filter { position: sticky; top: 70px; z-index: 10; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.learn-filter .filter-row { padding: 12px 0; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
.learn-filter .chip { white-space: nowrap; }
.course-group { margin: 40px 0 48px; scroll-margin-top: 140px; }
.course-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.course-group-head h2 { margin: 0; font-size: 1.45rem; }

/* ---------- Course page ---------- */
.course-hero { position: relative; background: var(--ink); color: #cbd5e1; padding: 44px 0 48px; margin-top: 16px; isolation: isolate; overflow: hidden; }
.course-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(600px 360px at 0% 0%, rgba(99, 102, 241, .45), transparent 70%), radial-gradient(500px 360px at 70% 120%, rgba(168, 85, 247, .3), transparent 70%); }
.course-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 48px; }
.course-hero h1 { color: #fff; margin: 14px 0 12px; }
.course-hero .lead { color: #cbd5e1; margin: 0 0 18px; }
.course-hero .eyebrow { color: #a5b4fc; }
.course-hero .meta { color: #94a3b8; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.course-hero .meta a { color: #e0e7ff; }
.course-hero .badge { background: rgba(255, 255, 255, .1); color: #e2e8f0; }
.course-hero .badge-free { background: rgba(34, 197, 94, .18); color: #86efac; }
.course-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 48px; padding-top: 40px; padding-bottom: 48px; }
.enroll-card { position: sticky; top: 90px; margin-top: -260px; background: #fff; border: 1px solid var(--border); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-lg); z-index: 2; }
.enroll-card .card-media { aspect-ratio: 16 / 9; }
.enroll-body { padding: 22px; }
.enroll-price { display: flex; align-items: baseline; gap: 10px; margin: 0 0 16px; }
.enroll-price strong { font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; }
.enroll-price span { color: var(--muted); font-size: .9rem; }
.enroll-body .progress { margin: 14px 0 6px; }
.enroll-progress-label { font-size: .82rem; color: var(--muted); font-weight: 600; margin: 0 0 4px; }
.enroll-body .side-title { margin: 20px 0 10px; }
@media (max-width: 1000px) {
    .course-hero-grid, .course-layout { grid-template-columns: 1fr; gap: 28px; }
    .course-hero-spacer { display: none; }
    .course-layout .sidebar { order: -1; }
    .enroll-card { position: static; margin-top: 0; }
}

.learn-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 28px; margin-bottom: 32px; background: #fff; }
.learn-box .prose h2:first-child { margin-top: 0; }

.curriculum { margin-top: 8px; }
.curriculum-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.curriculum-head h2 { margin: 0; }
.curriculum ol { list-style: none; padding: 0; margin: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.curriculum li + li { border-top: 1px solid var(--border); }
.curriculum li a { display: flex; align-items: center; gap: 16px; padding: 16px 20px; color: var(--text); transition: background .15s; }
.curriculum li a:hover { background: var(--bg-alt); text-decoration: none; }
.lesson-num { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-dark); font-weight: 800; font-size: .88rem; }
.done > a .lesson-num, .done .lesson-num { background: #22c55e; color: #fff; font-size: 0; }
.done > a .lesson-num::after, .done .lesson-num::after { content: "✓"; font-size: .9rem; }
.lesson-info { flex: 1; min-width: 0; }
.lesson-info strong { display: block; font-weight: 700; }
.lesson-info span { display: block; color: var(--muted); font-size: .88rem; margin-top: 2px; }
.lesson-side { flex: none; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .84rem; font-weight: 600; }
.lesson-side .badge { background: #fee2e2; color: #b91c1c; }

/* ---------- Article ---------- */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; padding-top: 16px; padding-bottom: 48px; }
.lesson-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 48px; padding-top: 20px; padding-bottom: 56px; }
@media (max-width: 960px) {
    .article-layout, .lesson-layout { grid-template-columns: 1fr; gap: 24px; }
    .lesson-nav { order: 2; }
}
.article { min-width: 0; max-width: 760px; }
.article-head { margin: 8px 0 28px; }
.article-head h1 { margin-top: 10px; }
.article-head .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 16px; }
.article-cover { width: 100%; border-radius: var(--radius); margin-bottom: 28px; aspect-ratio: 1200 / 630; object-fit: cover; }
.tool-detail-head { display: flex; gap: 20px; align-items: flex-start; }

.prose { font-size: 1.05rem; line-height: 1.8; color: #1e293b; }
.prose h2 { margin-top: 2em; scroll-margin-top: 90px; }
.prose h3 { margin-top: 1.6em; scroll-margin-top: 90px; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.15em; }
.prose li { margin-bottom: .4em; }
.prose li::marker { color: var(--brand); }
.prose img { border-radius: 12px; border: 1px solid var(--border); margin: 8px 0; }
.prose blockquote { margin: 1.5em 0; padding: 14px 20px; border-left: 4px solid var(--brand); background: var(--brand-soft); border-radius: 0 12px 12px 0; color: var(--brand-deep); }
.prose blockquote p:last-child { margin: 0; }
.prose code { font-family: var(--mono); font-size: .88em; background: #f1f5f9; padding: 2px 6px; border-radius: 6px; }
.prose pre { background: #0d1117; color: #e6edf3; padding: 18px 20px; border-radius: 12px; overflow-x: auto; font-size: .9rem; line-height: 1.6; }
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.prose pre code.hljs { padding: 0; background: transparent; }
.table-wrap { overflow-x: auto; margin: 0 0 1.2em; }
.prose table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--bg-alt); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

.toc { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; margin: 0 0 32px; background: var(--bg-alt); }
.toc-title { font-weight: 800; margin: 0 0 8px; font-size: .95rem; }
.toc ul { margin: 0; padding-left: 0; list-style: none; }
.toc li { margin: 5px 0; padding-left: 14px; position: relative; font-size: .95rem; }
.toc li::before { content: "›"; position: absolute; left: 0; color: var(--muted); }
.toc .toc-l3 { margin-left: 18px; font-size: .9rem; }

.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; margin-bottom: 28px; box-shadow: var(--shadow); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-play { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer; background: #000; }
.video-play img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.video-icon { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 76px; height: 54px; border-radius: 14px; background: #ff0000; color: #fff; font-size: 22px; display: flex; align-items: center; justify-content: center; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.share { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 16px 0; border-top: 1px solid var(--border); margin-top: 28px; font-size: .9rem; }
.share span { color: var(--muted); }
.author-box { display: flex; gap: 16px; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); margin-top: 28px; background: var(--bg-alt); }
.author-box p { margin: 0 0 6px; }
.author-name { font-weight: 700; }
.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-text { display: inline-flex; align-items: center; justify-content: center; background: var(--grad); color: #fff; font-weight: 800; font-size: 1.4rem; }
.avatar-lg { width: 120px; height: 120px; }
.author-head { display: flex; gap: 24px; align-items: center; padding: 32px 0; }

.sidebar { display: flex; flex-direction: column; gap: 20px; }
.side-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; position: sticky; top: 90px; background: #fff; }
.side-title { font-weight: 800; margin: 0 0 10px; }
.check-list { padding-left: 0; list-style: none; margin: 0; display: grid; gap: 8px; font-size: .94rem; }
.check-list li { display: flex; gap: 10px; }
.check-list li::before { content: "✓"; flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); font-weight: 800; font-size: .7rem; margin-top: 3px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 0 16px; font-size: .95rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.ad-slot { margin: 28px 0; min-height: 100px; }

/* ---------- Lesson page ---------- */
.lesson-nav { position: sticky; top: 90px; align-self: start; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; max-height: calc(100vh - 110px); overflow-y: auto; }
.lesson-nav-head { padding: 18px 18px 16px; border-bottom: 1px solid var(--border); background: var(--bg-alt); }
.lesson-nav-head .side-title { margin: 4px 0 12px; line-height: 1.35; }
.lesson-nav-head .side-title a { color: var(--text); }
.lesson-nav-head .meta { margin-top: 6px; font-size: .8rem; font-weight: 600; }
.lesson-nav ol { list-style: none; padding: 8px; margin: 0; }
.lesson-nav li a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text-2); font-size: .9rem; line-height: 1.35; }
.lesson-nav li a:hover { background: var(--bg-alt); text-decoration: none; }
.lesson-nav .lesson-num { width: 26px; height: 26px; font-size: .78rem; background: #f1f5f9; color: var(--muted); }
.lesson-nav li.current a { background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }
.lesson-nav li.current .lesson-num { background: var(--brand); color: #fff; }
.lesson-nav li.done .lesson-num { background: #22c55e; color: #fff; }

.lesson-complete { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 36px; padding: 20px 22px; border-radius: var(--radius); background: var(--bg-alt); border: 1px solid var(--border); }
.lesson-complete p { margin: 0; font-weight: 700; }
.lesson-complete p span { display: block; font-weight: 500; color: var(--muted); font-size: .9rem; }
.lesson-complete .btn[aria-pressed="true"] { background: #22c55e; box-shadow: 0 6px 16px rgba(34, 197, 94, .28); }
.lesson-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.lesson-pager a { display: block; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; color: var(--text); font-weight: 700; transition: border-color .15s, box-shadow .15s; }
.lesson-pager a:hover { border-color: var(--brand); text-decoration: none; box-shadow: var(--shadow); }
.lesson-pager a span { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.lesson-pager .next { text-align: right; grid-column: 2; }
@media (max-width: 560px) { .lesson-pager { grid-template-columns: 1fr; } .lesson-pager .next { grid-column: 1; } }

/* ---------- Lists / forms ---------- */
.filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 20px; margin: 40px 0; font-weight: 600; }
.az { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.az a { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 10px; font-weight: 700; }
.az a:hover { background: var(--brand); color: #fff; border-color: var(--brand); text-decoration: none; }
.glossary-letter h2 { border-bottom: 1px solid var(--border); padding-bottom: 6px; scroll-margin-top: 90px; }
.glossary dt { font-weight: 700; margin-top: 14px; scroll-margin-top: 90px; }
.glossary dd { margin: 4px 0 0; color: var(--text-2); }
.definition { border-left: 4px solid var(--brand); padding-left: 16px; }
.search-big { display: flex; gap: 8px; margin: 12px 0; }
.search-big input { flex: 1; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; font: inherit; }
.search-results ul { list-style: none; padding: 0; }
.search-results li { padding: 14px 0; border-bottom: 1px solid var(--border); }
.search-results li p { margin: 4px 0 0; color: var(--muted); font-size: .93rem; }

.form .field { margin-bottom: 16px; }
.form label { display: block; font-weight: 600; margin-bottom: 6px; }
.form input, .form textarea, .form select { width: 100%; padding: 11px 13px; border: 1px solid #cbd5e1; border-radius: 12px; font: inherit; }
.form input:focus, .form textarea:focus, .form select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(79, 70, 229, .12); }
.field-error, .form-errors { color: #b91c1c; font-size: .9rem; }
.form-errors ul { margin: 0 0 12px; padding-left: 18px; }
.error-page { text-align: center; padding: 72px 16px; }
.error-code { font-size: 5.5rem; font-weight: 800; margin: 0; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-page .search-big { max-width: 480px; margin: 24px auto; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #94a3b8; margin-top: 72px; padding-top: 64px; font-size: .93rem; }
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.4fr; gap: 40px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.logo-footer { color: #fff; margin-bottom: 12px; }
.logo-footer:hover { color: #fff; }
.footer-title { font-size: .8rem; color: #fff; margin-bottom: 14px; text-transform: uppercase; letter-spacing: .08em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 10px; }
.social { display: flex; gap: 8px; flex-wrap: wrap; }
.social a { padding: 6px 12px; border: 1px solid #1e293b; border-radius: 999px; font-size: .84rem; }
.social a:hover { border-color: #475569; text-decoration: none; }
.newsletter { display: flex; gap: 8px; flex-wrap: wrap; }
.newsletter input[type=email] { flex: 1; min-width: 180px; padding: 11px 14px; border-radius: 12px; border: 1px solid #1e293b; background: #111827; color: #fff; font: inherit; }
.newsletter input[type=email]::placeholder { color: #94a3b8; }
.newsletter button { padding: 11px 18px; border-radius: 12px; border: 0; background: var(--brand); color: #fff; cursor: pointer; font: inherit; font-weight: 700; }
.newsletter button:hover { filter: brightness(1.1); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-top: 1px solid #1e293b; margin-top: 48px; padding-top: 20px; padding-bottom: 24px; font-size: .84rem; color: #64748b; }
.footer-bottom p { margin: 0; }

/* ---------- Content protection ---------- */
body[data-protect="true"] .protected { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body[data-protect="true"] .protected img { pointer-events: none; -webkit-user-drag: none; }
@media print {
    body[data-protect="true"] main { display: none !important; }
    body[data-protect="true"]::after { content: "Printing is disabled for this content. Please read it online."; display: block; padding: 40px; font-size: 18px; }
    .site-header, .site-footer, .ad-slot { display: none !important; }
}
