/* kinetic-mind.com — the classroom chalkboard, made to move.
   The page is a slate board in a frame. Headings are written in chalk; drawings are drawn as you scroll.
   One grid, one card style, one spacing rhythm: the chalk brings the life, the layout stays calm.
   Board, chalk and frame colours change per visit (one of 50 boards, set by pre.js). */

@view-transition { navigation: auto; }


:root {
  --board: #26382f;
  --board-2: color-mix(in srgb, var(--board) 78%, #000);
  --wall: color-mix(in srgb, var(--board) 35%, #050505);
  --ink: #eef1e8;
  --muted: color-mix(in srgb, var(--ink) 74%, var(--board));
  --faint: color-mix(in srgb, var(--ink) 16%, transparent);
  --line: color-mix(in srgb, var(--ink) 20%, transparent);
  --card: color-mix(in srgb, #000 20%, transparent);
  --w1: #8a6646; --w2: #5e4330; --w3: #7d5b3e;
  --g: #a9e27c;  --g-btn: color-mix(in srgb, var(--g) 82%, #fff);
  --o: #ffab76;
  --y: #ffd75e;
  --b: #8fd0ff;
  --v: #d2b1ff;
  --p: #ff9ccf;
  --focus: var(--y);
  --r: 18px;          /* one corner radius for cards */
  --r-btn: 12px;
  --frame: 12px;
  --gap: clamp(20px, 2.4vw, 32px);
  --sec: clamp(96px, 11vw, 150px);
  --display: "Baloo Da 2", "Hind Siliguri", "Nirmala UI", system-ui, sans-serif;
  --text: "Hind Siliguri", "Anek Bangla", "Nirmala UI", system-ui, sans-serif;
  --math: "STIX Two Text", "Cambria Math", Cambria, "Times New Roman", serif;
  --wrap: 1200px;
  color-scheme: dark;
}

/* language: Bengali first, English on request */
html[data-lang="en"] [data-l="bn"],
html:not([data-lang="en"]) [data-l="en"] { display: none !important; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 100px; background: var(--wall); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; position: relative;
  background: var(--board); color: var(--ink);
  font: 400 17px/1.7 var(--text); -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
main { flex: 1; position: relative; z-index: 1; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2.5px dashed var(--focus); outline-offset: 4px; border-radius: 8px; }
::selection { background: color-mix(in srgb, var(--y) 35%, transparent); }

/* ---------- the board and its frame ---------- */
.bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0, 0, 0, .32)),
    url("board-tex.jpg") center / cover no-repeat,
    var(--board);
  background-blend-mode: normal, overlay, normal;   /* the grey slate takes on the board colour */
}
.frame {
  position: fixed; inset: 0; z-index: 50; pointer-events: none; view-transition-name: frame;
  border: var(--frame) solid var(--w2);
  border-image: linear-gradient(160deg, var(--w1), var(--w2) 22%, var(--w3) 48%, var(--w2) 70%, var(--w1)) 1;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .55), inset 0 0 28px rgba(0, 0, 0, .5);
}
.frame::before { content: ""; position: absolute; inset: calc(var(--frame) * -1); border: 1px solid rgba(255, 255, 255, .1); }
.ledge { position: absolute; right: 64px; bottom: calc(var(--frame) * -1 + 2px); display: flex; align-items: flex-end; gap: 10px; }
.ledge i { display: block; width: 40px; height: 8px; border-radius: 3px; background: url("speck.png"), #f2f2ea; box-shadow: 0 2px 2px rgba(0, 0, 0, .35); }
.ledge .c2 { background: url("speck.png"), var(--y); }
.ledge .c3 { background: url("speck.png"), var(--o); width: 28px; }
.ledge b { display: block; width: 56px; height: 14px; margin-left: 8px; border-radius: 3px; background: linear-gradient(#80593a 0 60%, #3b403d 60%); box-shadow: 0 3px 3px rgba(0, 0, 0, .4); }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.wrap { width: min(var(--wrap), 100%); margin: 0 auto; padding: 0 40px; }
.skip { position: absolute; left: 20px; top: -80px; z-index: 60; padding: 8px 14px; border-radius: 10px; background: var(--ink); color: var(--board); }
.skip:focus { top: 20px; }

/* ---------- type ---------- */
.kh, .mega, .ch {
  -webkit-mask-image: url("grain.png"); mask-image: url("grain.png");
  -webkit-mask-size: 220px; mask-size: 220px;
}
.kh { font-family: var(--display); font-weight: 700; line-height: 1.14; margin: 0; color: var(--ink); text-wrap: balance; }
.kh-xl { font-size: clamp(42px, 5.6vw, 76px); }
.kh-l { font-size: clamp(32px, 3.9vw, 52px); }
.kh-m { font-size: clamp(26px, 2.8vw, 36px); }
.lede { font-size: clamp(16.5px, 1.4vw, 19px); line-height: 1.75; color: var(--muted); max-width: 34em; margin: 0; text-wrap: pretty; }
.math { font-family: var(--math); font-style: italic; font-weight: 500; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font: 600 15px/1.3 var(--display); letter-spacing: .03em; color: var(--y); }
.eyebrow::before { content: ""; width: 26px; height: 2px; border-radius: 2px; background: currentColor; }

@keyframes write { from { clip-path: inset(-25% 100% -25% -8%); } to { clip-path: inset(-25% -8% -25% -8%); } }
.kh.arrive, .rv.in .kh, .panel.on .kh { animation: write 1.1s cubic-bezier(.45, .1, .3, 1) both; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 12px 24px;
  border: 0; border-radius: var(--r-btn); cursor: pointer; text-decoration: none; white-space: nowrap;
  font: 700 17.5px/1.2 var(--display);
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn-go { background: url("speck.png"), var(--g-btn); color: #161a14; box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--g) 90%, transparent); }
.btn-go:hover { background: url("speck.png"), color-mix(in srgb, var(--g) 62%, #fff); }
.btn-ink { background: url("speck.png"), var(--ink); color: var(--board-2); }
.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 55%, transparent); }
.btn-line:hover { box-shadow: inset 0 0 0 1.5px var(--ink); background: var(--faint); }
.btn-small { min-height: 40px; padding: 7px 16px; font-size: 15.5px; }

/* ---------- header ---------- */
.head { position: sticky; top: 0; z-index: 40; view-transition-name: site-head; padding-top: var(--frame); transition: background-color .3s ease, box-shadow .3s ease; }
.head.solid, body:not(.home) .head { background: color-mix(in srgb, var(--board-2) 84%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--line); }
.head-in { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px 28px; min-height: 72px; }
.brand { position: relative; display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand img { width: 52px; height: auto; }
.brand b { font: 700 20px/1 var(--display); }
.nav { display: flex; align-items: center; justify-content: center; gap: 6px; }
.nav a { position: relative; padding: 8px 14px; text-decoration: none; color: var(--muted); font: 600 16px/1.2 var(--display); transition: color .15s ease; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 8px; background: var(--y);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 8' preserveAspectRatio='none'%3E%3Cpath d='M2 5C25 2 55 2 98 4' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 8' preserveAspectRatio='none'%3E%3Cpath d='M2 5C25 2 55 2 98 4' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.pip { position: absolute; left: 50%; bottom: -10px; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: var(--y); box-shadow: 0 0 8px color-mix(in srgb, var(--y) 60%, transparent); view-transition-name: nav-pip; }
.brand .pip { left: 26px; bottom: -8px; }
.head .btn { position: relative; min-height: 42px; padding: 8px 18px; font-size: 16px; }
.head .btn .pip { bottom: -13px; }
.tools { display: flex; align-items: center; gap: 10px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; box-shadow: inset 0 0 0 1.5px var(--line); }
.seg button { border: 0; background: none; cursor: pointer; padding: 5px 10px; min-width: 38px; border-radius: 8px; font: 600 14px var(--text); color: var(--muted); }
.seg button[aria-pressed="true"] { background: url("speck.png"), var(--ink); color: var(--board-2); }

/* ---------- page change: this board slides up, the next one slides in from below ---------- */
::view-transition { background: var(--wall); }
::view-transition-group(root) { animation-duration: 1s; }
::view-transition-old(root) { animation: board-out 1s cubic-bezier(.7, 0, .2, 1) both; }
::view-transition-new(root) { animation: board-in 1s cubic-bezier(.7, 0, .2, 1) both; }
@keyframes board-out { 0% { transform: none; } 22% { transform: scale(.92); filter: brightness(.85); } 100% { transform: translateY(-110%) scale(.92); filter: brightness(.6); } }
@keyframes board-in { 0% { transform: translateY(110%) scale(.92); filter: brightness(.6); } 78% { transform: translateY(0) scale(.92); filter: brightness(.85); } 100% { transform: none; } }
html:active-view-transition-type(back)::view-transition-old(root) { animation-name: board-out-back; }
html:active-view-transition-type(back)::view-transition-new(root) { animation-name: board-in-back; }
@keyframes board-out-back { 0% { transform: none; } 22% { transform: scale(.92); filter: brightness(.85); } 100% { transform: translateY(110%) scale(.92); filter: brightness(.6); } }
@keyframes board-in-back { 0% { transform: translateY(-110%) scale(.92); filter: brightness(.6); } 78% { transform: translateY(0) scale(.92); filter: brightness(.85); } 100% { transform: none; } }
::view-transition-group(frame), ::view-transition-group(site-head) { animation: none; z-index: 20; }
::view-transition-old(frame), ::view-transition-new(frame), ::view-transition-old(site-head), ::view-transition-new(site-head) { animation: none; }
::view-transition-old(site-head) { display: none; }
::view-transition-group(nav-pip) { animation-duration: .7s; animation-timing-function: cubic-bezier(.3, 1.35, .45, 1); z-index: 21; }
::view-transition-group(subj-hero) { animation-duration: .8s; animation-timing-function: cubic-bezier(.2, .72, .2, 1); z-index: 5; }
::view-transition-old(subj-hero), ::view-transition-new(subj-hero) { height: 100%; object-fit: cover; }

/* =====================================================================
   Home: a journey down through a chalk-drawn world (drawn by world.js)
   Two canvases stay in view while the scenes scroll between them:
   the back one under the words, the front one over them.
   ===================================================================== */
.home .head { position: fixed; left: 0; right: 0; }
.journey { position: relative; }
.w-layer { display: none; }
.js .w-layer { display: block; position: fixed; left: 0; top: 0; width: 100%; height: 100vh; height: 100lvh; pointer-events: none; transition: opacity .4s ease; }
.journey.off .w-layer { opacity: 0; visibility: hidden; transition: opacity .4s ease, visibility 0s linear .4s; }
.w-back-l { z-index: 0; }
.w-front-l { z-index: 2; }
.w-layer canvas { display: block; width: 100%; height: 100%; }
.scene { position: relative; z-index: 1; min-height: 120vh; min-height: 120svh; display: flex; align-items: center; }
.scene > .wrap { width: 100%; }
.scene .copy { max-width: 500px; }
.scene.right .copy { margin-left: auto; }
.scene.center { align-items: flex-start; padding-top: 15vh; }
.scene.center .copy { max-width: 1000px; margin: 0 auto; text-align: center; }
.scene.center .eyebrow, .scene.center .hero-ctas { justify-content: center; }
.scene.center .lede { margin-left: auto; margin-right: auto; }
.sc0 { min-height: 100vh; min-height: 100svh; align-items: flex-start; padding-top: 22vh; }
.sc0 .copy { max-width: 760px; }

.giant {
  margin: -.22em 0 -.3em -.12em; padding: .22em .12em .3em; font: 800 clamp(64px, 8vw, 124px)/1.08 var(--display); letter-spacing: -.01em; color: var(--ink);
  -webkit-mask-image: url("grain.png"); mask-image: url("grain.png");
  -webkit-mask-size: 220px; mask-size: 220px;
}
.scene.center .giant { margin-left: 0; font-size: clamp(44px, 5.2vw, 80px); line-height: 1.1; text-wrap: balance; }
.scene.center .lede { max-width: 40em; }
.scene .lede { margin-top: 20px; font-size: clamp(18px, 1.55vw, 22px); line-height: 1.7; color: color-mix(in srgb, var(--ink) 88%, var(--board)); }
.scene .eyebrow { font-size: clamp(15px, 1.2vw, 18px); }
.tap { display: inline-flex; align-items: center; gap: 10px; margin: 22px 0 0; padding: 7px 14px 7px 10px; border-radius: 999px; font: 600 15px/1.3 var(--display); color: var(--b); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--b) 45%, transparent); }
.tap i { position: relative; width: 16px; height: 16px; border-radius: 50%; background: var(--b); flex: none; }
.tap i::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; box-shadow: 0 0 0 2px var(--b); animation: ping 1.6s ease-out infinite; }
@keyframes ping { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.scene .copy .tap { display: flex; width: max-content; max-width: 100%; }
.sc0 .tap { animation: rise .8s cubic-bezier(.2, .7, .2, 1) 1.6s both; }
.more { display: inline-flex; align-items: center; gap: 12px; margin-top: 26px; font: 700 clamp(17px, 1.3vw, 19px) var(--display); color: var(--ink); text-decoration: none; pointer-events: auto; }
.more::before { content: ""; width: 34px; height: 2px; border-radius: 2px; background: var(--y); transition: width .25s ease; }
.more:hover::before { width: 52px; }
/* words arrive as their scene comes into view */
.js .scene .copy > * { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.js .scene.in .copy > * { opacity: 1; transform: none; }
.js .scene.in .copy > *:nth-child(2) { transition-delay: .08s; } .js .scene.in .copy > *:nth-child(3) { transition-delay: .18s; } .js .scene.in .copy > *:nth-child(4) { transition-delay: .28s; }
.js .scene:not(.in) .giant { clip-path: inset(-25% 100% -25% -8%); }
.js .scene.in .giant { animation: write 1.2s cubic-bezier(.45, .1, .3, 1) .1s both; }
.js .sc0 .copy > * { opacity: 1; transform: none; }

.mega { margin: -.2em 0 -.28em -.1em; padding: .2em .1em .28em; font: 800 clamp(84px, 12.5vw, 200px)/.86 var(--display); letter-spacing: -.025em; animation: write 1.6s cubic-bezier(.45, .1, .3, 1) .15s both; }
.mega span { display: block; }
.mega .k1 { color: var(--g); }
.mega .k2 { color: var(--o); padding-left: .55em; }
.hero-line { margin: 22px 0 0; font: 700 clamp(21px, 2vw, 28px)/1.3 var(--display); color: var(--ink); text-wrap: balance; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.sc0 .copy > *:not(.mega) { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; }
.sc0 .eyebrow { animation-delay: .05s; } .sc0 .hero-line { animation-delay: 1.1s; } .sc0 .hero-ctas { animation-delay: 1.3s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.cue { position: absolute; left: 50%; bottom: 7vh; z-index: 3; display: grid; justify-items: center; gap: 6px; transform: translateX(-50%); color: var(--ink); font: 600 14px var(--display); }
.cue i { width: 2px; height: 40px; border-radius: 2px; background: linear-gradient(var(--ink), transparent); transform-origin: top; animation: cue 1.8s cubic-bezier(.6, 0, .3, 1) infinite; }
@keyframes cue { 0% { transform: scaleY(0); } 70% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

.w-rail { position: absolute; right: calc(var(--frame) + 22px); top: 50%; display: grid; gap: 12px; transform: translateY(-50%); }
.w-rail i { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 50%, transparent); transition: background-color .3s ease, transform .3s ease; }
.w-rail i.on { background: var(--y); box-shadow: none; transform: scale(1.3); }

/* =====================================================================
   The rest of the home page
   ===================================================================== */
.after { position: relative; }
.sec { padding-top: var(--sec); }
.sec-head { max-width: 720px; margin-bottom: clamp(36px, 4vw, 52px); }
.sec-head .lede { margin-top: 16px; }
.sec-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.sec-head.center .eyebrow { justify-content: center; }
.sec-head.center .lede { margin-left: auto; margin-right: auto; }
.sec-head.split { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px 40px; flex-wrap: wrap; }
.rv { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.rv:not(.in) .kh { clip-path: inset(-25% 100% -25% -8%); }
.rv.in { opacity: 1; transform: none; }
html:not(.js) .rv { opacity: 1; transform: none; }
html:not(.js) .rv .kh { clip-path: none; }

/* four figures in a row */
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); }
.figures div { display: flex; flex-direction: column; padding: 28px 26px; }
.figures div + div { border-left: 1.5px solid var(--line); }
.figures dd { order: 1; margin: 0; font: 800 clamp(48px, 5vw, 68px)/1 var(--display); color: var(--y); -webkit-mask-image: url("grain.png"); mask-image: url("grain.png"); -webkit-mask-size: 220px; mask-size: 220px; }
.figures div:nth-child(2) dd { color: var(--g); } .figures div:nth-child(3) dd { color: var(--o); } .figures div:nth-child(4) dd { color: var(--b); }
.figures dt { order: 2; margin-top: 10px; color: var(--muted); font-size: 15.5px; line-height: 1.5; }

/* the video, on a screen */
.screen { max-width: 980px; margin: 0 auto; padding: 10px; border-radius: calc(var(--r) + 4px); background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line), 0 40px 70px -40px rgba(0, 0, 0, .9); }
.screen video { width: 100%; aspect-ratio: 16 / 9; display: block; border-radius: calc(var(--r) - 6px); background: #0b0d0c; }

/* a lesson in three parts: three equal cards */
.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); padding: 0; margin: 0; list-style: none; }
.flow > li { display: flex; flex-direction: column; padding: 30px 28px; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); }
.flow > li:nth-child(2) { transition-delay: .1s; } .flow > li:nth-child(3) { transition-delay: .2s; }
.flow > li:nth-child(1) { --c: var(--v); } .flow > li:nth-child(2) { --c: var(--o); } .flow > li:nth-child(3) { --c: var(--g); }
.flow-n { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 20px; border-radius: 50%; font: 800 22px/1 var(--display); color: var(--c); box-shadow: inset 0 0 0 2px var(--c); }
.flow h3 { margin: 0 0 8px; font: 700 24px/1.25 var(--display); }
.flow p { margin: 0 0 20px; color: var(--muted); }
.flow ul { list-style: none; margin: auto 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.flow ul li { padding: 3px 12px; border-radius: 8px; font: 600 14.5px var(--display); color: var(--ink); background: color-mix(in srgb, var(--c) 14%, transparent); }

/* try it */
.tryit { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.tryit .sec-head { margin: 0; }
.sim { margin: 0; padding: 22px 22px 20px; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); }
.sim svg, .sim-ctrl label, .sim-cap { -webkit-user-select: none; user-select: none; }
.sim svg { width: 100%; height: auto; overflow: visible; -webkit-mask-image: url("grain.png"); mask-image: url("grain.png"); -webkit-mask-size: 200px; mask-size: 200px; }
.sim svg path, .sim svg circle { filter: url(#rough); }
.sim .axis { stroke: color-mix(in srgb, var(--ink) 80%, transparent); stroke-width: 2.2; fill: none; stroke-linecap: round; }
.sim .tick { fill: color-mix(in srgb, var(--ink) 80%, transparent); font: 600 16px var(--display); }
.sim .path { stroke: var(--g); stroke-width: 2.4; stroke-dasharray: 3 8; fill: none; stroke-linecap: round; opacity: .8; }
.sim .ghost { fill: var(--o); }
.sim .ball { fill: color-mix(in srgb, var(--ink) 25%, transparent); stroke: var(--ink); stroke-width: 2.6; }
.sim .vel { stroke: var(--g); stroke-width: 3; fill: none; stroke-linecap: round; }
.sim .vel-head { fill: var(--g); }
.sim .launch { stroke: color-mix(in srgb, var(--ink) 70%, transparent); stroke-width: 2; fill: none; stroke-dasharray: 5 5; }
.sim .angle { fill: var(--y); font: italic 600 17px var(--math); }
.sim-cap { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; font: 700 20px/1.2 var(--display); }
.sim-ctrl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 26px; margin-top: 14px; }
.sim-ctrl label { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 8px; font: 600 15px var(--display); color: var(--muted); }
.sim-ctrl label input { grid-column: 1 / -1; }
.sim-ctrl output { color: var(--y); font-weight: 700; }
.sim input[type="range"] { width: 100%; accent-color: var(--y); height: 26px; cursor: pointer; }
.readout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0 0; }
.readout div { padding: 12px 14px; border-radius: 12px; box-shadow: inset 0 0 0 1.5px var(--line); }
.readout dt { font-size: 14px; color: var(--muted); }
.readout dd { margin: 2px 0 0; font: 800 26px/1.15 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.readout dd small { font: 500 14px var(--text); color: var(--muted); margin-left: 3px; }
.sim-note { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.sim-note .math { color: var(--ink); }

/* 13 chapters as tiles */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tile {
  display: flex; flex-direction: column; gap: 4px; padding: 20px 20px 18px; border-radius: var(--r);
  background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line);
  opacity: 0; transform: translateY(16px);
  transition: opacity .5s ease calc(var(--i) * 45ms), transform .6s cubic-bezier(.2, .7, .2, 1) calc(var(--i) * 45ms), box-shadow .2s ease, background-color .2s ease;
}
.tiles.in .tile, html:not(.js) .tile { opacity: 1; transform: none; }
.tile:hover { box-shadow: inset 0 0 0 1.5px var(--tc); background: color-mix(in srgb, var(--tc) 8%, var(--card)); }
.tile-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tile .no { font: 800 26px/1 var(--display); color: var(--tc); font-variant-numeric: tabular-nums; }
.tile .lens { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line); }
.tile b { font: 700 19px/1.3 var(--display); }
.tile .topic-name { font-size: 13.5px; color: var(--muted); }
.tile .f { margin-top: 10px; font: italic 500 19px var(--math); color: var(--tc); }
.tile-cta { grid-column: span 3; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-content: center; column-gap: 24px; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--g) 55%, transparent); background: color-mix(in srgb, var(--g) 7%, var(--card)); }
.tile-cta b { font-size: 22px; }
.tile-cta .btn { grid-column: 2; grid-row: 1 / 3; align-self: center; }
.tile-cta:hover { box-shadow: inset 0 0 0 1.5px var(--g); background: color-mix(in srgb, var(--g) 10%, var(--card)); }

/* closing band */
.band { margin-top: var(--sec); }
.band-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 40px; padding: clamp(36px, 5vw, 56px) clamp(28px, 4vw, 56px); border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); width: min(calc(var(--wrap) - 80px), calc(100% - 80px)); }
.band .kh { max-width: 15em; }
.band p { margin: 10px 0 0; color: var(--muted); }
.band-go { display: flex; align-items: center; gap: 6px; }
.band-arrow { width: 96px; height: auto; overflow: visible; }
.band-arrow path { fill: none; stroke: var(--y); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 140; stroke-dashoffset: 140; transition: stroke-dashoffset 1s cubic-bezier(.5, 0, .3, 1) .3s; }
.band-arrow path + path { transition-delay: 1.2s; transition-duration: .4s; }
.band-in.in .band-arrow path, html:not(.js) .band-arrow path { stroke-dashoffset: 0; }

/* =====================================================================
   Inner pages
   ===================================================================== */
.page-head { padding: clamp(56px, 7vw, 100px) 0 clamp(24px, 3vw, 40px); }
.page-head .kh { display: inline-block; }
.page-head .kh::after {
  content: ""; display: block; height: 14px; margin-top: 6px; width: min(100%, 320px); background: var(--y);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 14' preserveAspectRatio='none'%3E%3Cpath d='M3 9C70 4 150 3 297 6' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") left / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 14' preserveAspectRatio='none'%3E%3Cpath d='M3 9C70 4 150 3 297 6' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") left / 100% 100% no-repeat;
}
.page-head .lede { margin-top: 18px; }

/* subject page */
.subj-hero {
  view-transition-name: subj-hero; position: relative; overflow: hidden; border-radius: var(--r);
  padding: clamp(34px, 5vw, 60px); margin-top: clamp(28px, 4vw, 44px); background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line);
}
.subj-hero .lede { margin: 16px 0 28px; }
.subj-hero .kh { color: var(--sc); }
.subj-tag { display: inline-flex; align-items: center; gap: 8px; font: 600 16px var(--display); color: var(--sc); }
.subj-tag i { width: 10px; height: 10px; border-radius: 50%; background: var(--sc); }
.stats { display: flex; flex-wrap: wrap; gap: 12px 44px; margin: 0; }
.stats div { display: grid; }
.stats dt { order: 2; font-size: 15px; color: var(--muted); }
.stats dd { order: 1; margin: 0; font: 800 40px/1.05 var(--display); color: var(--y); }
.subj-hero .ghosts { position: absolute; right: clamp(24px, 5vw, 70px); top: 50%; display: flex; gap: 16px; transform: translateY(-50%); pointer-events: none; }
.subj-hero .ghosts i { width: 36px; height: 36px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--sc); }
.subj-hero .ghosts i:nth-child(1) { opacity: .15; } .subj-hero .ghosts i:nth-child(2) { opacity: .28; } .subj-hero .ghosts i:nth-child(3) { opacity: .5; }
.subj-hero .ghosts i:nth-child(4) { background: color-mix(in srgb, var(--sc) 30%, transparent); }
.c-orange { --sc: var(--o); } .c-cyan { --sc: var(--b); } .c-lime { --sc: var(--g); } .c-violet { --sc: var(--v); }

