/* ── WHY THIS FILE IS A SHARED SHEET (2026-10-20) ────────────────────────────
 *
 * These rules used to live inline in site/learn/index.html. They moved here
 * the day the playbook was split into real pages: one hub plus six lesson
 * pages at /learn/lesson-N/. Six inline copies of a 6 KB block is 36 KB of
 * duplicated CSS across seven documents, and every future tweak has to be
 * made seven times or the pages drift. /assets/* is cached for a year and
 * every reference is versioned, so one shared file is also the cheaper
 * download: the first lesson page pays for it once, the other five read it
 * from cache.
 *
 * The original design notes, preserved verbatim:
 *
 * ── WHY THIS PAGE IS BUILT THE WAY IT IS ────────────────────────────────────
 * This fixed a live 404. The app's "Playbook" button calls
 * bridge.openUrl('https://velrix.us.ci/learn/'), and /learn/ did not exist, so
 * the single most important button for a brand-new earner landed on the error
 * page.
 *
 * Three constraints shaped every decision below:
 *
 * 1. IT OPENS INSIDE THE APP'S WEBVIEW. The app is a React build in an Android
 *    WebView, and Playbook is an *external* URL, so this page opens as a raw
 *    web view with no app chrome around it and, on a bad connection, a font
 *    request that never resolves. So: no JavaScript at all, no build step, no
 *    runtime fetch. HTML and CSS only. The lesson text ships in the document.
 *
 * 2. IT IS READ BY SOMEONE WITH NO MONEY AND NO EXPERIENCE. The six lessons are
 *    written for a first-timer: what to say, what not to say, when the money
 *    arrives. That is why each lesson carries a numbered action rather than
 *    only prose, a lesson with no next step is a blog post.
 *
 * 3. IT MUST SHARE THE SITE'S SKIN. It links /assets/tools.css?v=3 for the nav,
 *    buttons, cards and tokens exactly like the tool pages, rather than
 *    inventing a fourth visual dialect. Everything page-specific is prefixed
 *    `.lx-` so it cannot collide with the shared sheet.
 *
 * There is deliberately no quiz. The app already quizzes the earner per lesson;
 * re-testing them here would be duplication, and duplication drifts.
 * ──────────────────────────────────────────────────────────────────────────── */

/* The whole page is one column. 720px is the reading measure, wider than this
   and the eye loses its place returning from the end of a line. */
.lx-wrap{max-width:760px}
.lx-head{padding:clamp(28px,6vw,56px) 0 clamp(18px,4vw,30px)}
.lx-kicker{
  font-family:var(--fm); font-size:.68rem; letter-spacing:.18em; text-transform:uppercase;
  color:var(--a-txt); margin:0 0 12px;
}
.lx-head h1{
  font-family:var(--fh); font-weight:600; line-height:1.06;
  /* Fluid. A fixed display size is a fixed minimum width, and at 300% zoom the
     viewport is 120px, the heading is the first thing that punches past it. */
  font-size:clamp(1.9rem,7.4vw,3.1rem); letter-spacing:-.01em; margin:0 0 14px;
}
.lx-head h1 em{font-style:normal; color:var(--a-txt)}
.lx-lead{color:var(--muted); font-size:clamp(.94rem,2.6vw,1.06rem); line-height:1.7; margin:0 0 22px}
.lx-head-meta{display:flex; flex-wrap:wrap; gap:clamp(8px,2vw,14px) clamp(12px,3vw,20px); align-items:center}
.lx-pill{
  display:inline-flex; align-items:center; gap:7px; padding:7px 14px; border-radius:100px;
  background:var(--card); border:1px solid var(--gb);
  font-family:var(--fm); font-size:.66rem; letter-spacing:.08em; text-transform:uppercase; color:var(--dim-txt);
  min-height:34px;
}

/* ── the six-lesson index ────────────────────────────────────────────────── */
.lx-index{
  margin:0 0 clamp(30px,7vw,54px); padding:clamp(15px,3.4vw,22px);
  border-radius:18px; background:var(--card); border:1px solid var(--gb);
}
.lx-index h2{
  font-family:var(--fm); font-size:.68rem; letter-spacing:.16em; text-transform:uppercase;
  color:var(--dim-txt); margin:0 0 12px; font-weight:500;
}
.lx-index ol{margin:0; padding:0; list-style:none; counter-reset:lx}
.lx-index li{counter-increment:lx; border-top:1px solid var(--tint-060)}
.lx-index li:first-child{border-top:0}
/* The link owns the full row, so the tap target is the row and not the word. */
.lx-index a{
  display:flex; align-items:baseline; gap:clamp(10px,2.6vw,16px);
  padding:11px 2px; color:var(--text); text-decoration:none;
  font-size:clamp(.88rem,2.4vw,1rem); line-height:1.45;
  transition:color .22s; min-height:44px; box-sizing:border-box;
}
.lx-index a::before{
  content:counter(lx,decimal-leading-zero); flex:0 0 auto;
  font-family:var(--fm); font-size:.7rem; color:var(--a-txt); letter-spacing:.04em;
  padding-top:.22em;
}
.lx-index a:hover, .lx-index a:focus-visible{color:var(--a-txt)}
.lx-index .lx-index-min{margin-left:auto; flex:0 0 auto; font-family:var(--fm); font-size:.66rem; color:var(--dim)}

