:root {
    --brand: #0f766e;
    --brand-dark: #115e59;
    --bg: #ffffff;
    --bg-soft: #f3f7f6;
    --text: #14201e;
    --muted: #5b6b68;
    --border: #d9e3e0;
    --on-brand: #ffffff;
    --notice-bg: #fff8e1;
    --notice-border: #f0d78c;
}

@media (prefers-color-scheme: dark) {
    :root {
        --brand: #2dd4bf;
        --brand-dark: #5eead4;
        --bg: #0f1514;
        --bg-soft: #161e1d;
        --text: #e8f0ee;
        --muted: #9db0ac;
        --border: #2a3836;
        --on-brand: #06201c;
        --notice-bg: #2a2412;
        --notice-border: #5c4f1f;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
}

a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5rem; }
p { margin: 0 0 1rem; }

.container { width: 100%; max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 44rem; }
.center { text-align: center; }
.muted { color: var(--muted); }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 4rem; gap: 1rem; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.nav { display: flex; align-items: center; gap: 1.25rem; }
.nav a:not(.btn) { color: var(--text); text-decoration: none; }
.nav a:not(.btn):hover { color: var(--brand); }

.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; padding: 1.5rem 0; color: var(--muted); font-size: 0.9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer-links a { color: var(--muted); }

/* Buttons */
.btn {
    display: inline-block;
    background: var(--brand);
    color: var(--on-brand);
    padding: 0.75rem 1.4rem;
    border-radius: 0.5rem;
    border: 2px solid var(--brand);
    font-weight: 600;
    text-decoration: none;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-outline { background: transparent; color: var(--brand); }
.btn-outline:hover { background: var(--brand); color: var(--on-brand); }
.btn-small { padding: 0.4rem 0.9rem; font-size: 0.95rem; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 1.5rem; }

/* Sections */
.hero { padding: 4.5rem 0 3.5rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
.lead { font-size: 1.2rem; color: var(--muted); }
.section { padding: 3rem 0; }
.section.soft { background: var(--bg-soft); }
.section-title { font-size: 1.6rem; text-align: center; margin-bottom: 1.5rem; }
.page-title { font-size: clamp(1.8rem, 4vw, 2.5rem); }

.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--bg); border: 1px solid var(--border); border-radius: 0.75rem; padding: 1.5rem; }
.card h3 { font-size: 1.1rem; }
.card p:last-child { margin-bottom: 0; }
.step {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; border-radius: 50%;
    background: var(--brand); color: var(--on-brand); font-weight: 700; margin-bottom: 0.75rem;
}

/* Pricing */
.plans { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); max-width: 52rem; margin: 2rem auto 3rem; }
.plan { border: 1px solid var(--border); border-radius: 0.75rem; padding: 2rem; display: flex; flex-direction: column; }
.plan.featured { border: 2px solid var(--brand); }
.plan h2 { font-size: 1.3rem; }
.price { font-size: 2.2rem; font-weight: 700; margin-bottom: 0.25rem; }
.price span { font-size: 1rem; font-weight: 400; color: var(--muted); }
.ticks, .plain { padding: 0; margin: 1rem 0 1.5rem; }
.ticks { list-style: none; flex: 1; }
.ticks li { padding-left: 1.6rem; position: relative; margin-bottom: 0.6rem; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 700; }
.plain { padding-left: 1.25rem; }
.plan .btn { text-align: center; }

/* FAQ */
.faq { max-width: 44rem; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--border); padding: 0.9rem 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 0.6rem 0 0; color: var(--muted); }

/* Draft notice on placeholder pages */
.notice {
    background: var(--notice-bg);
    border: 1px solid var(--notice-border);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin: 1rem 0 1.5rem;
}

@media (max-width: 560px) {
    .nav { gap: 0.75rem; font-size: 0.95rem; }
    .hero { padding: 3rem 0 2rem; }
}

/* Course */
.meta { color: var(--muted); font-size: 0.95rem; margin-bottom: 1.5rem; }
.module-title { margin-top: 2rem; font-size: 1.3rem; }
.lesson-list { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.lesson-list li { padding: 0.9rem 0; border-bottom: 1px solid var(--border); }
.lesson-list li > a { font-weight: 600; margin-right: 0.5rem; }
.lesson-list p { margin: 0.25rem 0 0; }

.badge {
    display: inline-block; font-size: 0.75rem; font-weight: 600;
    padding: 0.1rem 0.5rem; border-radius: 999px;
    border: 1px solid var(--border); color: var(--muted); white-space: nowrap;
}
.badge-free, .badge-done, .badge-official { border-color: var(--brand); color: var(--brand); }
.badge-pro { background: var(--bg-soft); }
.badge-law { border-color: #6b5bd6; color: #6b5bd6; }
.badge-research { border-color: #2b7bb9; color: #2b7bb9; }
.badge-community { border-color: #c27c0e; color: #c27c0e; }

.lesson-body h2 { margin-top: 2rem; font-size: 1.4rem; }
.lesson-body ul, .lesson-body ol { padding-left: 1.4rem; margin: 0 0 1rem; }
.lesson-body li { margin-bottom: 0.4rem; }
.lesson-body blockquote { margin: 1rem 0; padding-left: 1rem; border-left: 3px solid var(--border); color: var(--muted); }
.cite a { text-decoration: none; font-size: 0.8em; }
.sources { padding-left: 1.4rem; }
.sources li { margin-bottom: 0.9rem; scroll-margin-top: 1rem; }
.sources li:target { background: var(--bg-soft); }
.updates { padding-left: 1.2rem; }
.lesson-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }


/* Import tables */
.data-table { width: 100%; border-collapse: collapse; margin: 0.5rem 0 1.5rem; }
.data-table th, .data-table td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); }
.data-table th { font-size: 0.85rem; color: var(--muted); }
.container input[type="text"], .container input[type="file"] { max-width: 100%; padding: 0.4rem; }
