
:root{
  --ground:#f6f8fa;
  --surface:#ffffff;
  --ink:#1c2733;
  --muted:#51606e;
  --line:#dbe2e8;
  --red:#d2432f;      /* the red face of a two-colour counter */
  --yellow:#f1b82d;   /* the yellow face */
  --blue:#2c5d8a;     /* links and the rung you are on */
  --blue-soft:#e4edf5;
  --red-soft:#fbe9e5;
  --yellow-soft:#fdf3d8;
  --on-red:#ffffff;
  --yellow-ink:#8a5a00;
  --display:"Poppins", "Segoe UI", system-ui, sans-serif;
  --body:"Poppins", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    color-scheme:dark;
    --ground:#121a22; --surface:#1a242e; --ink:#e8eef3; --muted:#a3b1bd; --line:#2e3b47;
    --red:#ef6b55; --yellow:#f4c64f; --blue:#8bb8e0; --blue-soft:#1f3346; --red-soft:#3a2420; --yellow-soft:#3a3120; --on-red:#121a22; --yellow-ink:#f4c64f;
  }
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --ground:#121a22; --surface:#1a242e; --ink:#e8eef3; --muted:#a3b1bd; --line:#2e3b47;
  --red:#ef6b55; --yellow:#f4c64f; --blue:#8bb8e0; --blue-soft:#1f3346; --red-soft:#3a2420; --yellow-soft:#3a3120; --on-red:#121a22; --yellow-ink:#f4c64f;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0}
img{max-width:100%}
[hidden]{display:none!important}
body{background:var(--ground);color:var(--ink);font-family:var(--body);font-size:17px;line-height:1.7;padding-inline:16px;padding-block:0 64px}
.wrap{max-width:1040px;margin:0 auto}
a{color:var(--blue);text-underline-offset:3px}
a:focus-visible,button:focus-visible,input:focus-visible+span,label:focus-within{outline:3px solid var(--blue);outline-offset:3px;border-radius:6px}
h1,h2,h3{font-family:var(--display);text-wrap:balance;line-height:1.15;margin:0}
h2{font-size:1.6rem;font-weight:800}
h3{font-size:1.1rem;font-weight:600}
p{margin:0}
.muted{color:var(--muted)}

/* brand bar */
.brand{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-block:18px;border-bottom:1px solid var(--line);flex-wrap:wrap}
.brand b{font-family:var(--display);font-weight:800;font-size:1.05rem;letter-spacing:.01em;display:flex;align-items:center;gap:10px}
.dots{display:inline-flex;gap:3px}
.dots i{width:10px;height:10px;border-radius:50%;background:var(--red)}
.dots i:last-child{background:var(--yellow)}
.brand small{color:var(--muted);font-size:.85rem}

/* hero */
.hero{display:grid;gap:28px;padding-block:36px 28px;grid-template-columns:1fr}
.eyebrow{font-size:.8rem;font-weight:700;text-transform:uppercase;letter-spacing:.09em;color:var(--muted)}
.hero h1{font-size:clamp(2.6rem,9vw,4.4rem);font-weight:800;margin-block:6px 14px}
.hero h1 span{color:var(--red)}
.lede{font-size:1.15rem;max-width:36em}
@media(min-width:880px){.hero{grid-template-columns:1.2fr 1fr;align-items:end}}

/* ladder */
.ladder{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.ladder li{display:grid;grid-template-columns:34px 1fr auto;align-items:center;gap:10px;padding:8px 12px;border-radius:10px;border:1px solid var(--line);background:var(--surface);font-size:.95rem}
.ladder .n{font-family:var(--display);font-weight:800;color:var(--muted);text-align:center;font-variant-numeric:tabular-nums}
.ladder .tag{font-size:.75rem;color:var(--muted)}
.ladder li.here{background:var(--blue-soft);border-color:var(--blue);font-weight:700}
.ladder li.here .n,.ladder li.here .tag{color:var(--blue)}
.ladder li.done .tag{color:var(--muted)}
.ladder-cap{font-size:.8rem;font-weight:700;text-transform:uppercase;letter-spacing:.09em;color:var(--muted);margin-bottom:8px}

/* layout */
.cols{display:grid;gap:22px;grid-template-columns:1fr}
@media(min-width:880px){.cols{grid-template-columns:1fr 1fr}}
section{padding-block:28px;border-top:1px solid var(--line);display:grid;gap:16px}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:20px;display:grid;gap:12px;align-content:start}