/* ── touch targets on the chrome ────────────────────────────────────────────
   This page is opened inside the Android WebView, where the nav and footer
   links are the only way out of the playbook. The shared rule in tokens.css
   gives them 32px (the WCAG 2.2 floor, chosen site-wide on 2026-10-18); this
   page's own render guard asks for 44px, so it raises its own floor rather
   than changing every other page's nav height. */
.nav-links a, .nav .brand, footer a{
  min-height:44px; line-height:44px;
  display:inline-flex; align-items:center;
}

/* ── a lesson ────────────────────────────────────────────────────────────── */
.lx-lesson{
  margin:0 0 clamp(18px,4vw,26px); border-radius:20px; overflow:hidden;
  background:linear-gradient(135deg, rgba(14,11,26,.72), rgba(8,6,16,.86));
  border:1px solid var(--tint-065);
  /* Anchor offset: these are jump targets from the index, and a sticky nav would
     otherwise cover the first line of the heading. */
  scroll-margin-top:88px;
}
/* Light theme: the gradient above is a literal dark value, so on cream the
   cards stayed near-black while the ink had already flipped to dark — the
   rendered audit measured 57 pairs at 1.02:1. Same two-stop shape as the
   shared sheet's light card (white -> cream raised), so the cards keep their
   depth instead of becoming holes. */
