/* ==========================================================================
   LessonX design system — "Workbook Bold"
   Premium exercise-book aesthetic: graph-paper cream, thick ink borders,
   hard offset shadows, marker highlights. Big type (18px base) — built for
   9–12-year-old eyes and tired parents at 9pm.
   ========================================================================== */
:root {
  --paper:   #FAF3E5;
  --paper-2: #FFFDF7;
  --ink:     #1D2440;
  --ink-60:  #5A6076;
  --blue:    #2B50E0;
  --blue-dk: #1E3BAE;
  --coral:   #FF5B3A;
  --yellow:  #FFD23F;
  --green:   #12A150;
  --purple:  #7A4FE8;
  --bd: 2.5px solid var(--ink);
  --shadow: 7px 7px 0 var(--ink);
  --shadow-sm: 4px 4px 0 var(--ink);
  --r: 16px;
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 18px; }                     /* the whole system scales UP */
body {
  margin: 0; color: var(--ink); font-family: var(--font-body);
  line-height: 1.6; background-color: var(--paper);
  background-image:
    linear-gradient(rgba(29, 36, 64, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 36, 64, 0.055) 1px, transparent 1px);
  background-size: 28px 28px;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.5rem, 6vw, 4.1rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 800; }
h3 { font-size: 1.22rem; font-weight: 700; }
p  { margin: 0 0 1em; }
a  { color: var(--blue); }
.lead { font-size: 1.2rem; color: var(--ink-60); max-width: 46ch; }