.topic { margin-top: clamp(48px, 5vw, 68px); }
.topic h3 { margin: 0 0 14px; font: 800 26px/1.2 var(--display); color: var(--tc); }
.chap-list { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--line); }
.chap { display: grid; grid-template-columns: 56px 64px minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 14px 8px; border-bottom: 1.5px solid var(--line); transition: background-color .15s ease; }
.chap:hover { background: var(--faint); }
.chap .no { font: 800 28px/1 var(--display); color: var(--tc); font-variant-numeric: tabular-nums; }
.chap .lens { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line); }
.chap .name { display: grid; min-width: 0; }
.chap .name b { font: 700 22px/1.3 var(--display); }
.chap .name > span { font-size: 15px; color: var(--muted); }
.chap .f { font: italic 500 22px var(--math); color: var(--tc); white-space: nowrap; }
.t0 { --tc: var(--o); } .t1 { --tc: var(--p); } .t2 { --tc: var(--b); } .t3 { --tc: var(--v); }

/* the app's own chapter icons, drawn in chalk */
.ico { width: 40px; height: 40px; fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; overflow: hidden; }
.ico *:not([transform]) { transform-box: fill-box; transform-origin: center; }
.ico .fw { fill: var(--board); } .ico .fy { fill: var(--y); } .ico .fo { fill: var(--o); }
.ico .so { stroke: var(--o); stroke-width: 5; }
.ico .dash, .ico .loop { stroke-dasharray: 5 4; }
.ico .c1 { stroke: #ff9a76; } .ico .c2 { stroke: var(--y); } .ico .c3 { stroke: var(--g); } .ico .c4 { stroke: var(--b); } .ico .c5 { stroke: var(--v); }
.ico .c1, .ico .c2, .ico .c3, .ico .c4, .ico .c5 { stroke-width: 2.8; }
.ico .merc { transform-origin: 50% 100%; }
:is(.chap, .tile):hover .slide { animation: slide 1.3s ease-in-out infinite; }
:is(.chap, .tile):hover .ball { animation: ball 1.2s ease-in-out infinite alternate; }
:is(.chap, .tile):hover .box, :is(.chap, .tile):hover .arr { animation: nudge .7s ease-in-out infinite alternate; }
:is(.chap, .tile):hover .bolt, :is(.chap, .tile):hover .flame, :is(.chap, .tile):hover .bulb2 { animation: pulse .5s ease-in-out infinite alternate; }
:is(.chap, .tile):hover .piston { animation: piston 1.2s ease-in-out infinite alternate; }
:is(.chap, .tile):hover .j1 { animation: jig .5s ease-in-out infinite alternate; }
:is(.chap, .tile):hover .j2 { animation: jig .42s ease-in-out infinite alternate-reverse; }
:is(.chap, .tile):hover .j3 { animation: jig .55s ease-in-out infinite alternate; }
:is(.chap, .tile):hover .merc { animation: merc 1.1s ease-in-out infinite alternate; }
:is(.chap, .tile):hover .drift { animation: drift 1.1s linear infinite; }
:is(.chap, .tile):hover .dash, :is(.chap, .tile):hover .loop { animation: flow .7s linear infinite; }
:is(.chap, .tile):hover .fan { animation: fan 1s ease-in-out infinite alternate; }
:is(.chap, .tile):hover .chg1 { animation: toward .6s ease-in-out infinite alternate; }
:is(.chap, .tile):hover .chg2 { animation: toward-r .6s ease-in-out infinite alternate; }
:is(.chap, .tile):hover .spark { animation: flicker .35s steps(2) infinite; }
:is(.chap, .tile):hover .orbits { animation: spin 2.4s linear infinite; }
@keyframes slide { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(9px); } }
@keyframes ball { from { transform: translate(0, 0); } to { transform: translate(16px, -17px); } }
@keyframes nudge { from { transform: translateX(0); } to { transform: translateX(4px); } }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.14); } }
@keyframes piston { from { transform: translateY(0); } to { transform: translateY(8px); } }
@keyframes jig { from { transform: translate(-2px, -2px); } to { transform: translate(2px, 2px); } }
@keyframes merc { from { transform: scaleY(1); } to { transform: scaleY(1.45); } }
@keyframes drift { to { transform: translateX(-26px); } }
@keyframes flow { to { stroke-dashoffset: -18; } }
@keyframes fan { from { transform: rotate(-5deg); } to { transform: rotate(6deg); } }
@keyframes toward { from { transform: translateX(0); } to { transform: translateX(5px); } }
@keyframes toward-r { from { transform: translateX(0); } to { transform: translateX(-5px); } }
@keyframes flicker { from { opacity: 1; } to { opacity: .25; } }
@keyframes spin { to { transform: rotate(360deg); } }