[data-theme="light"] .lx-lesson{
  background:linear-gradient(135deg,#FFFFFF,#F2EEE8);
  border-color:rgba(20,19,26,.12);
}
/* Light theme: the note sits on a pale tint where the shared --dim lands at
   4.46:1 — half a point under AA. One step darker clears it without changing
   the note's visual weight. */
[data-theme="light"] .lx-mnote{ color:#63626E; }
.lx-lhead{
  display:flex; flex-wrap:wrap; gap:clamp(11px,3vw,16px); align-items:flex-start;
  padding:clamp(17px,4vw,26px) clamp(16px,4vw,26px) clamp(14px,3vw,18px);
  border-bottom:1px solid var(--tint-060);
}
.lx-num{
  flex:0 0 auto; width:40px; height:40px; border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  font-family:var(--fm); font-size:.84rem; font-weight:600;
  background:rgba(139,92,246,.12); border:1px solid rgba(139,92,246,.3); color:var(--a-txt);
}
.lx-ltitle{flex:1 1 220px; min-width:0}
/* h2 on the hub's index rows, h1 on a lesson page — same lesson, same type. */
.lx-ltitle h2, .lx-ltitle h1{
  font-family:var(--fh); font-weight:600; font-size:clamp(1.22rem,4vw,1.62rem);
  line-height:1.2; margin:0 0 7px; letter-spacing:-.005em;
}
.lx-lsum{color:var(--muted); font-size:.9rem; line-height:1.62; margin:0}
.lx-ltags{display:flex; flex-wrap:wrap; gap:7px; margin-top:11px}
.lx-tag{
  padding:4px 10px; border-radius:7px; font-family:var(--fm);
  font-size:.62rem; letter-spacing:.07em; text-transform:uppercase;
  background:var(--tint-050); border:1px solid var(--tint-080); color:var(--dim-txt);
}
.lx-tag.lx-r1{background:rgba(34,197,94,.1); border-color:rgba(34,197,94,.26); color:--ok-txt}
.lx-tag.lx-r2{background:rgba(245,158,11,.1); border-color:rgba(245,158,11,.26); color:--warn-txt}
.lx-tag.lx-r3{background:rgba(139,92,246,.11); border-color:rgba(139,92,246,.28); color:var(--a-txt)}

.lx-body{padding:clamp(15px,3.6vw,22px) clamp(16px,4vw,26px) clamp(17px,4vw,24px)}
/* Each point is a numbered row. A plain <ol> with its own counters, because the
   order inside a lesson matters (Rule #1 before Rule #4). */
.lx-steps{margin:0; padding:0; list-style:none; counter-reset:lxs}
.lx-steps li{
  counter-increment:lxs; position:relative; padding-left:clamp(26px,6vw,32px);
  margin-bottom:13px; font-size:clamp(.875rem,2.35vw,.95rem); line-height:1.68; color:var(--muted);
}
.lx-steps li:last-child{margin-bottom:0}
.lx-steps li::before{
  content:counter(lxs); position:absolute; left:0; top:.1em;
  width:clamp(18px,4.4vw,21px); height:clamp(18px,4.4vw,21px); border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-family:var(--fm); font-size:.6rem; font-weight:600;
  background:var(--tint-055); border:1px solid var(--tint-100); color:var(--dim-txt);
}
.lx-steps li b{color:var(--text); font-weight:600}

/* The one thing to actually do. Visually separated because a lesson the reader
   does not act on is worth nothing to either of us. */
.lx-action{
  display:flex; gap:11px; align-items:flex-start; margin-top:18px;
  padding:13px clamp(13px,3vw,16px); border-radius:13px;
  background:rgba(139,92,246,.075); border:1px solid rgba(139,92,246,.24);
}
.lx-action .lx-ai{flex:0 0 auto; font-family:var(--fm); font-size:.62rem; font-weight:600;
  letter-spacing:.1em; text-transform:uppercase; color:var(--a-txt); padding-top:.16em}
.lx-action p{margin:0; font-size:.85rem; line-height:1.62; color:var(--text)}

/* ── worked example ──────────────────────────────────────────────────────── */
.lx-math{
  margin-top:18px; padding:clamp(13px,3vw,18px); border-radius:13px;
  background:rgba(34,197,94,.06); border:1px solid rgba(34,197,94,.22);
}
.lx-math h3{
  font-family:var(--fm); font-size:.64rem; letter-spacing:.13em; text-transform:uppercase;
  color:--ok-txt; margin:0 0 11px; font-weight:500;
}
.lx-mrow{display:flex; flex-wrap:wrap; justify-content:space-between; gap:4px 14px; align-items:baseline;
  padding:7px 0; border-top:1px solid var(--tint-060); font-size:.85rem}
.lx-mrow:first-of-type{border-top:0}
.lx-mrow span{color:var(--muted); min-width:0}
.lx-mrow b{font-family:var(--fm); font-size:.87rem; color:var(--text); flex:0 0 auto}
.lx-mrow.lx-hi b{color:--ok-txt}
.lx-mnote{margin:12px 0 0; font-size:.76rem; line-height:1.6; color:var(--dim)}

/* ── closing block ───────────────────────────────────────────────────────── */
.lx-foot{
  margin:clamp(30px,7vw,48px) 0 0; padding:clamp(19px,4.4vw,30px); border-radius:20px; text-align:center;
  background:linear-gradient(135deg, rgba(139,92,246,.11), rgba(217,70,239,.055));
  border:1px solid rgba(139,92,246,.26);
}
.lx-foot h2{font-family:var(--fh); font-weight:600; font-size:clamp(1.35rem,4.4vw,1.9rem); margin:0 0 10px}
.lx-foot p{color:var(--muted); font-size:.92rem; line-height:1.68; margin:0 auto 20px; max-width:52ch}
.lx-acts{display:flex; flex-wrap:wrap; gap:11px; justify-content:center}
.lx-note{
  margin:22px 0 0; padding-top:18px; border-top:1px solid var(--tint-070);
  font-size:.78rem; line-height:1.66; color:var(--dim); text-align:left;
}
.lx-note b{color:var(--dim-txt); font-weight:600}

/* The hub's start CTA sits directly under the index. The flex row itself is
   the shared .lx-acts from the closing block; only the spacing is local. */
.lx-index + .lx-acts{margin:0 0 clamp(30px,7vw,54px)}

/* ── lesson-page chrome (added with the split) ──────────────────────────────
   A lesson page opens the way the hub used to: a plain way back, the lesson
   number, then the pager. Everything below is additive — the hub's own rules
   are untouched, and a lesson page is just the hub skin with one lesson in it. */
.lx-crumb{
  font-family:var(--fm); font-size:.68rem; letter-spacing:.12em; text-transform:uppercase;
  color:var(--dim); margin:26px 0 14px;
}
.lx-crumb a{color:var(--a-txt); text-decoration:none}
.lx-crumb a:hover, .lx-crumb a:focus-visible{text-decoration:underline}
/* On a lesson page the card IS the page, so it does not need the hub's
   inter-lesson gap below it. */
.lx-lesson-page{margin-bottom:0}
/* Prev / next. Two 44px targets, full-width and stacked on a phone so a thumb
   can hit either without aiming. */
.lx-pager{display:flex; flex-wrap:wrap; gap:11px; justify-content:space-between; margin:clamp(20px,5vw,32px) 0 0}
.lx-pager a{
  display:inline-flex; align-items:center; gap:8px; min-height:44px;
  padding:12px 18px; border-radius:13px; text-decoration:none;
  background:var(--card); border:1px solid var(--gb); color:var(--text);
  font-size:.9rem; font-weight:500; transition:border-color .2s, color .2s;
}
.lx-pager a:hover, .lx-pager a:focus-visible{border-color:rgba(139,92,246,.4); color:var(--a-txt)}
.lx-pager .lx-pager-next{margin-left:auto; text-align:right}

@media (max-width:600px){
  .lx-lhead{padding-bottom:14px}
  .lx-num{width:36px; height:36px; border-radius:10px}
  /* Stack the index rows so the "minutes" tag cannot squeeze the title into an
     unreadable column on a narrow phone. */
  .lx-index a{flex-wrap:wrap}
  .lx-index .lx-index-min{margin-left:calc(clamp(10px,2.6vw,16px) + 1.6em)}
  .lx-acts .btn{width:100%}
  .lx-pager a{width:100%; justify-content:center}
  .lx-pager .lx-pager-next{margin-left:0}
}