/* marker-pen highlight behind key words */
.hl { background: linear-gradient(transparent 52%, var(--yellow) 52%, var(--yellow) 92%, transparent 92%); padding: 0 .1em; }
.hl-coral { background: linear-gradient(transparent 52%, #FFC4B5 52%, #FFC4B5 92%, transparent 92%); padding: 0 .1em; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- nav ---------- */
.nav {
  display: flex; align-items: center; gap: 26px; padding: 18px 28px;
  background: var(--paper-2); border-bottom: var(--bd);
  position: sticky; top: 0; z-index: 20;
}
.logo { font-family: var(--font-display); font-weight: 800; font-size: 1.55rem; text-decoration: none; color: var(--ink); letter-spacing: -0.02em; }
.logo b { color: var(--blue); }
.logo .x { display: inline-block; background: var(--yellow); border: var(--bd); border-radius: 8px; padding: 0 .28em; margin-left: 2px; box-shadow: 3px 3px 0 var(--ink); transform: rotate(-3deg); }
.nav a.link { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1rem; }
.nav a.link:hover { color: var(--blue); }
.nav .push { margin-left: auto; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; font-family: var(--font-display); font-weight: 700;
  font-size: 1.06rem; padding: 14px 26px; border: var(--bd); border-radius: 14px;
  background: var(--blue); color: #fff; text-decoration: none; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.coral  { background: var(--coral); }
.btn.yellow { background: var(--yellow); color: var(--ink); }
.btn.ghost  { background: var(--paper-2); color: var(--ink); }
.btn.big    { font-size: 1.22rem; padding: 18px 34px; }

/* ---------- cards & chips ---------- */
.card {
  background: var(--paper-2); border: var(--bd); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 26px;
}
.card.flat { box-shadow: var(--shadow-sm); }
.card.blue   { border-top: 10px solid var(--blue); }
.card.coral  { border-top: 10px solid var(--coral); }
.card.green  { border-top: 10px solid var(--green); }
.card.purple { border-top: 10px solid var(--purple); }
.chip {
  display: inline-block; font-weight: 700; font-size: .82rem; letter-spacing: .04em;
  text-transform: uppercase; padding: 5px 14px; border: 2px solid var(--ink);
  border-radius: 999px; background: var(--yellow); box-shadow: 2.5px 2.5px 0 var(--ink);
}
.chip.blue  { background: #D6E0FF; }
.chip.green { background: #C9F2DA; }
.chip.coral { background: #FFD9CF; }

/* ---------- mastery bars ---------- */
.bar-row { display: flex; align-items: center; gap: 12px; margin: 10px 0; font-weight: 600; }
.bar-row .lbl { width: 220px; font-size: .95rem; }
.bar-track { flex: 1; height: 20px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.bar-fill { height: 100%; border-right: 2px solid var(--ink); background: var(--green); }
.bar-fill.mid { background: var(--yellow); }
.bar-fill.low { background: var(--coral); }
.bar-pct { width: 52px; text-align: right; font-family: var(--font-display); font-weight: 800; }

/* ---------- pills (question navigator) ---------- */
.qpill {
  width: 46px; height: 42px; border: var(--bd); border-radius: 10px;
  font-family: var(--font-display); font-weight: 800; font-size: 1.02rem;
  background: var(--paper-2); box-shadow: 3px 3px 0 var(--ink); cursor: pointer;
}
.qpill.done { background: var(--blue); color: #fff; }
.qpill.cur  { background: var(--yellow); transform: translate(-2px,-2px); box-shadow: 5px 5px 0 var(--ink); }
.qpill.ok   { background: var(--green); color: #fff; }
.qpill.bad  { background: var(--coral); color: #fff; }

/* ---------- choices (exam options) ---------- */
.choice {
  display: flex; gap: 14px; align-items: baseline; width: 100%; text-align: left;
  font: inherit; font-size: 1.12rem; font-weight: 600; padding: 15px 18px;
  border: var(--bd); border-radius: 14px; background: var(--paper-2);
  box-shadow: var(--shadow-sm); cursor: pointer; margin-bottom: 12px;
  transition: transform .1s;
}
.choice:hover { transform: translate(-2px,-2px); }
.choice .letter {
  font-family: var(--font-display); font-weight: 800; min-width: 34px; height: 34px;
  border: 2px solid var(--ink); border-radius: 9px; display: inline-flex;
  align-items: center; justify-content: center; background: var(--yellow);
}
.choice.sel { background: #E4EBFF; border-color: var(--blue); border-width: 3px; }
.choice.sel .letter { background: var(--blue); color: #fff; }

/* ---------- mock browser frame (for product shots) ---------- */
.frame { border: var(--bd); border-radius: 18px; box-shadow: var(--shadow); background: var(--paper-2); overflow: hidden; }
.frame .bar { display: flex; gap: 8px; align-items: center; padding: 12px 16px; border-bottom: var(--bd); background: #F1E9D8; }
.frame .dot { width: 13px; height: 13px; border: 2px solid var(--ink); border-radius: 50%; }
.frame .dot.r { background: var(--coral); } .frame .dot.y { background: var(--yellow); } .frame .dot.g { background: var(--green); }
.frame .url { margin-left: 10px; font-size: .85rem; font-weight: 600; color: var(--ink-60); background: var(--paper-2); border: 2px solid var(--ink); border-radius: 999px; padding: 3px 16px; }

/* ---------- misc ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 900px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } }
.section { padding: 76px 0; }
.section.tint { background: rgba(43, 80, 224, 0.06); border-top: var(--bd); border-bottom: var(--bd); }
.kicker { font-family: var(--font-display); font-weight: 800; color: var(--coral); text-transform: uppercase; letter-spacing: .12em; font-size: .9rem; margin-bottom: 10px; }
.foot { border-top: var(--bd); background: var(--ink); color: #EDEAFF; padding: 40px 0; font-size: .95rem; }
.foot a { color: var(--yellow); }
.tag-scrib { position: relative; }
.tag-scrib::after {            /* hand-drawn underline */
  content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 10px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 12" preserveAspectRatio="none"><path d="M2 8 Q 50 2 100 7 T 198 5" fill="none" stroke="%23FF5B3A" stroke-width="5" stroke-linecap="round"/></svg>') no-repeat center / 100% 100%;
}
