/* تەختەی ڕێزمان — whiteboard lessons for the grade-10 Kurdish grammar book.
   The board is a fixed 1600×900 canvas that is scaled to fit the screen,
   so every size below is in board pixels. */

:root {
  --ink: #1d2433;
  --ink-2: #4a5263;
  --ink-3: #8a91a0;
  --blue: #1f56d6;
  --red: #d42a3e;
  --green: #12865a;
  --orange: #e2700c;
  --purple: #7740c4;
  --yellow: #ffe24a;
  --hl: rgba(255, 222, 0, .5);

  --board: #fdfdfb;
  --wall: #e8e6e0;
  --wall-2: #dcd9d1;
  --wall-ink: #1d2433;
  --wall-muted: #636a78;
  --card: #f7f6f2;
  --line: rgba(29, 36, 51, .12);
  --frame-a: #eef0f3;
  --frame-b: #aab1ba;

  --ui: rgba(28, 28, 30, .9);
  --ui-hi: rgba(255, 255, 255, .1);
  --ui-fg: #f2f2f4;
  --ui-dim: #a1a1aa;
  --accent: #f08a24;
  --btn: #1d2433;
  --btn-fg: #ffffff;
  --btn-hover: #2c3550;

  --f-hand: 'Marhey', 'Vazirmatn', 'Noto Sans Arabic', Tahoma, sans-serif;
  --f-text: 'Vazirmatn', 'Noto Sans Arabic', Tahoma, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --wall: #17191d;
    --wall-2: #202329;
    --wall-ink: #eceef2;
    --wall-muted: #9aa1ad;
    --card: #1f2228;
    --line: rgba(255, 255, 255, .1);
    --frame-a: #5b616b;
    --frame-b: #2c3036;
    --btn: #eceef2;
    --btn-fg: #15171b;
    --btn-hover: #ffffff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --wall: #17191d;
  --wall-2: #202329;
  --wall-ink: #eceef2;
  --wall-muted: #9aa1ad;
  --card: #1f2228;
  --line: rgba(255, 255, 255, .1);
  --frame-a: #5b616b;
  --frame-b: #2c3036;
  --btn: #eceef2;
  --btn-fg: #15171b;
  --btn-hover: #ffffff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--wall);
  color: var(--wall-ink);
  font-family: var(--f-text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ───────────────────────── Library ───────────────────────── */

.lib { max-width: 1240px; margin: 0 auto; padding-block: 40px 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.lib-head {
  position: relative;
  background: var(--board);
  color: var(--ink);
  border-radius: 18px;
  padding: 44px 48px 40px;
  box-shadow: 0 0 0 10px var(--frame-a), 0 0 0 11px var(--frame-b), 0 18px 40px rgba(0, 0, 0, .14);
  margin: 12px 12px 56px;
  overflow: hidden;
}
.lib-head::after { /* marker smudge */
  content: ""; position: absolute; inset: auto -60px -80px auto; width: 380px; height: 220px;
  background: radial-gradient(closest-side, rgba(31, 86, 214, .07), transparent);
  pointer-events: none;
}
.lib-kicker { font-family: var(--f-hand); color: var(--red); font-size: 22px; margin: 0 0 6px; }
.lib-title {
  font-family: var(--f-hand); font-weight: 700; font-size: clamp(44px, 7vw, 76px);
  line-height: 1.25; margin: 0; color: var(--ink); display: inline-block; position: relative;
}
.lib-title .u-line { color: var(--blue); }
.lib-sub { font-size: 19px; color: var(--ink-2); margin: 18px 0 26px; line-height: 1.8; max-width: 760px; }
.lib-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line); background: transparent;
  text-decoration: none; font-size: 16px; font-weight: 600; cursor: pointer;
  transition: background .15s ease-out, transform .15s ease-out;
}
.btn:hover { background: rgba(127, 127, 127, .1); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--btn); color: var(--btn-fg); border-color: var(--btn); }
.btn.primary:hover { background: var(--btn-hover); }
.lib-head .btn { color: var(--ink); border-color: rgba(29, 36, 51, .16); }
.lib-head .btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }

.season { margin: 0 12px 48px; }
.season-h { display: flex; align-items: baseline; gap: 14px; margin: 0 0 20px; }
.season-h h2 { font-family: var(--f-hand); font-weight: 700; font-size: 32px; margin: 0; }
.season-h span { color: var(--wall-muted); font-size: 15px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 26px; }

.lcard {
  background: var(--card); border-radius: 16px; padding: 12px 12px 16px;
  border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px;
  transition: transform .2s ease-out, box-shadow .2s ease-out;
}
.lcard:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0, 0, 0, .12); }
.thumb {
  position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden;
  background: var(--board); box-shadow: 0 0 0 4px var(--frame-a), 0 0 0 5px var(--frame-b);
  margin: 5px;
}
.mini { position: absolute; top: 0; left: 0; width: 1600px; height: 900px; transform-origin: 0 0; pointer-events: none; }
.lcard-meta { padding: 0 6px; }
.lcard-n { font-family: var(--f-hand); color: var(--red); font-size: 16px; }
.lcard-t { font-family: var(--f-hand); font-weight: 700; font-size: 23px; margin: 2px 0 4px; line-height: 1.5; }
.lcard-d { color: var(--wall-muted); font-size: 14px; margin: 0; }
.lcard-row { display: flex; gap: 8px; padding: 0 6px; margin-top: auto; }
.lcard-row .btn { height: 40px; font-size: 15px; flex: 1; justify-content: center; }
.lcard-row .btn.pdf { flex: 0 0 auto; }

.howto { margin: 8px 12px 0; padding: 26px 28px; border-radius: 16px; border: 1px dashed var(--line); }
.howto h2 { font-family: var(--f-hand); font-size: 26px; margin: 0 0 14px; }
.keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px 26px; margin: 0; padding: 0; list-style: none; font-size: 15px; color: var(--wall-muted); }
.keys li { display: flex; gap: 10px; align-items: center; }
kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; direction: ltr;
  min-width: 26px; height: 26px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 7px; color: var(--wall-ink);
}
.lib-foot { text-align: center; color: var(--wall-muted); font-size: 13px; margin-top: 40px; }

/* ───────────────────────── Presenter ───────────────────────── */

.stage { position: fixed; inset: 0; overflow: hidden; background: var(--wall); }
.frame {
  position: absolute; left: 50%; top: 18px; transform: translateX(-50%);
  border-radius: 20px; padding: 12px;
  background: linear-gradient(160deg, var(--frame-a), var(--frame-b));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 22px 50px rgba(0, 0, 0, .22);
}
.stage.fs .frame { padding: 4px; border-radius: 10px; top: 8px; }
.board {
  position: absolute; top: 12px; left: 12px; width: 1600px; height: 900px;
  transform-origin: 0 0; background: var(--board); border-radius: 10px; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}
