/* learn.scushi.dev — Brilliant-flavored, zero dependencies */
:root {
  --bg: #f7f8fc; --card: #ffffff; --ink: #1d2340; --dim: #6b7194;
  --accent: #5646ef; --accent-soft: #eeecfe; --green: #1ca872; --green-soft: #e5f6ef;
  --red: #e0484c; --red-soft: #fdeaea; --amber: #f5b83d; --line: #e4e7f2;
  --radius: 16px; --shadow: 0 2px 10px rgba(29,35,64,.07);
  font-size: 16.5px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif; line-height: 1.62; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1.4rem;
  padding: .65rem 1.4rem; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.1rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.brand .dim { color: var(--dim); font-weight: 500; }
.topnav { display: flex; gap: 1rem; flex: 1; }
.topnav a { color: var(--dim); text-decoration: none; font-weight: 600; font-size: .95rem; padding: .3rem .7rem; border-radius: 8px; }
.topnav a:hover, .topnav a.active { color: var(--accent); background: var(--accent-soft); }
.xp-wrap { display: flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .95rem; color: var(--ink); }

main { max-width: 860px; margin: 0 auto; padding: 2rem 1.3rem 4rem; }
.foot { text-align: center; color: var(--dim); font-size: .82rem; padding: 2rem 1rem 3rem; }

/* ---------- dashboard ---------- */
.hero { margin: 0 0 1.6rem; }
.hero h1 { font-size: 2.1rem; letter-spacing: -.03em; margin: 0 0 .4rem; }
.hero p { color: var(--dim); margin: 0; max-width: 40rem; }
.progress-strip { display: flex; align-items: center; gap: .8rem; margin: 1.1rem 0 .3rem; }
.progress-strip .bar { flex: 1; max-width: 26rem; height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress-strip .bar > div { height: 100%; background: linear-gradient(90deg, var(--accent), #8a7cff); border-radius: 99px; transition: width .5s; }
.progress-strip small { color: var(--dim); font-weight: 600; }

.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 1rem; margin-top: 1.4rem; }
.mod-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem;
  text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: .45rem; box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s; position: relative; }
.mod-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(29,35,64,.12); }
.mod-card .num { font-size: .74rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.mod-card h3 { margin: 0; font-size: 1.06rem; letter-spacing: -.01em; line-height: 1.35; }
.mod-card p { margin: 0; font-size: .87rem; color: var(--dim); line-height: 1.5; }
.mod-card .ch { font-size: .76rem; color: var(--dim); font-weight: 600; }
.mod-card .done { position: absolute; top: .9rem; right: 1rem; color: var(--green); font-weight: 800; font-size: .8rem; }
.mod-card .minibar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: .3rem; }
.mod-card .minibar > div { height: 100%; background: var(--green); }

/* ---------- lesson ---------- */
.lesson-head { margin-bottom: 1.4rem; }
.crumb { font-size: .82rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); text-decoration: none; }
.lesson-head h1 { font-size: 1.9rem; letter-spacing: -.03em; margin: .35rem 0 .3rem; }
.lesson-head .sub { color: var(--dim); margin: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.4rem 1.6rem; margin: 1.2rem 0; }
.prose h2 { font-size: 1.25rem; letter-spacing: -.02em; margin: 1.6rem 0 .5rem; }
.prose p { margin: .6rem 0; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: .6rem 0; }
.prose li { margin: .3rem 0; }
.prose strong { color: var(--ink); }
.m { font-family: "Georgia", "Times New Roman", serif; font-style: italic; background: var(--accent-soft);
  padding: .08em .4em; border-radius: 6px; white-space: nowrap; font-size: .96em; }
.formula { font-family: Georgia, serif; font-size: 1.25rem; text-align: center; padding: 1rem .8rem;
  background: var(--accent-soft); border-radius: 12px; margin: .9rem 0; overflow-x: auto; }