/* get it: four steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.steps li { display: grid; grid-template-columns: 52px 1fr; gap: 18px; padding: 26px 26px; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); }
.steps .n { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; font: 800 23px var(--display); color: var(--c); box-shadow: inset 0 0 0 2px var(--c); }
.steps li:nth-child(1) { --c: var(--v); } .steps li:nth-child(2) { --c: var(--b); } .steps li:nth-child(3) { --c: var(--o); } .steps li:nth-child(4) { --c: var(--g); }
.steps h3 { margin: 8px 0 6px; font: 700 23px/1.25 var(--display); }
.steps p { margin: 0; color: var(--muted); }
.steps a { color: var(--y); font-weight: 600; }

.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); }
.fact { padding: 26px 24px; }
.fact + .fact { border-left: 1.5px solid var(--line); }
.fact b { display: block; font: 800 38px/1.1 var(--display); color: var(--fc); }
.fact > span { display: block; margin-top: 8px; color: var(--muted); font-size: 15.5px; line-height: 1.5; }
.fact:nth-child(1) { --fc: var(--o); } .fact:nth-child(2) { --fc: var(--v); } .fact:nth-child(3) { --fc: var(--g); } .fact:nth-child(4) { --fc: var(--b); }

.qs { max-width: 860px; border-top: 1.5px solid var(--line); }
.qs details { border-bottom: 1.5px solid var(--line); }
.qs summary { list-style: none; cursor: pointer; position: relative; padding: 22px 56px 22px 2px; font: 700 20px/1.35 var(--display); }
.qs summary::-webkit-details-marker { display: none; }
.qs summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; width: 32px; height: 32px; margin-top: -16px;
  display: grid; place-items: center; font: 600 22px/1 var(--display); color: var(--y);
  border-radius: 50%; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--y) 50%, transparent); transition: transform .25s ease;
}
.qs details[open] summary::after { content: "−"; transform: rotate(180deg); }
.qs details p { margin: 0 0 22px; color: var(--muted); max-width: 42em; }
.qs a { color: var(--y); }

/* demo page: two ways in */
.ways { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); margin-top: clamp(26px, 4vw, 40px); }
.way { display: flex; flex-direction: column; gap: 14px; padding: clamp(28px, 3.5vw, 40px); border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); }
.way.dark { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--g) 60%, transparent); background: color-mix(in srgb, var(--g) 7%, var(--card)); }
.way h2 { margin: 0; font: 800 clamp(26px, 2.6vw, 34px)/1.15 var(--display); }
.way ol, .way ul { margin: 0; padding-left: 22px; color: var(--muted); }
.way li + li { margin-top: 6px; }
.way .btn { align-self: flex-start; margin-top: auto; }

