/* ==========================================================
   Class 8 Science · Section 4 · উদ্ভিদের বংশ বৃদ্ধি
   Theme: "মৌচাকের খাতা" — a beekeeper's honeycomb notebook.
   A bee (মধুমিতা) guides the student. Warm wax-cream pages,
   honey-amber hex cells, deep plum ink (top bar, player),
   hibiscus red and leaf sage accents, pollen yellow highlights.
   Badge = a 7-cell honeycomb that fills with honey.
   Band কৌতূহলী (13–14).
   ========================================================== */
:root {
  --bg: #fbefd2;
  --card: #fffaf0;
  --ink: #2e1a2c;
  --ink-2: #6a5566;
  --plum: #3a1838;
  --plum-2: #5b2a56;
  --plum-s: #f1e3ee;
  --honey: #e9a21a;
  --honey-d: #a86e05;
  --honey-s: #fdeab8;
  --wax: #fff4d6;
  --hib: #d23a4e;
  --hib-s: #fbe3e5;
  --leaf: #4f8a3c;
  --leaf-d: #36652a;
  --leaf-s: #e4f0dc;
  --pollen: #ffd23f;
  --line: #ead9b3;
  --ok: #2f7a3a;
  --no: #b0302a;
}
* { box-sizing: border-box; }
body {
  color: var(--ink);
  background:
    radial-gradient(ellipse at 90% -10%, rgba(233, 162, 26, .22), transparent 45%),
    radial-gradient(ellipse at 0% 30%, rgba(210, 58, 78, .07), transparent 40%),
    var(--bg);
}
::selection { background: rgba(255, 210, 63, .55); }
a { color: var(--plum-2); }
strong { color: var(--plum); }
i[lang="la"] { font-family: Georgia, 'Times New Roman', serif; }
.muted { color: var(--ink-2); }
.small { font-size: var(--fs-sm); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 2000; }
.skip:focus { left: 8px; }
main, .wrap, .lesson-part > *, .hero-grid > *, .veg-grid > *, .layer-box > *, .peel-box > *, .design-grid > *, .fert-box > *, .seed-box > *, .ways > *, .defs > *, .adapt > * { min-width: 0; }