.formula .lbl { display: block; font-family: "Inter", sans-serif; font-size: .78rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; color: var(--accent); margin-bottom: .45rem; }
.callout { border-left: 4px solid var(--amber); background: #fff9ec; border-radius: 0 12px 12px 0; padding: .8rem 1.1rem; margin: 1rem 0; font-size: .95rem; }
.callout .tag { font-weight: 800; font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: #a07714; display: block; margin-bottom: .2rem; }
.excel { font-family: "SF Mono", ui-monospace, Consolas, monospace; font-size: .84rem; background: #10142b; color: #c9d4ff;
  border-radius: 10px; padding: .7rem 1rem; overflow-x: auto; margin: .7rem 0; white-space: pre; }

/* ---------- widgets ---------- */
.widget { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.3rem 1.5rem; margin: 1.2rem 0; }
.widget h3 { margin: 0 0 .2rem; font-size: 1.08rem; letter-spacing: -.01em; }
.widget .hint { color: var(--dim); font-size: .88rem; margin: 0 0 .9rem; }
.widget canvas { width: 100%; height: 260px; display: block; background: #fbfbfe; border: 1px solid var(--line); border-radius: 12px; }
.w-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem; margin-top: .9rem; }
.w-controls label { font-size: .86rem; font-weight: 600; color: var(--dim); display: flex; align-items: center; gap: .55rem; }
.w-controls input[type=range] { width: 150px; accent-color: var(--accent); }
.w-controls .val { font-weight: 800; color: var(--ink); min-width: 3.2em; display: inline-block; }
.w-btn { border: none; background: var(--accent); color: #fff; font-weight: 700; font-size: .88rem; padding: .5rem 1.1rem;
  border-radius: 10px; cursor: pointer; font-family: inherit; }
.w-btn:hover { filter: brightness(1.1); }
.w-btn.ghost { background: var(--accent-soft); color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: none; background: #fff; padding: .42rem .9rem; font-family: inherit; font-size: .84rem; font-weight: 600; color: var(--dim); cursor: pointer; }
.seg button.on { background: var(--accent); color: #fff; }
.w-readout { margin-top: .8rem; font-size: .95rem; }
.w-readout b { font-size: 1.05rem; }

/* ---------- quiz ---------- */
.quiz { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem 1.6rem; margin: 1.2rem 0; }
.quiz .qn { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.quiz .q { font-size: 1.06rem; font-weight: 600; margin: .3rem 0 .9rem; }
.choice { display: block; width: 100%; text-align: left; font-family: inherit; font-size: .95rem; color: var(--ink);
  background: #fbfbfe; border: 1.5px solid var(--line); border-radius: 12px; padding: .65rem .95rem; margin: .45rem 0; cursor: pointer; transition: border-color .12s, background .12s; }
.choice:hover { border-color: var(--accent); }
.choice.correct { border-color: var(--green); background: var(--green-soft); font-weight: 600; }
.choice.wrong { border-color: var(--red); background: var(--red-soft); }
.choice:disabled { cursor: default; opacity: .75; }
.choice.correct:disabled, .choice.wrong:disabled { opacity: 1; }
.why { display: none; border-radius: 12px; padding: .75rem 1rem; margin-top: .7rem; font-size: .92rem; }
.why.good { background: var(--green-soft); border: 1px solid #bfe8d6; }
.why.bad { background: var(--red-soft); border: 1px solid #f3c6c8; }
.quiz-score { font-weight: 700; margin-top: 1rem; }
.module-done-banner { background: var(--green-soft); border: 1px solid #bfe8d6; color: #0d6b46; font-weight: 700;
  border-radius: 12px; padding: .8rem 1.1rem; margin: 1.3rem 0; }

/* ---------- reference ---------- */
.ref-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: .8rem 0; }
.ref-table th { text-align: left; font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); border-bottom: 2px solid var(--line); padding: .45rem .6rem; }
.ref-table td { border-bottom: 1px solid var(--line); padding: .55rem .6rem; vertical-align: top; }
.ref-table td:first-child { font-weight: 600; white-space: nowrap; }

.next-lesson { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; }
.next-lesson a { background: var(--accent); color: #fff; text-decoration: none; font-weight: 700; padding: .7rem 1.4rem; border-radius: 12px; }
.next-lesson a:hover { filter: brightness(1.1); }

@media (max-width: 640px) { :root { font-size: 15.5px; } .topnav { gap: .2rem; } .card, .widget, .quiz { padding: 1.1rem 1rem; } }