/* footer */
.foot { position: relative; z-index: 1; padding-bottom: var(--frame); margin-top: var(--sec); }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 28px 40px 36px; color: var(--muted); font-size: 15px; border-top: 1.5px solid var(--line); }
.foot-in img { width: 44px; height: auto; }
.foot-in nav { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-left: auto; }
.foot-in a { color: var(--ink); text-decoration: none; font-family: var(--display); font-weight: 600; }
.foot-in a:hover { color: var(--y); }
.board-no { font: 600 13.5px var(--display); color: var(--muted); }
.board-no i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; background: var(--board); box-shadow: 0 0 0 1.5px var(--line); }
.band + .foot, .after + .foot { margin-top: clamp(60px, 7vw, 90px); }

.notfound { padding: clamp(70px, 11vw, 150px) 0; }
.notfound .lede { margin: 16px 0 28px; }

/* ---------- smaller screens ---------- */
@media (max-width: 1080px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile-cta { grid-column: span 2; }
  .tryit { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .figures, .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures div:nth-child(3), .fact:nth-child(3) { border-left: 0; }
  .figures div:nth-child(n + 3), .fact:nth-child(n + 3) { border-top: 1.5px solid var(--line); }
}
@media (max-width: 819px) {
  :root { --frame: 6px; }
  .ledge { display: none; }
  .wrap { padding: 0 20px; }
  .head-in { grid-template-columns: auto 1fr; min-height: 0; padding-top: 10px; padding-bottom: 6px; gap: 6px 12px; }
  .tools { justify-self: end; grid-row: 1; grid-column: 2; }
  .nav { grid-row: 2; grid-column: 1 / -1; justify-content: flex-start; margin: 0 -14px; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; font-size: 15px; }
  .brand b { display: none; }
  .brand img { width: 46px; }
  .head .btn { min-height: 36px; padding: 6px 14px; font-size: 15px; }
  .seg button { padding: 4px 8px; min-width: 32px; }

  .scene { align-items: flex-start; padding-top: calc(var(--frame) + 108px); min-height: 115svh; }
  .scene.center { padding-top: calc(var(--frame) + 108px); }
  .sc0 { padding-top: calc(var(--frame) + 120px); }
  .scene.right .copy { margin-left: 0; }
  .mega { font-size: clamp(60px, 19vw, 96px); }
  .mega .k2 { padding-left: .35em; }
  .giant { font-size: clamp(56px, 17vw, 84px); }
  .scene.center .giant { margin-left: 0; font-size: clamp(34px, 9.5vw, 48px); }
  .hero-line { margin-top: 14px; font-size: 20px; }
  .eyebrow { font-size: 13.5px; margin-bottom: 10px; }
  .kh-l { font-size: clamp(27px, 7.6vw, 36px); }
  .lede { font-size: 15.5px; }
  .scene .lede { margin-top: 12px; font-size: 17px; line-height: 1.65; }
  .scene .eyebrow { font-size: 14.5px; }
  .tap { margin-top: 14px; font-size: 14px; padding: 6px 12px 6px 9px; }
  .more { margin-top: 14px; }
  .hero-ctas { margin-top: 20px; }
  .btn { min-height: 46px; padding: 10px 18px; font-size: 16px; }
  .w-rail { right: 10px; gap: 9px; }
  .w-rail i { width: 6px; height: 6px; }
  .cue { bottom: 4vh; }

  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile-cta { grid-column: span 1; grid-template-columns: 1fr; }
  .tile-cta .btn { grid-column: 1; grid-row: auto; margin-top: 12px; min-height: 40px; padding: 8px 14px; }
  .tile-cta b { font-size: 17px; }
  .tile { padding: 14px 14px 14px; }
  .tile .lens { width: 44px; height: 44px; }
  .tile .lens .ico { width: 34px; height: 34px; }
  .tile b { font-size: 16.5px; }
  .tile .f { font-size: 16px; }
  .figures div { padding: 20px 14px; }
  .figures dt { font-size: 14px; }
  .fact { padding: 20px 14px; }
  .sim { padding: 14px 12px 12px; }
  .sim-ctrl { grid-template-columns: 1fr; }
  .readout dd { font-size: 21px; }
  .readout dt { font-size: 12.5px; }
  .steps { grid-template-columns: 1fr; }
  .ways { grid-template-columns: 1fr; }
  .chap { grid-template-columns: 40px 50px minmax(0, 1fr); gap: 12px; }
  .chap .f { display: none; }
  .chap .lens { width: 48px; height: 48px; }
  .chap .no { font-size: 23px; }
  .chap .name b { font-size: 19px; }
  .subj-hero .ghosts { display: none; }
  .band-in { width: calc(100% - 40px); padding: 30px 22px; }
  .band-arrow { display: none; }
  .foot-in { padding: 24px 20px 30px; }
  .foot-in nav { margin-left: 0; width: 100%; }
}


/* "Reduce motion" (often set on Windows): keep the chalk animations, calm the big movements */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: vt-fade .25s ease both !important; }
  ::view-transition-old(root) { animation-direction: reverse !important; }
  .rv, .tile, .js .scene .copy > * { transform: none !important; }
  .cue i, .tap i::after, .hint i::after { animation: none !important; }
}
@keyframes vt-fade { from { opacity: 0; } to { opacity: 1; } }
}

/* chalk-textured text is cut to its own box, and Bengali letters reach above and below it:
   give that text room (padding) without moving the layout (matching negative margin) */
.kh { padding: .2em .1em .28em; margin-top: -.2em; margin-bottom: -.28em; margin-left: -.1em; }
.page-head .kh { margin-bottom: -.1em; }
.figures dd, .subj h3 { padding: .15em .1em .22em; margin-top: -.15em; margin-bottom: -.22em; margin-left: -.1em; }
.notfound::before { padding: .1em .1em .2em; }