.stage.fs .board { top: 4px; left: 4px; border-radius: 6px; }
.board::before { /* soft board sheen */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(1100px 520px at 72% -10%, rgba(255, 255, 255, .9), transparent 70%),
              linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, .025));
}
.progress { position: absolute; left: 0; bottom: 0; height: 5px; background: var(--accent); border-radius: 0 3px 3px 0; transition: width .3s ease-out; z-index: 3; opacity: .85; }
canvas.ink, canvas.laser { position: absolute; inset: 0; width: 1600px; height: 900px; z-index: 5; pointer-events: none; }
canvas.ink { mix-blend-mode: multiply; }
.board.drawing canvas.ink { pointer-events: auto; touch-action: none; }
.board.t-pen canvas.ink, .board.t-hl canvas.ink { cursor: crosshair; }
.board.t-eraser canvas.ink { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Ccircle cx='14' cy='14' r='12' fill='white' fill-opacity='.6' stroke='%231d2433' stroke-width='1.5'/%3E%3C/svg%3E") 14 14, cell; }
.board.t-laser canvas.ink { cursor: none; }

.blank-tag {
  position: absolute; top: 26px; right: 34px; z-index: 4; font-family: var(--f-hand); font-size: 24px;
  color: var(--ink-3); display: none;
}
.board.blank .blank-tag { display: block; }
.board.blank .slide { visibility: hidden; }

/* Toolbar: same family as the Forma canvas toolbar — 36px controls, 18px icons, 1.5px strokes. */
.toolbar {
  position: absolute; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; padding: 6px; border-radius: 999px;
  background: var(--ui); color: var(--ui-fg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .28);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  z-index: 20; user-select: none; max-width: calc(100vw - 16px);
}
.tb-btn {
  position: relative; width: 36px; height: 36px; border: 0; border-radius: 999px; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ui-fg);
  transition: background .15s ease-out, color .15s ease-out; flex: none;
}
.tb-btn svg { width: 18px; height: 18px; }
.tb-btn:hover { background: var(--ui-hi); }
.tb-btn.on { background: rgba(255, 255, 255, .2); }
.tb-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn:focus-visible, .opt:focus-visible, .ov-item:focus-visible, .thumb:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tb-btn[disabled] { opacity: .35; cursor: default; }
.tb-sep { width: 1px; height: 20px; background: rgba(255, 255, 255, .16); margin: 0 6px; flex: none; }
.tb-count { font-size: 14px; font-variant-numeric: tabular-nums; min-width: 64px; text-align: center; color: var(--ui-dim); flex: none; }
.tb-count b { color: var(--ui-fg); font-weight: 600; }
.swatches { display: inline-flex; gap: 2px; margin: 0 2px; }
.sw { width: 28px; height: 36px; border: 0; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; }
.sw i { width: 16px; height: 16px; border-radius: 50%; display: block; box-shadow: 0 0 0 2px rgba(255, 255, 255, .15); transition: transform .15s ease-out, box-shadow .15s ease-out; }
.sw.on i { transform: scale(1.18); box-shadow: 0 0 0 2px var(--ui-fg); }
.tb-tip {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translate(-50%, 4px);
  white-space: nowrap; background: var(--ui); color: var(--ui-fg); font-size: 13px; padding: 5px 9px;
  border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .15s ease-out, transform .15s ease-out;
}
.tb-tip kbd { color: var(--ui-dim); border-color: rgba(255, 255, 255, .2); height: 20px; min-width: 20px; font-size: 11px; margin-inline-start: 6px; }
.tb-btn:hover .tb-tip { opacity: 1; transform: translate(-50%, 0); }