.ticks{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.ticks li{display:grid;grid-template-columns:22px 1fr;gap:10px}
.ticks li::before{content:"";width:12px;height:12px;border-radius:50%;background:var(--yellow);margin-top:7px}

/* steps inside the rung */
.steps{list-style:none;margin:0;padding:0;display:grid;gap:12px;counter-reset:s;grid-template-columns:1fr}
@media(min-width:640px){.steps{grid-template-columns:1fr 1fr}}
@media(min-width:980px){.steps{grid-template-columns:repeat(3,1fr)}}
.steps li{counter-increment:s;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:16px 18px;display:grid;gap:6px;align-content:start}
.steps li::before{content:"Step " counter(s);font-size:.95rem;font-weight:700;color:var(--red)}
.eg{font-variant-numeric:tabular-nums;font-weight:700;color:var(--ink)}

/* ten frame */
.try{display:grid;gap:20px;grid-template-columns:1fr;align-items:center}
@media(min-width:880px){.try{grid-template-columns:auto 1fr}}
.frame{display:grid;grid-template-columns:repeat(5,1fr);gap:0;border:3px solid var(--ink);border-radius:8px;width:min(100%,380px);background:var(--surface)}
.cell{aspect-ratio:1;border:0;border-right:2px solid var(--ink);border-bottom:2px solid var(--ink);background:transparent;display:grid;place-items:center;cursor:pointer;padding:0}
.cell:nth-child(5n){border-right:0}
.cell:nth-child(n+6){border-bottom:0}
.cell i{width:68%;aspect-ratio:1;border-radius:50%;border:2px dashed var(--line);transition:transform .15s ease,background .15s ease}
.cell.on i{background:var(--red);border:0;transform:scale(1)}
.cell.gap i{border-color:var(--yellow)}
.readout{display:grid;gap:10px}
.sum{font-family:var(--display);font-weight:800;font-size:clamp(2rem,6vw,3rem);font-variant-numeric:tabular-nums}
.sum .a{color:var(--red)}
.sum .b{color:var(--yellow-ink)}
.btns{display:flex;flex-wrap:wrap;gap:10px}
button.b{font:inherit;font-weight:700;min-height:44px;padding:0 18px;border-radius:10px;border:1px solid var(--line);background:var(--surface);color:var(--ink);cursor:pointer}
button.b.primary{background:var(--blue);border-color:var(--blue);color:var(--surface)}
@media (prefers-reduced-motion: reduce){.cell i{transition:none}}

/* activities */
.filters{display:flex;flex-wrap:wrap;gap:8px}
.filters button{font:inherit;font-size:.95rem;min-height:44px;padding:0 16px;border-radius:8px;border:1px solid var(--line);background:var(--surface);color:var(--ink);cursor:pointer}
.filters button[aria-pressed="true"]{background:var(--blue-soft);border-color:var(--blue);font-weight:700}
.acts{display:grid;gap:14px;grid-template-columns:1fr}
@media(min-width:760px){.acts{grid-template-columns:1fr 1fr}}
.act{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:18px 20px;display:grid;gap:10px;align-content:start}
.act header{display:flex;justify-content:space-between;align-items:baseline;gap:10px;flex-wrap:wrap}
.where{font-size:.75rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;padding:3px 8px;border-radius:6px}
.where.home{background:var(--blue-soft);color:var(--blue)}
.where.outside{background:var(--yellow-soft);color:var(--ink)}
.where.group{background:var(--red-soft);color:var(--ink)}
.need{font-size:.92rem;color:var(--muted)}
.say{border-left:3px solid var(--yellow);padding-left:12px;font-style:italic}

/* snags */
.snags{display:grid;gap:12px;grid-template-columns:1fr}
@media(min-width:760px){.snags{grid-template-columns:1fr 1fr}}
.snag{display:grid;gap:4px}
.snag b{font-family:var(--display);font-weight:600}

/* move-on checklist */
.check{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.check label{display:grid;grid-template-columns:28px 1fr;gap:10px;align-items:start;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface);cursor:pointer;min-height:44px}
.check input{width:22px;height:22px;margin:2px 0 0;accent-color:var(--blue)}
.progress{font-weight:700;font-variant-numeric:tabular-nums}

.resources{display:grid;gap:10px;margin:0;padding-left:1.2em}
.next{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;background:var(--blue-soft);border-radius:14px;padding:20px}
.next b{font-family:var(--display);font-size:1.25rem}
footer{padding-block:28px;border-top:1px solid var(--line);color:var(--muted);font-size:.9rem;display:grid;gap:6px}
.sample{font-size:.8rem;font-weight:700;background:var(--yellow-soft);color:var(--ink);padding:3px 8px;border-radius:6px}
.home{color:inherit;text-decoration:none}
.ladders{display:grid;gap:18px;grid-template-columns:1fr;padding-block:8px 28px}
@media(min-width:760px){.ladders{grid-template-columns:1fr 1fr}}
.ladder li a{color:inherit;text-decoration:underline;text-underline-offset:3px}

/* ---------- home page ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:0 20px;border-radius:10px;border:1px solid var(--line);background:var(--surface);color:var(--ink);font-weight:700;text-decoration:none}
.btn.primary{background:var(--blue);border-color:var(--blue);color:var(--surface)}
.hm-hero{display:grid;gap:28px;padding-block:36px 32px;grid-template-columns:1fr;align-items:end}
.hm-hero h1{font-size:clamp(2.5rem,9vw,4.6rem);font-weight:800;margin-block:6px 14px}
.hm-hero h1 span{color:var(--red)}
.hm-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:22px}
@media(max-width:420px){.hm-actions .btn{flex:1 1 100%}}
/* a staircase of counters: each column one more than the last */
.hm-steps{display:flex;align-items:flex-end;gap:clamp(6px,1.6vw,12px);justify-content:flex-start}
.hm-steps .col{display:flex;flex-direction:column-reverse;gap:clamp(4px,1vw,8px)}
.hm-steps i{display:block;width:clamp(22px,6.4vw,40px);aspect-ratio:1;border-radius:50%;background:var(--red)}
.hm-steps .col:nth-child(even) i{background:var(--yellow)}
@media(min-width:880px){.hm-hero{grid-template-columns:1.25fr 1fr}.hm-steps{justify-content:flex-end}}

.hm-how,.hm-ladders,.hm-promises,.hm-about{padding-block:32px;border-top:1px solid var(--line);display:grid;gap:18px}
.hm-how-list{list-style:none;margin:0;padding:0;display:grid;gap:12px;grid-template-columns:1fr;counter-reset:h}
@media(min-width:640px){.hm-how-list{grid-template-columns:1fr 1fr}}
@media(min-width:980px){.hm-how-list{grid-template-columns:repeat(4,1fr)}}
.hm-how-list li{counter-increment:h;display:grid;gap:6px;align-content:start;padding:18px;border:1px solid var(--line);border-radius:14px;background:var(--surface)}
.hm-how-list li::before{content:counter(h);font-family:var(--display);font-weight:800;font-size:1.1rem;width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:var(--red);color:var(--on-red)}
.hm-how-list li:nth-child(even)::before{background:var(--yellow);color:#1c2733}
.hm-section-head{display:grid;gap:4px}

.subject{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:20px;display:grid;gap:14px;align-content:start}
.subject-head{display:grid;gap:2px}
.subject-head h3{font-size:1.45rem;font-weight:800}
.subject-head p{color:var(--muted)}
.subject .ladder li{background:var(--ground)}
.subject .ladder li.ready{background:var(--blue-soft);border-color:var(--blue);font-weight:700}
.subject .ladder li.ready .n,.subject .ladder li.ready .tag{color:var(--blue)}
.subject .ladder li.ready a{color:var(--ink)}
.ladder li{min-height:44px}

.promise-grid{display:grid;gap:12px;grid-template-columns:1fr}
@media(min-width:640px){.promise-grid{grid-template-columns:1fr 1fr}}
@media(min-width:980px){.promise-grid{grid-template-columns:repeat(4,1fr)}}
.promise{display:grid;gap:6px;align-content:start;padding:18px 18px 18px 20px;border-radius:14px;background:var(--surface);border:1px solid var(--line)}
.hm-about p{max-width:40em;font-size:1.1rem}

/* ---------- rung pages: shared parts ---------- */
.brand small a{color:inherit}
.subject-head h3 a{color:inherit;text-decoration:none}
.ladder li a{color:inherit}
.rung-nav{display:grid;gap:12px;grid-template-columns:1fr;padding-block:28px;border-top:1px solid var(--line)}
@media(min-width:760px){.rung-nav{grid-template-columns:1fr 1fr}}
.prevnext{display:grid;gap:4px;align-content:start;padding:18px 20px;border-radius:14px;border:1px solid var(--line);background:var(--surface);color:var(--ink);text-decoration:none;min-height:44px}
.prevnext.next{background:var(--blue-soft);border-color:var(--blue)}
.prevnext b{font-family:var(--display);font-size:1.2rem}
.rung-cards{list-style:none;margin:0;padding:0 0 32px;display:grid;gap:12px;grid-template-columns:1fr}
@media(min-width:760px){.rung-cards{grid-template-columns:1fr 1fr}}
.rung-cards a{display:grid;grid-template-columns:44px 1fr;gap:14px;align-items:start;padding:18px 20px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--ink);text-decoration:none;height:100%}
.rung-cards .n{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:var(--red);color:var(--on-red);font-family:var(--display);font-weight:800;font-size:1.2rem}
.rung-cards li:nth-child(even) .n{background:var(--yellow);color:#1c2733}
.rc-body{display:grid;gap:4px}
.rc-body b{font-family:var(--display);font-size:1.2rem}
.act{min-width:0}
.act header .where{white-space:normal}
.try-widget{display:grid;gap:18px}
.try-widget .btns .b:disabled{opacity:.45;cursor:not-allowed}
.seg{display:flex;flex-wrap:wrap;gap:8px}
.seg button{font:inherit;font-size:.95rem;min-height:44px;padding:0 14px;border-radius:8px;border:1px solid var(--line);background:var(--surface);color:var(--ink);cursor:pointer}
.seg button[aria-pressed="true"]{background:var(--blue-soft);border-color:var(--blue);font-weight:700}
.stepper{display:grid;grid-template-columns:1fr 48px 48px 48px;align-items:center;gap:8px;max-width:340px}
.stepper button{font:inherit;font-size:1.3rem;font-weight:700;height:48px;border-radius:10px;border:1px solid var(--line);background:var(--surface);color:var(--ink);cursor:pointer}
.stepper button:disabled{opacity:.4;cursor:not-allowed}
.stepper output{text-align:center;font-family:var(--display);font-weight:800;font-size:1.3rem;font-variant-numeric:tabular-nums}

/* dot card */
.countcard{position:relative;width:min(100%,340px);aspect-ratio:5/4;border-radius:16px;background:var(--surface);border:2px solid var(--ink)}
.cdot{position:absolute;width:46px;height:46px;border-radius:50%;border:0;padding:0;background:var(--red);color:var(--on-red);transform:translate(-50%,-50%);font:800 1.2rem var(--display);cursor:pointer;display:grid;place-items:center}
.cdot.alt{background:var(--yellow);color:#1c2733}
.cdot[data-n]{box-shadow:0 0 0 3px var(--ink)}

/* number line */
.nl-box{overflow-x:auto;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:8px}
.nl-box svg{display:block;width:100%;height:auto}
.nl-axis,.nl-tick{stroke:var(--ink);stroke-width:2}
.nl-num{fill:var(--muted);font:600 13px var(--body);text-anchor:middle}
.nl-num.ten{fill:var(--ink);font-weight:700}
.nl-start{fill:var(--red)}
.nl-end{fill:var(--yellow);stroke:var(--ink);stroke-width:2}
.nl-hop{fill:none;stroke:var(--blue);stroke-width:2.5}

/* base ten */
.b10-mat{display:grid;grid-template-columns:auto 1fr;gap:20px;align-items:end;min-height:180px;padding:16px;background:var(--surface);border:1px solid var(--line);border-radius:14px}
.b10-tens{display:flex;gap:6px;align-items:flex-end;min-width:20px}
.b10-tens .rod{display:grid;grid-template-rows:repeat(10,14px);gap:1px;width:16px;background:var(--ink);padding:1px;border-radius:3px}
.b10-tens .rod b{background:var(--red);border-radius:1px}
.b10-ones{display:grid;grid-template-columns:repeat(5,16px);gap:3px;align-content:end}
.b10-ones .cube{width:16px;height:16px;background:var(--yellow);border:1px solid var(--ink);border-radius:3px}

/* arrays */
.arr{display:grid;gap:6px;width:max-content;max-width:100%;padding:14px;background:var(--surface);border:1px solid var(--line);border-radius:14px}
.arr i{aspect-ratio:1;border-radius:50%;background:var(--red)}
.arr i.alt{background:var(--yellow)}

/* sharing */
.share-groups{display:grid;grid-template-columns:repeat(auto-fit,minmax(96px,1fr));gap:10px}
.plate{min-height:96px;border:2px dashed var(--muted);border-radius:50%;display:flex;flex-wrap:wrap;gap:4px;align-content:center;justify-content:center;padding:14px;aspect-ratio:1}
.plate i,.share-left i{width:14px;height:14px;border-radius:50%;background:var(--red)}
.share-left{display:flex;flex-wrap:wrap;gap:4px;align-items:center;min-height:24px}
.share-left span{margin-right:6px}
.share-left i{background:var(--yellow)}

/* fraction bar */
.fbar{display:flex;height:72px;border:3px solid var(--ink);border-radius:8px;overflow:hidden;background:var(--surface)}
.fbar button{flex:1;border:0;border-right:2px solid var(--ink);background:transparent;cursor:pointer;min-width:0;padding:0}
.fbar button:last-child{border-right:0}
.fbar button[aria-pressed="true"]{background:var(--red)}
.btns.grid2{display:grid;grid-template-columns:1fr 1fr;max-width:340px}

/* the whole rung row is the link, not just its words */
.ladder li{position:relative}
.ladder li a::after{content:"";position:absolute;inset:0;border-radius:10px}
.ladder li a:focus-visible{outline:none}
.ladder li:focus-within{outline:3px solid var(--blue);outline-offset:2px}
/* the site name and the ladder link at the top are 44px tall */
.brand .home,.brand small a{display:inline-flex;align-items:center;min-height:44px}
.subject-head h3 a{display:inline-flex;align-items:center;min-height:44px}