/* top bar: plum strip with a honey rule */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: .4rem 1rem; flex-wrap: wrap; padding: .5rem var(--gutter); background: var(--plum); color: #f6e6f1; font-size: var(--fs-sm); border-bottom: 4px solid var(--honey); background-image: linear-gradient(90deg, rgba(233, 162, 26, .14) 1px, transparent 1px); background-size: 18px 100%; }
.crumbs { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.crumbs a { color: #ecd3e6; text-decoration: none; }
.crumbs a:hover { color: #fff; text-decoration: underline; }
.crumbs [aria-current] { color: var(--pollen); font-weight: 700; }
.level { display: flex; align-items: center; gap: .45rem; font-weight: 800; color: var(--pollen); }
.comb-badge { width: 2.4rem; height: 2.2rem; }
.level.pop .comb-badge { animation: drip .6s; }
@keyframes drip { 40% { transform: scale(1.18) rotate(-6deg); } }

/* hero */
.hero { padding: clamp(1.4rem, 4vw, 2.8rem) 0 2rem; }
.hero-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1fr 1.05fr; } }
.eyebrow { display: inline-block; color: var(--plum); background: var(--honey); font-weight: 800; padding: .1rem 1rem; font-size: var(--fs-sm); clip-path: polygon(8% 0, 92% 0, 100% 50%, 92% 100%, 8% 100%, 0 50%); }
h1 { font-size: var(--fs-3xl); line-height: 1.3; margin: .8rem 0 1rem; color: var(--plum); }
.lede { font-size: var(--fs-lg); line-height: 1.75; }
.hint { color: var(--ink-2); border-left: 4px solid var(--honey); padding-left: .8rem; }
.comb-frame { margin: 0; border-radius: 18px; overflow: hidden; background: #fff6dc; box-shadow: 0 18px 40px rgba(58, 24, 56, .22); border: 3px solid var(--honey-d); }
.comb-frame > svg { display: block; width: 100%; height: auto; }
.hero-bar { display: flex; gap: .6rem 1rem; align-items: center; flex-wrap: wrap; margin: 0; padding: .55rem 1rem; background: var(--plum); color: #f8ecf4; font-weight: 700; border-top: 3px solid var(--honey); }

/* buttons */
.btn { font: inherit; font-weight: 700; border: 0; border-radius: 999px; padding: .35rem 1.1rem; cursor: pointer; background: var(--plum); color: #fff; box-shadow: 0 3px 0 #1d0a1c; }
.btn:hover { background: var(--plum-2); }
.btn.honey { background: var(--honey); color: var(--plum); box-shadow: 0 3px 0 var(--honey-d); }
.btn.ghost { background: #fff; color: var(--plum); border: 2px solid var(--plum-2); box-shadow: none; }
.btn:disabled { opacity: .5; cursor: default; }
.row-btns { display: flex; gap: .5rem; flex-wrap: wrap; margin: .6rem 0; }

/* blocks */
.block { padding-block: clamp(1.6rem, 4vw, 3rem); }
.lesson-part.alt { background: linear-gradient(rgba(255, 250, 240, .6), rgba(255, 250, 240, .6)); border-block: 1px solid var(--line); }
.sec-title, .lesson-part h2, #compare h2, #activity h2, #quiz h2, .story h2 { font-size: var(--fs-2xl); line-height: 1.4; margin: .3rem 0 1rem; color: var(--plum); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.story h2 { font-size: var(--fs-xl); }
.sub-title { font-size: var(--fs-xl); margin: 2rem 0 .8rem; color: var(--plum-2); }
.part-tag { display: inline-flex; align-items: center; gap: .45rem; margin: 0; font-weight: 800; color: var(--honey-d); font-size: var(--fs-sm); }
.part-tag::before { content: ''; width: 18px; height: 16px; background: var(--honey); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }

.goals { display: grid; gap: .6rem; padding: 0; list-style: none; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); }
.goals li { background: var(--card); border-radius: 10px; padding: .8rem 1rem .7rem 2.6rem; border: 1px solid var(--line); position: relative; }
.goals li::before { content: ''; position: absolute; left: .8rem; top: 1rem; width: 1.2rem; height: 1.05rem; background: var(--honey); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }

.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: clamp(1rem, 3vw, 1.5rem); box-shadow: 0 4px 0 #efdcb0, 0 10px 24px rgba(58, 24, 56, .06); }
.card h3 { margin: 0 0 .5rem; font-size: var(--fs-lg); display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; color: var(--plum); }
.card h4 { margin: 0 0 .4rem; color: var(--plum-2); }
.widget { margin: 1.6rem 0; border-top: 6px solid var(--honey); }
.fig { display: block; width: 100%; height: auto; }
.story { background: linear-gradient(135deg, #fffaf0, #fff1cf); }

.def { margin: 1rem 0; background: var(--leaf-s); border-left: 5px solid var(--leaf); border-radius: 6px; padding: .8rem 1rem; }
.def b:first-child { color: var(--leaf-d); }
.defs { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr)); }
.defs .def { margin: .5rem 0; }
.remember { margin: 1.4rem 0 .4rem; background: var(--wax); border-radius: 12px; padding: .9rem 1rem; border: 2px solid var(--honey); box-shadow: 4px 4px 0 rgba(233, 162, 26, .35); }
.remember > b:first-child { display: inline-block; background: var(--honey); color: var(--plum); padding: 0 .7rem; margin-right: .4rem; clip-path: polygon(10% 0, 90% 0, 100% 50%, 90% 100%, 10% 100%, 0 50%); }
.note-fix { background: var(--hib-s); border: 1.5px dashed var(--hib); border-radius: 8px; padding: .6rem .9rem; margin: .8rem 0; font-size: var(--fs-sm); }
.note-fix b:first-child { color: var(--hib); }

.ways { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); margin: 1rem 0; }
.way { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: .7rem .9rem; }
.way h4 { margin: 0 0 .3rem; color: var(--honey-d); }
.way p { margin: 0; font-size: var(--fs-sm); }

/* chips / segmented */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.chips.col { flex-direction: column; align-items: stretch; }
.chips button, .seg button { border: 1.5px solid #e1c98d; background: #fff; color: var(--ink); border-radius: 999px; padding: .1rem .85rem; font: inherit; font-size: var(--fs-sm); cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; box-shadow: 0 2px 0 #ecd9a8; text-align: left; }
.chips.col button { border-radius: 10px; padding: .3rem .8rem; }
.chips button[aria-pressed="true"], .seg button[aria-pressed="true"] { background: var(--plum); color: #fff; border-color: var(--plum); box-shadow: 0 2px 0 #1d0a1c; }
.chips button.done { opacity: .45; text-decoration: line-through; cursor: default; }
.chips button.bad, .seg button.bad, .hexes button.bad { animation: shake .4s; border-color: var(--no); }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.seg { display: inline-flex; flex-wrap: wrap; gap: .3rem; margin: .3rem 0; }
.msg { min-height: 1.8em; font-weight: 700; margin: .5rem 0; }
.msg.ok { color: var(--ok); } .msg.no { color: var(--no); }
.tr-h { display: block; font-weight: 800; color: var(--honey-d); font-size: var(--fs-sm); margin-bottom: .2rem; }
.slider-row { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin: .5rem 0; font-weight: 700; }
.slider-row input { flex: 1; min-width: 10rem; accent-color: var(--honey-d); }

/* vegetative matcher */
.veg-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .veg-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); } }
.hexes { display: flex; flex-wrap: wrap; gap: .3rem; }
.hexes button { width: 6.9rem; height: 6rem; border: 0; font: inherit; font-size: .95rem; font-weight: 700; line-height: 1.25; cursor: pointer; background: var(--wax); color: var(--plum); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); padding: 0 .9rem; transition: background .3s; }
.hexes button:hover { background: #ffe7a6; }
.hexes button.full { background: var(--honey); color: var(--plum); }
.hexes button:focus-visible { outline: 3px solid var(--plum); }
.veg-show { margin-top: .8rem; display: grid; gap: .8rem; grid-template-columns: 1fr; align-items: center; background: #fff; border: 1px dashed var(--line); border-radius: 12px; padding: .7rem; }
@media (min-width: 640px) { .veg-show { grid-template-columns: 220px minmax(0, 1fr); } }
.veg-show > svg { width: 100%; max-width: 220px; height: auto; }
.veg-show p { margin: .2rem 0; }

.layer-box, .peel-box, .fert-box, .seed-box, .design-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 760px) { .layer-box, .peel-box, .fert-box, .seed-box, .design-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
ol { list-style-type: bengali; }
.steps-done { margin: 0 0 .5rem; padding-left: 1.4rem; }
.steps-done li { margin: .25rem 0; color: var(--leaf-d); font-weight: 700; }
.tray { list-style: none; padding: 0; display: grid; gap: .4rem; }
.tray li { background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--honey); border-radius: 8px; padding: .4rem .7rem; font-size: var(--fs-sm); }
.tray li b { color: var(--plum); }
.route-log { display: flex; flex-wrap: wrap; gap: .4rem; }
.route-log span { background: var(--plum-s); border-radius: 999px; padding: .05rem .8rem; font-size: var(--fs-sm); font-weight: 700; }
#route-svg .fl { cursor: pointer; }
#route-svg .fl:focus { outline: none; }
#route-svg .fl:focus-visible circle.ring { stroke: var(--plum); stroke-width: 4; }

.adapt { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); margin: 1rem 0; }
.adapt article { background: #fff; border-radius: 14px; border: 2px solid var(--line); padding: .8rem 1rem; }
.adapt article svg { width: 64px; height: 64px; float: right; margin-left: .5rem; }
.adapt h4 { margin: 0 0 .3rem; color: var(--plum); }
.adapt p { margin: .2rem 0; font-size: var(--fs-sm); }
.design-opt { margin: .4rem 0 .7rem; }
.design-opt > span { display: block; font-weight: 800; font-size: var(--fs-sm); color: var(--plum-2); }
.verdict { font-weight: 700; background: var(--wax); border: 2px solid var(--honey); border-radius: 12px; padding: .6rem .8rem; min-height: 3em; }

.fert-steps { margin: 0; padding-left: 1.4rem; }
.fert-steps li { margin: .3rem 0; color: var(--ink-2); }
.fert-steps li.on { color: var(--ink); font-weight: 700; }
.fert-steps li.cur { background: var(--wax); border-radius: 6px; padding: .1rem .4rem; }

/* sorters */
.sorter { list-style: none; padding: 0; display: grid; gap: .5rem; }
.sorter li { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .5rem .8rem; display: grid; gap: .3rem .8rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .sorter li { grid-template-columns: 9rem minmax(0, 1fr); align-items: center; } }
.sorter li > b { color: var(--plum); }
.sorter li.ok { border-color: var(--leaf); background: #f4faef; }
.sorter li.bad { animation: shake .4s; }
.sorter .why { grid-column: 1 / -1; margin: 0; font-size: var(--fs-sm); color: var(--leaf-d); }

.bowls { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(min(9.5rem, 100%), 1fr)); margin: .6rem 0; }
.bowl { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: .5rem; text-align: center; }
.bowl > svg { width: 100%; height: auto; display: block; }
.bowl .tg { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem; margin-top: .3rem; }
.bowl .tg button { font: inherit; font-size: .9rem; border-radius: 999px; padding: 0 .6rem; border: 1.5px solid #cdb0c8; background: #fff; color: var(--ink-2); cursor: pointer; text-decoration: line-through; }
.bowl .tg button[aria-pressed="true"] { background: var(--leaf); border-color: var(--leaf); color: #fff; text-decoration: none; }
.bowl h4 { margin: 0; font-size: var(--fs-sm); }
.chart-box { position: relative; height: 300px; margin: .4rem 0; }
.chart-note { font-size: var(--fs-sm); color: var(--ink-2); background: var(--wax); border-radius: 6px; padding: .4rem .7rem; }
.legend { font-size: var(--fs-sm); display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: center; }
.legend .sw { display: inline-block; width: 1.4rem; height: .7rem; border-radius: 3px; vertical-align: middle; }
.sw.epi { background: #2f8f6a; } .sw.hyp { background: #c0397a; } .sw.rad { background: #a86e05; }
.diary { padding-left: 1.4rem; }
.diary li { margin: .35rem 0; }

/* player */
.player { border-radius: 16px; background: var(--plum); padding: clamp(.5rem, 2vw, 1rem); color: #fff; box-shadow: 0 16px 36px rgba(58, 24, 56, .3); border: 3px solid var(--honey); }
.stage { position: relative; border-radius: 10px; overflow: hidden; }
.stage svg:not(.ic) { width: 100%; height: auto; display: block; }
.big-play { position: absolute; inset: 0; margin: auto; width: 5.5rem; height: 5.5rem; border: 0; background: var(--honey); color: var(--plum); display: grid; place-items: center; cursor: pointer; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.big-play .ic { width: 2.4rem; height: 2.4rem; }
.big-play.hide { display: none; }
.caption { min-height: 3.6em; margin: .75rem .25rem; font-size: var(--fs-lg); line-height: 1.6; }
.controls { display: flex; align-items: center; gap: .6rem; }
.ctrl { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 0; background: #fff; color: var(--ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.controls input { flex: 1; min-width: 0; accent-color: var(--honey); }
.time { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: var(--fs-sm); }
.chapters { display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: .75rem 0 0; list-style: none; }
.chapters button { border: 1px solid rgba(255, 255, 255, .5); background: transparent; color: #f6e6f1; border-radius: 999px; padding: .1rem .8rem; font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.chapters button.on { background: var(--honey); border-color: var(--honey); color: var(--plum); }

/* tables */
.table-wrap { overflow-x: auto; margin: .6rem 0 1rem; }
.cmp { width: 100%; border-collapse: collapse; background: var(--card); min-width: 34rem; border: 1px solid var(--line); }
.cmp th, .cmp td { border: 1px solid var(--line); padding: .5rem .7rem; text-align: left; vertical-align: top; }
.cmp thead th { background: var(--plum); color: #fff; }
.cmp thead th.c1 { background: var(--honey-d); }
.cmp thead th.c2 { background: var(--leaf-d); }
.cmp td:first-child { font-weight: 800; background: var(--wax); }

/* quiz */
.score-pill { display: inline-block; background: var(--plum); color: #fff; padding: .1rem .9rem; border-radius: 999px; font-weight: 700; }
.q-fig { margin: .6rem 0; max-width: 320px; }
.q-fig > svg, .xy-fig > svg { width: 100%; height: auto; display: block; background: #fff; border-radius: 10px; border: 1px solid var(--line); }
.xy-fig { margin: .6rem 0; max-width: 520px; }
.lk-q { background: var(--card); border-radius: 12px; padding: 1rem; margin: .8rem 0; border: 1px solid var(--line); border-top: 4px solid var(--honey); }
.lk-q-stem { font-weight: 700; margin-bottom: .6rem; }
.lk-opts { display: grid; gap: .45rem; grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); }
.lk-opt { display: flex; gap: .6rem; align-items: center; text-align: left; font: inherit; padding: .45rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); cursor: pointer; }
.lk-opt-key { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; background: var(--plum); color: #fff; flex: none; font-size: .95rem; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.lk-opt.is-right { border-color: var(--ok); background: #e7f4e1; }
.lk-opt.is-wrong { border-color: var(--no); background: #fbe7e4; }
.lk-explain { margin: .6rem 0 0; }
.lk-explain.ok { color: var(--ok); } .lk-explain.no { color: var(--no); }
.qa details, .cq-parts details { background: var(--card); border-radius: 10px; padding: .6rem .9rem; margin: .5rem 0; border: 1px solid var(--line); border-left: 5px solid var(--honey); }
.cq .cq-parts details { background: #fff; }
.qa summary, .cq-parts summary { cursor: pointer; font-weight: 700; }
.qa details p, .cq-parts details p { margin: .6rem 0 .2rem; }
.cq { margin: 1rem 0; }
.cq-stem { font-weight: 800; font-size: var(--fs-lg); }
.cq-parts { list-style: none; padding: 0; }
.summary ul { padding-left: 1.3rem; }
.summary li { margin: .4rem 0; }

.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 2rem 1rem; }
.pager-btn { display: inline-block; padding: .5rem 1.1rem; border-radius: 999px; background: var(--plum); color: #fff; text-decoration: none; font-weight: 700; border: 2px solid var(--honey); }
.pager-btn.disabled { background: var(--line); color: #4a3a46; border-color: var(--line); }
.credit { color: var(--ink-2); font-size: var(--fs-sm); padding-bottom: 2rem; }

[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .6s, transform .6s; }
[data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