.overlay {
  position: absolute; inset: 0; z-index: 30; background: rgba(15, 17, 21, .78);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); overflow: auto; padding: 40px 32px 90px;
}
.ov-head { display: flex; justify-content: space-between; align-items: center; color: #fff; max-width: 1300px; margin: 0 auto 22px; }
.ov-head h2 { font-family: var(--f-hand); font-size: 28px; margin: 0; }
.ov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; max-width: 1300px; margin: 0 auto; }
.ov-item { background: none; border: 0; padding: 0; cursor: pointer; text-align: start; color: #d7d9de; font-size: 14px; }
.ov-item .thumb { margin: 0 0 10px; box-shadow: 0 0 0 3px rgba(255, 255, 255, .14); transition: box-shadow .15s ease-out; }
.ov-item:hover .thumb, .ov-item.cur .thumb { box-shadow: 0 0 0 3px var(--accent); }
.help-card { max-width: 760px; margin: 6vh auto 0; background: #fff; color: var(--ink); border-radius: 18px; padding: 30px 34px; }
.help-card h2 { font-family: var(--f-hand); margin: 0 0 16px; font-size: 28px; }
.help-card .keys { color: var(--ink-2); }
.help-card kbd { color: var(--ink); border-color: rgba(0, 0, 0, .15); }

/* ───────────────────────── Slide ───────────────────────── */

.slide {
  position: absolute; inset: 0; z-index: 1; direction: rtl; color: var(--ink);
  font-family: var(--f-text); font-size: 38px; line-height: 1.75;
  padding: 44px 80px 40px; display: flex; flex-direction: column;
}
.s-head { display: flex; align-items: flex-start; justify-content: space-between; height: 64px; flex: none; }
.s-label { font-family: var(--f-hand); font-weight: 700; font-size: 34px; line-height: 1.3; position: relative; display: inline-block; padding-bottom: 6px; }
.s-label .u-line { height: 12px; bottom: -6px; }
.s-lesson { font-size: 20px; color: var(--ink-3); line-height: 1.6; padding-top: 6px; }
.s-lesson b { font-weight: 600; color: var(--ink-2); }
.s-title { font-family: var(--f-hand); font-weight: 700; font-size: 52px; line-height: 1.45; text-align: center; margin: 0 0 8px; flex: none; }
.s-intro { text-align: center; font-size: 30px; color: var(--ink-2); margin: -4px 0 6px; line-height: 1.7; flex: none; }
.s-body { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; position: relative; }
.s-foot { display: flex; justify-content: space-between; align-items: center; height: 34px; font-size: 19px; color: var(--ink-3); flex: none; }
.s-foot .s-src { display: inline-flex; align-items: center; gap: 8px; }
.s-foot svg { width: 20px; height: 20px; }
svg.links { position: absolute; inset: 0; width: 1600px; height: 900px; pointer-events: none; z-index: 0; overflow: visible; }
svg.links path { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }

/* ink colours */
.i-r { color: var(--red); } .i-b { color: var(--blue); } .i-g { color: var(--green); }
.i-o { color: var(--orange); } .i-p { color: var(--purple); } .i-k { color: var(--ink); font-weight: 700; }
.hand { font-family: var(--f-hand); }
mark.mk-h { background: linear-gradient(100deg, transparent 0 2%, var(--hl) 4% 95%, transparent 98%); color: inherit; padding: 0 .12em; border-radius: .2em; }
.mk-u, .mk-c { position: relative; display: inline-block; }
.u-line { position: absolute; left: -2%; width: 104%; height: 14px; bottom: -4px; overflow: visible; pointer-events: none; }
.u-line path { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; }
.mk-u .u-line { color: var(--red); bottom: 2px; }
.mk-c .circ { position: absolute; inset: -14% -14%; width: 128%; height: 128%; color: var(--red); overflow: visible; pointer-events: none; }
.circ path { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; }
.mk-s { position: relative; color: var(--ink-3); }
.mk-s::after { content: ""; position: absolute; left: -2%; right: -2%; top: 52%; height: 4px; background: var(--red); border-radius: 2px; transform: rotate(-2deg); }
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.05; font-size: .82em; margin: 0 .15em; font-family: var(--f-text); font-weight: 700; }
.frac span:first-child { border-bottom: 3px solid currentColor; padding: 0 .2em .06em; }
.frac span:last-child { padding-top: .06em; }
.num { font-family: var(--f-hand); }

/* reveal: anything with data-s waits for its step */
.slide [data-s] { transition: opacity .45s ease-out, transform .45s ease-out, clip-path .7s ease-out; }
.slide [data-s]:not(.on) { opacity: 0; transform: translateY(8px); pointer-events: none; }
.slide .write[data-s] { clip-path: inset(-20% 0 -20% 0); }
.slide .write[data-s]:not(.on) { clip-path: inset(-20% 0 -20% 100%); transform: none; opacity: 1; }
svg.links path[data-s] { transition: stroke-dashoffset .8s ease-out, opacity .2s; transform: none !important; }
svg.links path[data-s]:not(.on) { opacity: 0; }
.slide.all [data-s], .slide.static [data-s] { opacity: 1 !important; transform: none !important; clip-path: none !important; transition: none !important; stroke-dashoffset: 0 !important; }
@media (prefers-reduced-motion: reduce) {
  .slide [data-s] { transition: opacity .2s linear !important; transform: none !important; clip-path: none !important; }
}

/* ── title ── */
.k-title .s-body { justify-content: center; align-items: center; padding-bottom: 30px; }
.tt-n { font-family: var(--f-hand); font-weight: 700; font-size: 40px; color: var(--red); margin-bottom: 14px; }
.tt-box {
  font-family: var(--f-hand); font-weight: 700; font-size: 84px; line-height: 1.35; padding: 22px 64px 30px;
  background: var(--yellow); border: 5px solid #2f9e4f; border-radius: 26px 30px 24px 32px / 30px 24px 32px 26px;
  box-shadow: 6px 8px 0 rgba(29, 36, 51, .08); position: relative; z-index: 1; text-align: center; max-width: 1300px;
}
.tt-meta { margin-top: 16px; font-size: 24px; color: var(--ink-3); }
.tt-goals { display: flex; gap: 40px; justify-content: center; margin-top: 96px; width: 100%; position: relative; z-index: 1; }
.tt-g { flex: 1; max-width: 440px; text-align: center; font-size: 32px; line-height: 1.65; padding: 18px 22px; border-radius: 18px; background: #fff; border: 3px solid currentColor; box-shadow: 4px 6px 0 rgba(29, 36, 51, .06); }
.tt-g b { display: block; font-family: var(--f-hand); font-size: 26px; margin-bottom: 4px; }
.tt-g span { color: var(--ink); }

/* ── define ── */
.def { max-width: 1340px; margin: 0 auto; width: 100%; }
.def-term { font-family: var(--f-hand); font-weight: 700; font-size: 62px; line-height: 1.4; display: inline-block; position: relative; margin-bottom: 18px; }
.def-term .u-line { bottom: -8px; height: 16px; }
.def-text { font-size: 44px; line-height: 1.85; margin: 0; }
.def-points { list-style: none; margin: 34px 0 0; padding: 0; display: grid; gap: 16px; }
.def-points li { font-size: 34px; line-height: 1.7; padding-inline-start: 46px; position: relative; }
.def-points li::before { content: ""; position: absolute; right: 6px; top: .62em; width: 18px; height: 18px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 5px rgba(31, 86, 214, .14); }
.def-ex { margin-top: 30px; font-size: 32px; color: var(--ink-2); }
.def-ex .lead { font-family: var(--f-hand); color: var(--green); margin-inline-end: 12px; }

/* ── tree ── */
.k-tree .s-body { justify-content: center; padding-bottom: 20px; }
.tree { display: flex; flex-direction: column; align-items: center; position: relative; width: 100%; }
.t-root {
  font-family: var(--f-hand); font-weight: 700; font-size: 46px; line-height: 1.35; padding: 12px 40px 18px;
  background: var(--yellow); border: 4px solid #2f9e4f; border-radius: 18px 22px 16px 24px / 22px 16px 24px 18px;
  position: relative; z-index: 1;
}
.t-row { display: flex; justify-content: space-around; width: 100%; margin-top: 78px; gap: 24px; position: relative; z-index: 1; }
.t-col { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 0; }
.t-node { font-family: var(--f-hand); font-weight: 700; text-align: center; line-height: 1.4; position: relative; z-index: 1; }
.t-node.lv1 { font-size: 44px; padding: 4px 18px; }
.t-node.lv1.boxed { border: 3.5px solid currentColor; border-radius: 16px 20px 14px 22px / 20px 14px 22px 16px; padding: 8px 26px 12px; background: #fff; }
.t-row:has(> .t-col:nth-child(4)) .t-node.lv1 { font-size: 34px; padding: 6px 16px 10px; }
.t-kids { display: flex; justify-content: center; gap: 36px; margin-top: 60px; width: 100%; }
.t-col2 { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.t-node.lv2 { font-size: 36px; padding: 2px 10px; }
.t-ex { margin-top: 14px; text-align: center; font-size: 30px; line-height: 1.8; color: var(--green); font-weight: 600; }
.t-ex.ink { color: var(--ink-2); font-weight: 500; }
.t-note { text-align: center; font-size: 28px; color: var(--ink-2); margin-top: 26px; }

/* ── cards ── */
.cards { display: grid; gap: 26px 30px; width: 100%; }
.cards.c1 { grid-template-columns: 1fr; max-width: 1200px; margin: 0 auto; }
.cards.c2 { grid-template-columns: 1fr 1fr; }
.cards.c3 { grid-template-columns: 1fr 1fr 1fr; }
.cards.c4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.card {
  --c: var(--blue);
  border: 3.5px solid var(--c); border-radius: 18px 24px 16px 22px / 22px 16px 24px 18px;
  background: color-mix(in srgb, var(--c) 5%, #fff); padding: 20px 26px 22px;
  display: flex; gap: 22px; align-items: flex-start; position: relative;
}
.card.cr { --c: var(--red); } .card.cg { --c: var(--green); } .card.co { --c: var(--orange); } .card.cp { --c: var(--purple); }
.card-ic {
  flex: none; width: 92px; height: 92px; border-radius: 50%; border: 3.5px solid var(--c); color: var(--c);
  display: flex; align-items: center; justify-content: center; font-family: var(--f-text); font-weight: 800;
  font-size: 50px; line-height: 1; background: #fff; direction: ltr;
}
.card-ic.sm { font-size: 34px; }
.card-b { min-width: 0; flex: 1; }
.card-t { font-family: var(--f-hand); font-weight: 700; font-size: 36px; line-height: 1.4; color: var(--c); margin-bottom: 4px; }
.card-d { font-size: 28px; line-height: 1.7; }
.card-x { font-size: 28px; line-height: 1.7; margin-top: 8px; color: var(--ink-2); }
.card-x .lead, .lead { font-family: var(--f-hand); color: var(--green); margin-inline-end: 8px; }
.cards.dense .card { padding: 14px 22px 16px; }
.cards.dense .card-d, .cards.dense .card-x { font-size: 26px; }
.cards.dense .card-t { font-size: 32px; }

/* ── chips ── */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 20px; max-width: 1360px; margin: 0 auto; }
.chip {
  font-family: var(--f-hand); font-weight: 700; font-size: 44px; line-height: 1.3; padding: 10px 28px 14px;
  border: 3.5px solid currentColor; border-radius: 999px; background: #fff;
}
.chips.sm .chip { font-size: 34px; padding: 6px 22px 10px; }
.chips .chip:nth-child(4n+1) { color: var(--blue); } .chips .chip:nth-child(4n+2) { color: var(--red); }
.chips .chip:nth-child(4n+3) { color: var(--green); } .chips .chip:nth-child(4n+4) { color: var(--purple); }
.chips.mono .chip { color: var(--blue); }
.chips-group.on .chip { animation: pop .45s both; }
.slide.static .chip, .print-page .chip { animation: none !important; }
@keyframes pop { from { opacity: 0; transform: scale(.7) rotate(-4deg); } to { opacity: 1; transform: none; } }
.chips-note { text-align: center; font-size: 32px; margin-top: 34px; line-height: 1.75; }
.chips-cap { text-align: center; font-family: var(--f-hand); font-size: 34px; color: var(--ink-2); margin: 0 0 20px; }
.chips-group + .chips-group { margin-top: 34px; }

/* ── formula ── */
.fx { display: flex; flex-direction: column; gap: 22px; align-items: center; width: 100%; }
.fx-grid { display: grid; gap: 14px 14px; align-items: center; justify-content: center; }
.fx-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 60px; width: 100%; }
.fx-row { display: contents; }
.fx-line { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fx-parts { display: flex; align-items: center; gap: 14px; justify-content: center; flex-wrap: wrap; }
.fx-p {
  --c: var(--blue);
  font-family: var(--f-hand); font-weight: 700; font-size: 40px; line-height: 1.3; padding: 6px 22px 10px;
  border: 3.5px solid var(--c); color: var(--c); border-radius: 14px 18px 12px 20px / 18px 12px 20px 14px;
  background: #fff; text-align: center; white-space: nowrap;
}
.fx-p.c1 { --c: var(--red); } .fx-p.c2 { --c: var(--purple); } .fx-p.c3 { --c: var(--orange); }
.fx-p.res { --c: var(--green); background: color-mix(in srgb, var(--yellow) 55%, #fff); }
.fx-p.soft { border-style: dashed; }
.fx-op { font-family: var(--f-hand); font-weight: 700; font-size: 46px; color: var(--ink-3); line-height: 1; text-align: center; }
.fx-ex { font-size: 30px; color: var(--ink-2); text-align: center; line-height: 1.7; }
.fx.compact .fx-p { font-size: 34px; padding: 3px 18px 7px; }
.fx.compact .fx-op { font-size: 38px; }
.fx.compact .fx-grid { gap: 10px 12px; }
.fx-note { font-size: 30px; text-align: center; color: var(--ink-2); line-height: 1.7; margin-top: 6px; }
.fx-head { font-family: var(--f-hand); font-size: 34px; color: var(--ink-2); text-align: center; }

/* ── examples ── */
.exs { list-style: none; margin: 0 auto; padding: 0; display: grid; gap: 18px; width: 100%; max-width: 1400px; counter-reset: ex; }
.exs li { display: grid; grid-template-columns: 60px 1fr auto; align-items: baseline; gap: 18px; font-size: 40px; line-height: 1.75; counter-increment: ex; }
.exs li::before {
  content: counter(ex, arabic-indic); font-family: var(--f-hand); font-weight: 700; color: var(--blue);
  width: 52px; height: 52px; border: 3px solid var(--blue); border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 28px; line-height: 1; align-self: center;
}
.exs.nonum li { grid-template-columns: 1fr auto; } .exs.nonum li::before { display: none; }
.exs .ex-n { font-size: 26px; color: var(--green); font-family: var(--f-hand); white-space: nowrap; }
.exs.sm li { font-size: 34px; gap: 14px; }
.ex-lead { text-align: center; font-size: 32px; color: var(--ink-2); margin-bottom: 18px; }
.ex-foot { text-align: center; font-size: 30px; margin-top: 26px; line-height: 1.7; }

/* ── parse (labelled brackets under words) ── */
.parse { display: flex; flex-direction: column; gap: 22px; width: 100%; align-items: center; }
.pz { font-size: 42px; line-height: 1.5; text-align: center; position: relative; }
.parse.sm { gap: 14px; } .parse.sm .pz { font-size: 36px; } .parse.sm .seg-l { font-size: 24px; }
.pz-note { font-size: 28px; color: var(--ink-2); text-align: center; margin-top: 6px; }
.seg { display: inline-flex; flex-direction: column; align-items: center; vertical-align: top; position: relative; margin: 0 4px; }
.seg-t { position: relative; color: var(--c, var(--red)); font-weight: 700; padding: 0 4px; }
.seg-t::after {
  content: ""; position: absolute; left: 3px; right: 3px; bottom: -6px; height: 14px;
  border: 3.5px solid currentColor; border-top: 0; border-radius: 0 0 10px 10px;
}
.seg-pu { position: absolute; left: -.38em; top: 0; color: var(--ink); font-weight: 400; }
.seg-l { margin-top: 12px; white-space: nowrap; font-family: var(--f-hand); font-weight: 700; font-size: 27px; color: var(--c, var(--red)); line-height: 1.3; }
/* a word split into two coloured parts keeps its letters joined: labels float and stagger */
.seg.tight { margin: 0; padding-bottom: 60px; }
.seg.tight .seg-l { position: absolute; top: calc(100% - 42px); margin: 0; }
.seg.tight.j { padding-bottom: 98px; } .seg.tight.j .seg-l { transform: translateY(38px); }
.pg { display: inline-flex; flex-direction: column; align-items: center; vertical-align: top; position: relative; padding-bottom: 66px; }
.pg-in { position: relative; padding: 0 6px; }
.pg-in::after { content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 16px; border: 3.5px solid var(--c, var(--ink)); border-top: 0; border-radius: 0 0 14px 14px; opacity: .85; }
.pg-l { position: absolute; bottom: 8px; white-space: nowrap; font-family: var(--f-hand); font-weight: 700; font-size: 27px; color: var(--c, var(--ink)); }
.pz .seg.c-r, .pz .pg.c-r { --c: var(--red); } .pz .c-b { --c: var(--blue); } .pz .c-g { --c: var(--green); }
.pz .c-o { --c: var(--orange); } .pz .c-p { --c: var(--purple); } .pz .c-k { --c: var(--ink); }
/* practice mode: sentence visible, marks appear on the step */
.slide .rv[data-s]:not(.on) { opacity: 1; transform: none; }
.rv:not(.on) .seg-t, .rv:not(.on) .pg-in { color: var(--ink); font-weight: 400; }
.rv:not(.on) .seg-t::after, .rv:not(.on) .pg-in::after, .rv:not(.on) .seg-l, .rv:not(.on) .pg-l { opacity: 0; }
.rv .seg-t::after, .rv .pg-in::after, .rv .seg-l, .rv .pg-l, .rv .seg-t { transition: opacity .4s ease-out, color .4s ease-out; }
.rv:not(.on) .pz-note { opacity: 0; }

/* ── table ── */
.tbw { width: 100%; display: flex; justify-content: center; }
table.tb { border-collapse: collapse; font-size: 32px; line-height: 1.55; min-width: 70%; }
table.tb th { font-family: var(--f-hand); font-weight: 700; font-size: 32px; color: var(--blue); padding: 6px 26px 12px; border-bottom: 4px solid var(--blue); text-align: start; }
table.tb td { padding: 9px 26px; border-bottom: 2px solid rgba(29, 36, 51, .1); vertical-align: middle; }
table.tb td:first-child { font-family: var(--f-hand); font-weight: 700; color: var(--red); white-space: nowrap; }
table.tb.plain td:first-child { font-family: var(--f-text); font-weight: 600; color: var(--ink); }
table.tb.sm { font-size: 28px; } table.tb.sm th { font-size: 28px; padding-bottom: 8px; } table.tb.sm td { padding: 6px 22px; }
table.tb tr[data-s] { transform: none; }
.tb-note { text-align: center; font-size: 28px; color: var(--ink-2); margin-top: 20px; }

/* ── notes (sticky notes) ── */
.notes { display: grid; gap: 36px 40px; width: 100%; align-items: start; }
.notes.n1 { grid-template-columns: 1fr; max-width: 1100px; margin: 0 auto; }
.notes.n2 { grid-template-columns: 1fr 1fr; }
.notes.n3 { grid-template-columns: 1fr 1fr 1fr; }
.note {
  --bg: #fff3a6; background: var(--bg); padding: 34px 30px 26px; position: relative; font-size: 29px; line-height: 1.7;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .04), 4px 12px 22px rgba(29, 36, 51, .12); border-radius: 3px 3px 18px 3px;
}
.note::before { /* tape */
  content: ""; position: absolute; top: -14px; left: 50%; width: 120px; height: 30px; transform: translateX(-50%) rotate(-3deg);
  background: rgba(255, 255, 255, .55); box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.note:nth-child(4n+1) { --bg: #fff1a1; rotate: -1.2deg; } .note:nth-child(4n+2) { --bg: #ffdbe5; rotate: .9deg; }
.note:nth-child(4n+3) { --bg: #d9ecff; rotate: -.6deg; } .note:nth-child(4n+4) { --bg: #dcf5df; rotate: 1.1deg; }
.note-t { font-family: var(--f-hand); font-weight: 700; font-size: 31px; color: var(--ink); margin-bottom: 6px; display: flex; gap: 10px; align-items: center; }
.note-t .num { width: 40px; height: 40px; border-radius: 50%; background: rgba(29, 36, 51, .85); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; flex: none; }
.note-x { margin-top: 10px; color: var(--blue); font-size: 28px; }
.notes.n1 .note { font-size: 34px; padding: 40px 44px 34px; } .notes.n1 .note-t { font-size: 38px; } .notes.n1 .note-x { font-size: 32px; }
.notes.dense .note { font-size: 26px; padding: 28px 26px 20px; } .notes.dense .note-x { font-size: 25px; }

/* ── compare ── */
.cmp { display: grid; grid-template-columns: 1fr 70px 1fr; width: 100%; align-items: stretch; }
.cmp-p { padding: 6px 10px; }
.cmp-t { font-family: var(--f-hand); font-weight: 700; font-size: 46px; text-align: center; line-height: 1.4; margin-bottom: 6px; }
.cmp-d { font-size: 30px; text-align: center; line-height: 1.7; color: var(--ink-2); margin-bottom: 14px; }
.cmp-l { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cmp-l li { font-size: 31px; line-height: 1.7; padding-inline-start: 40px; position: relative; }
.cmp-l li::before { content: ""; position: absolute; right: 4px; top: .7em; width: 16px; height: 16px; border-radius: 50%; background: currentColor; opacity: .9; }
.cmp-p.a { color: var(--red); } .cmp-p.b { color: var(--blue); }
.cmp-l li > span { color: var(--ink); }
.cmp-mid { display: flex; flex-direction: column; align-items: center; }
.cmp-mid::before { content: ""; flex: 1; width: 4px; border-radius: 4px; background: repeating-linear-gradient(180deg, var(--ink-3) 0 18px, transparent 18px 28px); opacity: .5; }
.cmp-vs { font-family: var(--f-hand); font-weight: 700; font-size: 26px; color: var(--ink-3); width: 58px; height: 58px; border: 3px solid var(--ink-3); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 14px 0; background: var(--board); }
.cmp-mid::after { content: ""; flex: 1; width: 4px; border-radius: 4px; background: repeating-linear-gradient(180deg, var(--ink-3) 0 18px, transparent 18px 28px); opacity: .5; }
.cmp-foot { text-align: center; font-size: 29px; margin-top: 22px; color: var(--ink-2); line-height: 1.7; }

/* ── quiz ── */
.quiz { display: flex; flex-direction: column; gap: 34px; width: 100%; max-width: 1420px; margin: 0 auto; }
.q-t { display: flex; gap: 18px; align-items: baseline; font-size: 36px; line-height: 1.65; margin-bottom: 14px; }
.q-t .num { flex: none; width: 54px; height: 54px; border-radius: 50%; background: var(--green); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 28px; align-self: center; }
.q-o { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding-inline-start: 72px; }
.q-o.two { grid-template-columns: 1fr 1fr; }
.opt {
  position: relative; display: flex; align-items: center; gap: 14px; text-align: start; cursor: pointer;
  font-family: var(--f-text); font-size: 30px; line-height: 1.5; padding: 10px 16px; min-height: 66px;
  border: 3px solid rgba(29, 36, 51, .18); border-radius: 16px; background: #fff; color: var(--ink);
  transition: border-color .2s ease-out, background .2s ease-out, transform .2s ease-out;
}
.opt:hover { border-color: rgba(29, 36, 51, .4); }
.opt .ol { flex: none; width: 44px; height: 44px; border-radius: 50%; background: rgba(29, 36, 51, .08); display: inline-flex; align-items: center; justify-content: center; font-family: var(--f-hand); font-weight: 700; font-size: 24px; }
.opt.right { border-color: var(--green); background: #e8f7ef; }
.opt.right .ol { background: var(--green); color: #fff; }
.opt.wrong { border-color: var(--red); background: #fdecee; animation: shake .4s; }
.opt.wrong .ol { background: var(--red); color: #fff; }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(7px); } 75% { transform: translateX(-4px); } }
.opt .circ { position: absolute; inset: -12px -10px; width: calc(100% + 20px); height: calc(100% + 24px); color: var(--green); }
.opt .tick { position: absolute; top: -26px; left: -12px; width: 56px; height: 56px; color: var(--green); }
.tick path { fill: none; stroke: currentColor; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.q-why {
  margin: 12px 0 0; margin-inline-start: 72px; padding: 6px 18px 8px; border-radius: 12px;
  background: #e8f7ef; border-inline-start: 5px solid var(--green); font-size: 26px; line-height: 1.6; color: var(--ink);
}
.q-why .lead { margin-inline-end: 10px; }
.quiz.dense .q-why { font-size: 23px; margin-top: 8px; padding: 3px 16px 5px; }
.quiz.dense { gap: 22px; } .quiz.dense .q-t { font-size: 32px; margin-bottom: 8px; } .quiz.dense .opt { font-size: 27px; min-height: 58px; padding: 6px 14px; }

/* ── fill (blanks) ── */
.fill { list-style: none; margin: 0 auto; padding: 0; display: grid; gap: 22px; width: 100%; max-width: 1400px; counter-reset: fl; }
.fill li { display: grid; grid-template-columns: 60px 1fr; gap: 18px; align-items: baseline; font-size: 38px; line-height: 1.9; counter-increment: fl; }
.fill li::before { content: counter(fl, arabic-indic); font-family: var(--f-hand); font-weight: 700; color: var(--orange); width: 50px; height: 50px; border: 3px solid var(--orange); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; line-height: 1; align-self: center; }
.blank { display: inline-block; min-width: 150px; border-bottom: 4px dotted var(--ink-3); text-align: center; padding: 0 12px; margin: 0 6px; line-height: 1.4; vertical-align: baseline; }
.blank .ans { font-family: var(--f-hand); font-weight: 700; color: var(--green); }
.fill.sm li { font-size: 34px; gap: 14px; }

/* ── fix / convert ── */
.fix { display: grid; gap: 24px; width: 100%; max-width: 1440px; margin: 0 auto; }
.fx-item { display: grid; grid-template-columns: 1fr 70px 1fr; gap: 10px; align-items: center; }
.fx-bad, .fx-good { font-size: 32px; line-height: 1.6; padding: 12px 20px; border-radius: 16px; }
.fx-bad { background: #fff; border: 3px dashed rgba(212, 42, 62, .45); position: relative; }
.fx-good { background: #ecf8f1; border: 3px solid var(--green); color: var(--ink); }
.fx-arrow { color: var(--ink-3); display: flex; justify-content: center; }
.fx-arrow svg { width: 56px; height: 34px; }
.fx-arrow path { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.fx-why { grid-column: 1 / -1; font-size: 25px; color: var(--ink-2); padding-inline-start: 24px; margin-top: -6px; }
.fx-bad .xmark { position: absolute; top: -18px; left: -14px; width: 40px; height: 40px; color: var(--red); }
.fix.convert .fx-bad { border-color: rgba(31, 86, 214, .4); }
.fix.convert .fx-arrow { color: var(--blue); }

/* ── merge ── */
.merge { display: grid; grid-template-columns: auto 120px 1fr; align-items: center; gap: 10px; width: 100%; max-width: 1440px; margin: 0 auto; }
.mg-from { display: grid; gap: 14px; }
.mg-from div { font-size: 33px; line-height: 1.6; padding: 8px 22px; border-radius: 14px; background: #f1f4fb; border: 2px solid rgba(31, 86, 214, .25); }
.mg-brace { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--blue); }
.mg-brace svg { width: 110px; height: 100%; overflow: visible; }
.mg-brace path { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.mg-to { font-size: 38px; line-height: 1.7; padding: 22px 30px; border-radius: 20px; background: color-mix(in srgb, var(--yellow) 45%, #fff); border: 4px solid var(--green); }
.mg-note { grid-column: 1 / -1; text-align: center; font-size: 29px; color: var(--ink-2); margin-top: 20px; line-height: 1.7; }

/* ── summary ── */
.sum { list-style: none; margin: 0 auto; padding: 0; display: grid; gap: 16px; max-width: 1300px; width: 100%; }
.sum li { font-size: 34px; line-height: 1.7; display: flex; gap: 20px; align-items: baseline; }
.sum li .tick { width: 46px; height: 46px; flex: none; color: var(--green); align-self: center; }
.sum-hw {
  margin: 30px auto 0; display: flex; align-items: center; gap: 14px; justify-content: center; width: fit-content;
  font-size: 28px; color: var(--ink-2); padding: 12px 26px; border: 3px dashed var(--orange); border-radius: 16px;
}
.sum-hw svg { width: 36px; height: 36px; flex: none; color: var(--orange); }
.sum-hw b { font-family: var(--f-hand); color: var(--orange); font-weight: 700; }

/* ── cover (all-lessons PDF) ── */
.k-cover { align-items: center; justify-content: center; padding: 70px 120px; }
.cv-kick { font-family: var(--f-hand); color: var(--red); font-size: 30px; }
.cv-title { font-family: var(--f-hand); font-weight: 700; font-size: 104px; line-height: 1.3; margin: 6px 0 46px; position: relative; display: inline-block; }
.cv-title .u-line { color: var(--blue); height: 18px; bottom: -6px; }
.cv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 90px; width: 100%; }
.cv-cols h3 { font-family: var(--f-hand); font-size: 34px; margin: 0 0 12px; color: var(--blue); }
.cv-cols ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cv-cols li { display: flex; align-items: center; gap: 16px; font-size: 28px; line-height: 1.6; border-bottom: 2px dotted rgba(29, 36, 51, .15); padding-bottom: 4px; }
.cv-n { font-family: var(--f-hand); font-weight: 700; color: #fff; background: var(--ink); width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; flex: none; }
.cv-p { margin-inline-start: auto; color: var(--ink-3); font-size: 22px; }

/* ───────────────────────── Print / PDF ───────────────────────── */

.print-root { display: none; }
@page { size: 1600px 900px; margin: 0; }
@media print {
  html, body { background: #fff !important; width: 1600px; }
  body > *:not(.print-root) { display: none !important; }
  .print-root { display: block !important; }
}
body.printing { background: #fff; width: 1600px; }
body.printing > *:not(.print-root) { display: none !important; }
body.printing .print-root { display: block; }
.print-page { position: relative; width: 1600px; height: 900px; overflow: hidden; background: #fff; break-after: page; page-break-after: always; }
.print-page:last-child { break-after: auto; page-break-after: auto; }
.print-page .slide [data-s] { opacity: 1 !important; transform: none !important; clip-path: none !important; transition: none !important; }
.print-page .rv .seg-t, .print-page .rv .pg-in { color: var(--c, var(--red)); font-weight: 700; }
.print-page .rv .seg-t::after, .print-page .rv .pg-in::after, .print-page .rv .seg-l, .print-page .rv .pg-l, .print-page .rv .pz-note { opacity: 1 !important; }
.print-cover .slide { padding-top: 60px; }

/* ───────────────────────── Small screens ───────────────────────── */
@media (max-width: 760px) {
  .lib { padding-block: 22px 48px; }
  .lib-head { padding: 30px 24px 28px; margin: 8px 8px 40px; }
  .season { margin: 0 4px 40px; }
  .howto { margin: 0 4px; }
  .toolbar .opt-wide { display: none; }
  .tb-count { min-width: 50px; }
}

/* ═════════════════════════ تەختە prototype: every subject, grade 1–12 ═════════════════════════ */

/* ── teacher home ── */
.home { max-width: 1240px; margin: 0 auto; padding-block: 22px 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); direction: rtl; }
.h-top { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin: 0 12px 26px; }
.h-brand { display: flex; align-items: center; gap: 12px; font-size: 17px; color: var(--wall-muted); }
.h-tag { font-family: var(--f-hand); font-weight: 700; font-size: 26px; line-height: 1.45; background: var(--yellow); color: #1d2433; border: 3px solid #2f9e4f; border-radius: 10px 12px 9px 13px; padding: 0 14px 4px; }
.h-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.h-chip { font-size: 14px; font-weight: 600; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--wall-ink); }
.h-chip.proto { border-color: var(--accent); color: var(--accent); }
.h-hero {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 34px; align-items: center;
  background: var(--board); color: var(--ink); border-radius: 18px; padding: 36px 40px; margin: 12px 12px 40px;
  box-shadow: 0 0 0 10px var(--frame-a), 0 0 0 11px var(--frame-b), 0 18px 40px rgba(0, 0, 0, .14);
}
.h-kick { font-family: var(--f-hand); color: var(--red); font-size: 20px; margin: 0 0 4px; }
.h-hello h1 { font-family: var(--f-hand); font-weight: 700; font-size: clamp(36px, 5vw, 60px); line-height: 1.3; margin: 0; display: inline-block; position: relative; }
.h-hello h1 .u-line { color: var(--blue); }
.h-hello p { font-size: 18px; line-height: 1.85; color: var(--ink-2); margin: 16px 0 20px; max-width: 560px; }
.h-hero .btn { color: var(--ink); border-color: rgba(29, 36, 51, .18); }
.h-resume { display: grid; gap: 12px; text-decoration: none; color: var(--ink); background: #f4f5f8; border-radius: 16px; padding: 12px 12px 16px; border: 1px solid rgba(29, 36, 51, .08); transition: transform .2s ease-out; min-width: 0; }
.h-resume:hover { transform: translateY(-3px); }
.h-resume:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.h-resume-t { display: grid; gap: 2px; padding: 0 8px; }
.h-resume-t .h-kick { font-size: 16px; }
.h-resume-t b { font-family: var(--f-hand); font-size: 22px; line-height: 1.5; }
.h-resume-t span:last-child { font-size: 14px; color: var(--ink-3); }
.h-grades { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 12px 30px; }
.h-gl { font-family: var(--f-hand); font-size: 22px; margin-inline-end: 8px; }
.gr { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: transparent; font-family: var(--f-hand); font-size: 20px; cursor: pointer; color: var(--wall-ink); transition: background .15s ease-out; }
.gr:hover { background: rgba(127, 127, 127, .12); }
.gr.on { background: var(--btn); color: var(--btn-fg); border-color: var(--btn); }
.gr:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.h-shelves { display: grid; gap: 34px; margin: 0 12px 48px; }
.shelf-h { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.shelf-h h2 { font-family: var(--f-hand); font-size: 28px; margin: 0; }
.shelf-n { color: var(--wall-muted); font-size: 14px; }
.sj { min-width: 44px; height: 44px; padding: 0 8px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-family: 'STIX Two Text', 'Times New Roman', serif; font-weight: 700; font-size: 20px; color: #fff; direction: ltr; }
.sj-r { background: var(--red); } .sj-b { background: var(--blue); } .sj-g { background: var(--green); } .sj-o { background: var(--orange); } .sj-p { background: var(--purple); }
.shelf-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.soon .shelf-h { flex-wrap: wrap; }
.soon .shelf-h .btn { margin-inline-start: auto; }
.soon-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 12px; }
.soon-t { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1px dashed var(--line); }
.soon-t b { font-family: var(--f-hand); font-size: 19px; font-weight: 700; }
.soon-t span:last-child { margin-inline-start: auto; white-space: nowrap; font-size: 12px; color: var(--wall-muted); }
.soon-t .sj { min-width: 38px; height: 38px; font-size: 17px; border-radius: 10px; opacity: .85; }
.lcard.ghost { border-style: dashed; background: transparent; min-height: 150px; display: grid; place-items: center; }
.lcard.ghost:hover { transform: none; box-shadow: none; }
.ghost-in { display: grid; justify-items: center; gap: 4px; color: var(--wall-muted); text-align: center; padding: 18px; }
.ghost-in svg { width: 24px; height: 24px; opacity: .7; }
.ghost-in b { font-size: 16px; color: var(--wall-ink); font-weight: 600; }
.ghost-in span { font-size: 14px; }
.lcard.ext { text-decoration: none; color: inherit; }
.ext-box {
  aspect-ratio: 16 / 9; margin: 5px; border-radius: 10px; background: var(--board); color: #1d2433;
  box-shadow: 0 0 0 4px var(--frame-a), 0 0 0 5px var(--frame-b);
  display: grid; place-items: center; font-family: var(--f-hand); font-weight: 700; font-size: 26px;
}
.ext-box span { background: var(--yellow); border: 3px solid #2f9e4f; border-radius: 12px 14px 10px 16px; padding: 2px 18px 8px; }
.lcard.ext .btn { margin: 0 6px; justify-content: center; }
.lcard-row .btn[aria-label] { flex: 0 0 44px; padding: 0; justify-content: center; font-family: var(--f-hand); }

.modal { position: fixed; inset: 0; z-index: 50; background: rgba(15, 17, 21, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px max(16px, env(safe-area-inset-left, 0px)); overflow: auto; direction: rtl; }
.modal-card { background: var(--board); color: var(--ink); border-radius: 18px; padding: 26px 28px; max-width: 760px; width: 100%; display: grid; gap: 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-head h2 { font-family: var(--f-hand); font-size: 28px; margin: 0; }
.modal-card .btn { color: var(--ink); border-color: rgba(29, 36, 51, .16); }
.flow { list-style: none; counter-reset: f; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.flow li { counter-increment: f; display: grid; gap: 4px; align-content: start; padding: 14px; border-radius: 14px; background: #f2f4f8; font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.flow li::before { content: counter(f, arabic-indic); width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700; margin-bottom: 4px; }
.flow li b { font-size: 16px; color: var(--ink); }
.drop { border: 2.5px dashed rgba(29, 36, 51, .25); border-radius: 16px; padding: 26px; display: grid; justify-items: center; gap: 6px; text-align: center; color: var(--ink-3); font-size: 14px; line-height: 1.7; }
.drop svg { width: 34px; height: 34px; }
.drop b { font-size: 18px; color: var(--ink-2); }

@media (max-width: 760px) {
  .h-hero { grid-template-columns: minmax(0, 1fr); padding: 26px 22px; margin: 8px 8px 30px; }
  .h-top, .h-grades, .h-shelves { margin-inline: 4px; }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gr { width: 40px; height: 40px; }
}

/* ── maths typesetting ── */
.m { font-family: 'STIX Two Text', 'Cambria Math', 'Times New Roman', serif; direction: ltr; unicode-bidi: isolate; white-space: nowrap; font-size: 1.06em; line-height: 1.25; }
.m i { font-style: italic; padding: 0 .03em; }
.m .mo { margin: 0 .24em; font-style: normal; }
.m .mu { margin-right: .04em; }
.m .msp { display: inline-block; width: .18em; }
.m .msp2 { display: inline-block; width: .32em; }
.m .mquad { display: inline-block; width: 1em; }
.m .mrm { font-style: normal; }
.m .mfn { margin-right: .14em; }
.m sup, .m sub { font-size: .64em; line-height: 0; }
.m sup { vertical-align: .62em; }
.m sub { vertical-align: -.26em; }
.m .mf { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; font-size: .9em; margin: 0 .1em; line-height: 1.12; }
.m .mf > span:first-child { border-bottom: .07em solid currentColor; padding: 0 .16em .04em; }
.m .mf > span:last-child { padding: .05em .16em 0; }
.m .mss { display: inline-flex; flex-direction: column; vertical-align: middle; font-size: .6em; line-height: 1.1; margin-left: .05em; }
.m .mss.lim { min-height: 2.6em; justify-content: space-between; margin-left: -.02em; }
.m .mint { font-size: 1.55em; vertical-align: -.24em; line-height: 1; }
.m .mbig { font-size: 1.4em; vertical-align: -.16em; line-height: 1; font-style: normal; font-weight: 300; }
.m .mbar { margin: 0 .08em; }
.m .mbox { border: .06em solid currentColor; padding: .02em .3em; border-radius: .15em; }
.m .msq > span { border-top: .06em solid currentColor; padding: 0 .1em; }

/* ── steps: a worked solution, line by line ── */
.st { width: 100%; max-width: 1440px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.st-prob { font-size: 30px; line-height: 1.75; color: var(--ink); background: #f1f5fd; border-inline-start: 6px solid var(--blue); padding: 10px 24px 12px; border-radius: 10px; }
.st-rows { display: flex; flex-direction: column; gap: 4px; }
.st-row { display: grid; grid-template-columns: 470px minmax(0, 1fr); align-items: center; column-gap: 34px; min-height: 82px; }
.st-n { font-family: var(--f-hand); color: var(--blue); font-size: 25px; line-height: 1.5; position: relative; padding-inline-end: 40px; }
.st-n:not(:empty)::after { content: ""; position: absolute; left: 4px; top: 50%; width: 24px; height: 3px; border-radius: 2px; background: var(--blue); opacity: .45; }
.st-m { direction: ltr; text-align: left; font-size: 44px; color: var(--ink); }
.slide .write-ltr[data-s] { clip-path: inset(-40% -2% -40% 0); }
.slide .write-ltr[data-s]:not(.on) { clip-path: inset(-40% 100% -40% 0); transform: none; opacity: 1; }
.st-row.ans .st-m { display: flex; align-items: center; gap: 18px; }
.st-box { background: var(--yellow); border: 4px solid #2f9e4f; border-radius: 14px 18px 12px 20px; padding: 2px 24px 8px; }
.st-row.ans .tick { width: 54px; height: 54px; color: var(--green); flex: none; }
.st-note { font-size: 27px; line-height: 1.7; color: var(--ink-2); text-align: center; margin-top: 4px; }

/* ── graph ── */
.gph { display: flex; align-items: center; gap: 46px; width: 100%; }
.gph-side { flex: 1; min-width: 0; list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.gph-side li { font-size: 29px; line-height: 1.65; padding-inline-start: 38px; position: relative; }
.gph-side li::before { content: ""; position: absolute; right: 4px; top: .66em; width: 16px; height: 16px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(18, 134, 90, .14); }
.gph-plot { position: relative; width: 800px; flex: none; direction: ltr; }
.g-svg { display: block; width: 100%; height: auto; overflow: visible; }
.g-grid line { stroke: rgba(29, 36, 51, .08); stroke-width: 1.5; }
.g-axis { stroke: var(--ink); stroke-width: 3; color: var(--ink); }
.g-ticks text { font-family: 'STIX Two Text', 'Times New Roman', serif; font-size: 25px; fill: var(--ink-2); }
.g-al { font-family: 'STIX Two Text', 'Times New Roman', serif; font-style: italic; font-size: 28px; fill: var(--ink); }
.g-curve { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.g-area { fill: var(--c); fill-opacity: .26; stroke: none; }
.gl.c-y .g-area { fill-opacity: .75; }
.g-rect { fill: var(--c); fill-opacity: .18; stroke: var(--c); stroke-width: 2.5; }
.g-seg { fill: none; stroke: var(--c); stroke-width: 13; stroke-linecap: round; stroke-opacity: .5; }
.slide .gl[data-s], .slide .gl[data-s]:not(.on) { transform: none; }
.g-lab { position: absolute; width: 0; height: 0; }
.g-lab > span { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; font-size: 29px; line-height: 1.5; color: var(--c); background: rgba(253, 253, 251, .9); padding: 2px 12px 4px; border-radius: 10px; direction: rtl; font-family: var(--f-text); font-weight: 600; }

/* ── formula card ── */
.fc { width: 100%; max-width: 1300px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.fc-f { font-size: 74px; padding: 14px 56px 22px; background: #fffbe0; border: 5px solid #2f9e4f; border-radius: 26px 30px 24px 32px / 30px 24px 32px 26px; box-shadow: 6px 8px 0 rgba(29, 36, 51, .08); color: var(--ink); }
.fc-leg { display: grid; width: 100%; max-width: 1180px; }
.fc-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 150px; align-items: center; gap: 24px; padding: 8px 18px; border-bottom: 2px dashed rgba(29, 36, 51, .12); }
.fc-row:last-child { border-bottom: 0; }
.fc-sym { font-size: 44px; color: var(--blue); text-align: center; }
.fc-mean { font-size: 30px; line-height: 1.6; }
.fc-unit { font-size: 32px; color: var(--ink-3); text-align: center; }
.fc-note { font-size: 28px; line-height: 1.7; color: var(--ink-2); background: #f1f5fd; padding: 8px 22px 10px; border-radius: 12px; border-inline-start: 6px solid var(--green); max-width: 1180px; }

/* ── scene: animated experiment ── */
.scene { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sc-svg { width: 1180px; max-width: 100%; height: auto; display: block; direction: ltr; }
.sc-svg .wire path { fill: none; stroke: #6b7280; stroke-width: 5; stroke-linejoin: round; }
.sc-svg .coil path { fill: none; stroke-linecap: round; }
.sc-svg .coil.back path { stroke: #e6bb8b; stroke-width: 7; }
.sc-svg .coil.front path { stroke: #b8702a; stroke-width: 9; }
.sc-svg .mag rect { stroke: rgba(0, 0, 0, .22); stroke-width: 2; }
.sc-svg .pole-n { fill: var(--red); }
.sc-svg .pole-s { fill: var(--blue); }
.sc-svg .mag text { fill: #fff; font: 700 38px var(--f-text); }
.sc-svg .mv { opacity: 0; }
.sc-svg .mv path { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.sc-svg .galvo rect { fill: #f4f5f7; stroke: var(--ink); stroke-width: 4; }
.sc-svg .dial { fill: none; stroke: var(--ink-3); stroke-width: 3; }
.sc-svg .scale line { stroke: var(--ink-2); stroke-width: 3; }
.sc-svg .g0 { font: 600 22px 'STIX Two Text', serif; fill: var(--ink-2); }
.sc-svg .gname { font: 700 22px 'STIX Two Text', serif; fill: var(--ink-3); }
.sc-svg .needle { transform-box: view-box; transform-origin: 1120px 458px; }
.sc-svg .needle line { stroke: var(--red); stroke-width: 5; stroke-linecap: round; }
.sc-svg .pivot { fill: var(--ink); }
.sc-svg .cur { opacity: 0; }
.sc-svg .cur path { fill: none; stroke: var(--green); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.sc-svg .ipole { opacity: 0; }
.sc-svg .ipole circle { fill: #fff; stroke-width: 4; }
.sc-svg .ip-n circle { stroke: var(--red); } .sc-svg .ip-s circle { stroke: var(--blue); }
.sc-svg .ipole text { font: 700 28px var(--f-text); }
.sc-svg .ip-n text { fill: var(--red); } .sc-svg .ip-s text { fill: var(--blue); }
.sc-svg .sc-lab { font: 600 26px var(--f-text); fill: var(--ink-3); }
.sc-svg .lab-mag { transition: opacity .3s; }
.scene:is([data-kind="in"], [data-kind="hold"], [data-kind="fast"]) .lab-mag { opacity: 0; }
.scene[data-kind="in"] .mag, .scene[data-kind="hold"] .mag, .scene[data-kind="fast"] .mag { transform: translateX(360px); }
.scene.play[data-kind="in"] .mag { animation: magIn 1.6s ease-in-out both; }
.scene.play[data-kind="fast"] .mag { animation: magIn .55s ease-in both; }
.scene.play[data-kind="out"] .mag { animation: magOut 1.6s ease-in-out both; }
.scene.play[data-kind="in"] .needle { animation: ndR 2s ease-out both; }
.scene.play[data-kind="fast"] .needle { animation: ndRF 1.25s ease-out both; }
.scene.play[data-kind="out"] .needle { animation: ndL 2s ease-out both; }
.scene.play[data-kind="in"] :is(.cur-a, .ip-n, .mv-in) { animation: flash 2s ease-out both; }
.scene.play[data-kind="fast"] :is(.cur-a, .ip-n, .mv-in) { animation: flash 1.25s ease-out both; }
.scene.play[data-kind="out"] :is(.cur-b, .ip-s, .mv-out) { animation: flash 2s ease-out both; }
@keyframes magIn { from { transform: translateX(0); } to { transform: translateX(360px); } }
@keyframes magOut { from { transform: translateX(360px); } to { transform: translateX(0); } }
@keyframes ndR { 0% { transform: rotate(0); } 15% { transform: rotate(30deg); } 75% { transform: rotate(28deg); } 100% { transform: rotate(0); } }
@keyframes ndRF { 0% { transform: rotate(0); } 18% { transform: rotate(56deg); } 44% { transform: rotate(54deg); } 100% { transform: rotate(0); } }
@keyframes ndL { 0% { transform: rotate(0); } 15% { transform: rotate(-30deg); } 75% { transform: rotate(-28deg); } 100% { transform: rotate(0); } }
@keyframes flash { 0% { opacity: 0; } 12% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
.sc-bar { display: flex; align-items: center; gap: 20px; width: 100%; max-width: 1340px; }
.sc-caps { flex: 1; min-width: 0; min-height: 70px; display: flex; align-items: center; }
.sc-cap { display: none; align-items: center; gap: 16px; font-size: 31px; line-height: 1.55; }
.sc-cap.cur { display: flex; animation: capIn .4s ease-out; }
.sc-k { flex: none; width: 50px; height: 50px; border-radius: 50%; background: var(--orange); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-family: var(--f-hand); font-size: 26px; }
.sc-replay { flex: none; display: inline-flex; align-items: center; gap: 10px; height: 60px; padding: 0 22px; border-radius: 14px; border: 3px solid rgba(29, 36, 51, .16); background: #fff; color: var(--ink); font: 600 26px var(--f-text); cursor: pointer; }
.sc-replay svg { width: 28px; height: 28px; }
.sc-replay:hover { border-color: var(--ink); }
@keyframes capIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.slide.static .scene, .slide.static .scene * { animation: none !important; }
.slide.static .sc-replay { display: none; }
