:root {
  --bg: #0a0d12;
  --bg-2: #10141b;
  --panel: #141922;
  --panel-2: #1a2030;
  --line: #232a38;
  --text: #e7ebf2;
  --muted: #8a93a6;
  --accent: #d4ff3a;      /* brand lime */
  --accent-ink: #0a0d12;
  --gold: #f5b942;        /* premium */
  --bull: #22c39a;
  --bear: #f0566a;
  --radius: 14px;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --sans: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.55; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }

/* nav */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(10,13,18,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 18px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); font-size: 1.1rem; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); position: relative; }
.brand-mark::before, .brand-mark::after { content: ''; position: absolute; left: 6px; right: 6px; height: 4px; background: var(--accent-ink); border-radius: 2px; }
.brand-mark::before { top: 7px; } .brand-mark::after { bottom: 7px; }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav-links a { color: var(--muted); padding: 7px 12px; border-radius: 8px; font-size: .94rem; font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--panel); text-decoration: none; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }
.badge.free { background: rgba(212,255,58,.12); color: var(--accent); }
.badge.premium { background: rgba(245,185,66,.14); color: var(--gold); }
.badge.locked { background: var(--panel-2); color: var(--muted); }
@media (max-width: 720px) {
  .nav .wrap { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .nav-links { margin-left: 0; width: 100%; }
  .nav-links a { padding: 6px 9px; font-size: .88rem; }
}

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 650; font-size: .95rem; border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 11px 18px; border-radius: 10px; cursor: pointer; transition: transform .08s, background .15s, border-color .15s; }
.btn:hover { text-decoration: none; border-color: #34405a; background: var(--panel-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.gold { background: var(--gold); color: #1a1205; border-color: var(--gold); }
.btn.bull { background: var(--bull); border-color: var(--bull); color: #04140f; }
.btn.bear { background: var(--bear); border-color: var(--bear); color: #1a0509; }
.btn.small { padding: 7px 12px; font-size: .85rem; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* cards & layout */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
section { padding: 72px 0; }
.eyebrow { font-family: var(--mono); color: var(--accent); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 12px; }

/* hero */
.hero { padding: 80px 0 60px; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(600px 300px at 80% 10%, rgba(212,255,58,.10), transparent 70%), radial-gradient(500px 300px at 10% 90%, rgba(34,195,154,.08), transparent 70%); pointer-events: none; }
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.hero p.lead { font-size: 1.15rem; color: #b8c0cf; max-width: 34em; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-art { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.hero-art canvas { width: 100%; height: 300px; display: block; }
@media (max-width: 880px) { .hero .wrap { grid-template-columns: 1fr; } }

.feature .icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-2); margin-bottom: 14px; color: var(--accent); }
.feature p { color: var(--muted); margin: 0; }

/* pricing */
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; max-width: 820px; margin: 0 auto; }
.plan { padding: 28px; }
.plan.featured { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 20px 60px rgba(245,185,66,.08); }
.plan .price { font-size: 2.8rem; font-weight: 800; letter-spacing: -0.03em; }
.plan .price small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.plan ul { list-style: none; padding: 0; margin: 18px 0 24px; }
.plan li { padding: 7px 0 7px 26px; position: relative; color: #c9d0dc; }
.plan li::before { content: ''; position: absolute; left: 2px; top: 13px; width: 12px; height: 7px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.plan.featured li::before { border-color: var(--gold); }

/* forms */
.form { max-width: 420px; margin: 60px auto; }
label { display: block; font-size: .88rem; color: var(--muted); margin: 14px 0 6px; font-weight: 500; }
input, select { width: 100%; font: inherit; color: var(--text); background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; outline: none; }
input:focus, select:focus { border-color: var(--accent); }
.error { color: var(--bear); font-size: .9rem; min-height: 1.4em; margin-top: 10px; }
.notice { background: rgba(212,255,58,.07); border: 1px solid rgba(212,255,58,.25); border-radius: 10px; padding: 12px 14px; font-size: .92rem; }
.notice.gold { background: rgba(245,185,66,.07); border-color: rgba(245,185,66,.3); }

/* lessons */
.learn { display: grid; grid-template-columns: 300px 1fr; gap: 24px; padding: 30px 0 80px; }
@media (max-width: 860px) { .learn { grid-template-columns: 1fr; } }
.lesson-list { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 80px; align-self: start; }
.lesson-item { display: flex; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 10px; color: var(--text); border: 1px solid transparent; }
.lesson-item:hover { background: var(--panel); text-decoration: none; }
.lesson-item.active { background: var(--panel); border-color: var(--line); }
.lesson-item .num { font-family: var(--mono); font-size: .8rem; color: var(--muted); width: 22px; }
.lesson-item .t { flex: 1; font-size: .93rem; font-weight: 550; }
.lesson-item.locked .t { color: var(--muted); }
.lesson-item .done { color: var(--bull); }
.lesson-body { max-width: 760px; }
.lesson-body h2 { margin-top: 1.6em; font-size: 1.45rem; }
.lesson-body h3 { margin-top: 1.4em; }
.lesson-body p, .lesson-body li { color: #c9d0dc; }
.lesson-body ul, .lesson-body ol { padding-left: 1.3em; }
.lesson-body li { margin: .35em 0; }
.lesson-body .callout { background: var(--panel); border-left: 3px solid var(--accent); padding: 14px 16px; border-radius: 8px; margin: 1.2em 0; }
.lesson-body .callout.warn { border-color: var(--gold); }
.lesson-body .video { aspect-ratio: 16/9; background: var(--panel); border: 1px dashed var(--line); border-radius: 12px; display: grid; place-items: center; color: var(--muted); margin: 1.2em 0; font-size: .9rem; text-align: center; padding: 20px; }
.lesson-body table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: .93rem; }
.lesson-body th, .lesson-body td { border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: left; }
.lesson-body th { color: var(--muted); font-weight: 600; }
.lesson-body svg { max-width: 100%; height: auto; display: block; margin: 1.2em 0; }
.paywall { text-align: center; padding: 50px 24px; }
.paywall .lock { width: 52px; height: 52px; border-radius: 14px; background: rgba(245,185,66,.12); color: var(--gold); display: grid; place-items: center; margin: 0 auto 16px; }

/* footer */
footer { border-top: 1px solid var(--line); padding: 36px 0 50px; color: var(--muted); font-size: .85rem; }
footer .disclaimer { max-width: 760px; }

/* ---------- lesson library & widgets ---------- */
.fig-cap { color: var(--muted); font-size: .84rem; margin-top: 8px; text-align: center; }
.sketch { margin: 1.4em 0; }
.examples { margin: 1.6em 0; }
.ex-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; font-size: .92rem; }
.ex-head .btn { margin-left: auto; }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; }
.ex-card { margin: 0; background: #0d1117; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-height: 120px; }
.ex-card figcaption { padding: 8px 10px; font-size: .82rem; border-top: 1px solid var(--line); }
.ex-loading { height: 266px; background: linear-gradient(90deg, #0d1117, #141922, #0d1117); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.pos { color: var(--bull); } .neg { color: var(--bear); }
.lib-filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 18px 0 8px; }
.pill { font: inherit; font-size: .85rem; font-weight: 600; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; }
.pill.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.lib-cat { margin-top: 34px; }
.lib-cat h2 { font-size: 1.3rem; display: flex; align-items: baseline; gap: 10px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.lcard { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: var(--text); transition: border-color .15s, transform .1s; }
.lcard:hover { text-decoration: none; border-color: #3a4458; transform: translateY(-1px); }
.lcard .t { font-weight: 700; line-height: 1.3; }
.lcard .s { color: var(--muted); font-size: .86rem; flex: 1; }
.lcard .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.badge.tool { background: rgba(122,162,255,.14); color: #7aa2ff; }
.badge.done { background: rgba(34,195,154,.14); color: var(--bull); }
.reader { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 28px; padding: 28px 0 80px; }
@media (max-width: 900px) { .reader { grid-template-columns: 1fr; } .reader aside { order: 2; } }
.lesson-body .preview-end { border-top: 1px dashed var(--line); margin: 28px 0; }
.lesson-body .rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 1em 0; }
.lesson-body .rules > div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.lesson-body .rules b { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.lesson-body .rules > div p { margin: 0; color: var(--text); font-size: .93rem; }
.lesson-body ul.check { list-style: none; padding-left: 0; }
.lesson-body ul.check li { padding-left: 26px; position: relative; }
.lesson-body ul.check li::before { content: ''; position: absolute; left: 4px; top: 8px; width: 11px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.lesson-body ul.x li::marker { color: var(--bear); }
.practice { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: space-between; background: linear-gradient(135deg, rgba(122,162,255,.10), rgba(212,255,58,.06)); border: 1px solid #2c3a5a; border-radius: 14px; padding: 18px; margin: 28px 0; }
.locked-list { text-align: left; max-width: 420px; margin: 0 auto 22px; }
