/* ───────── مِقَصّ — stationery / notebook aesthetic ───────── */
:root {
  --paper: #F4EEE2;
  --paper-2: #EAE2D1;
  --card: #FBF8F1;
  --ink: #1C2541;
  --ink-2: #3A4466;
  --mute: #6E6A60;
  --line: #D8CDB8;
  --hl: #FFD23F;
  --cut: #E4572E;
  --ok: #2F8F5B;
  --warn: #B7791F;
  --t1: #3D6FB6; --t2: #D9603B; --t3: #3E9B6A; --t4: #8A5CC2; --t5: #D99A2B; --t6: #2A9D9C; --t7: #C2507A;
  --display: "Reem Kufi", "IBM Plex Sans Arabic", serif;
  --body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --r: 14px;
  --shadow: 0 1px 0 rgba(28,37,65,.06), 0 10px 30px -12px rgba(28,37,65,.25);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--body); color: var(--ink); background: var(--paper);
  font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: clip;
}
/* paper grain */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .28 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
svg { width: 1.15em; height: 1.15em; flex: none; }
svg.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
.muted { color: var(--mute); }
[hidden] { display: none !important; }

/* ───────── Top bar ───────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 48px); position: relative; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px;
  background: var(--ink); color: var(--hl); transform: rotate(-6deg); transition: transform .3s;
}
.brand:hover .brand-mark { transform: rotate(6deg); }
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -.5px; }
.topnav { display: flex; gap: 24px; }
.topnav a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 15px; background: linear-gradient(var(--hl), var(--hl)) no-repeat 0 88% / 0 35%; transition: background-size .25s; }
.topnav a:hover { background-size: 100% 35%; }
body[data-stage="review"] .topnav { display: none; }

/* ───────── Stages ───────── */
.stage { display: none; flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 48px) 60px; }
body[data-stage="upload"] .stage-upload,
body[data-stage="loading"] .stage-upload,
body[data-stage="review"] .stage-review { display: block; }

/* ───────── Hero ───────── */
.hero {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 72px);
  align-items: center; min-height: min(640px, calc(100vh - 90px)); padding: 24px 0 40px;
}
.eyebrow {
  display: inline-block; margin: 0 0 18px; padding: 4px 12px; border: 1.5px solid var(--ink);
  border-radius: 99px; font-size: 13px; font-weight: 600; letter-spacing: .2px;
}
h1 {
  font-family: var(--display); font-weight: 700; margin: 0 0 22px;
  font-size: clamp(44px, 6.4vw, 84px); line-height: 1.12; letter-spacing: -1px;
}
.hl { position: relative; white-space: nowrap; z-index: 0; }
.hl::after {
  content: ""; position: absolute; inset: 52% -6px 6% -6px; background: var(--hl); z-index: -1;
  border-radius: 3px 8px 4px 10px; transform: skew(-8deg) scaleX(0); transform-origin: right;
  animation: marker .7s .75s cubic-bezier(.6,0,.2,1) forwards;
}
@keyframes marker { to { transform: skew(-8deg) scaleX(1); } }
.lede { font-size: clamp(17px, 1.5vw, 19px); color: var(--ink-2); max-width: 520px; margin: 0 0 28px; }
.badges { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.badges li { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); }
.badges svg { color: var(--cut); }

.reveal { opacity: 0; transform: translateY(14px); animation: rise .7s calc(var(--d) * 110ms + 80ms) cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ───────── Drop zone (stack of paper) ───────── */
.drop-wrap { position: relative; }
.drop { display: block; position: relative; aspect-ratio: 4 / 4.3; max-height: 560px; cursor: pointer; outline: none; }
.drop-sheet {
  position: absolute; inset: 0; border-radius: 6px; background: var(--card);
  box-shadow: var(--shadow); border: 1px solid var(--line); transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
.drop-sheet.s3 { transform: rotate(4.5deg) translate(-10px, 6px); background: var(--paper-2); }
.drop-sheet.s2 { transform: rotate(-3deg) translate(8px, 4px); background: #F1EADB; }
.drop-sheet.s1 {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px;
  background-color: var(--card);
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, rgba(61,111,182,.13) 31px 32px),
                    linear-gradient(to left, transparent 56px, rgba(228,87,46,.35) 56px 57.5px, transparent 57.5px);
  background-position: 0 18px, 0 0;
}
.drop:hover .s1, .drop:focus-visible .s1, .drop.over .s1 { transform: translateY(-6px) rotate(-.6deg); }
.drop:hover .s3, .drop.over .s3 { transform: rotate(7deg) translate(-18px, 10px); }
.drop:hover .s2, .drop.over .s2 { transform: rotate(-5deg) translate(14px, 6px); }
.drop:focus-visible .s1 { outline: 3px solid var(--hl); outline-offset: 4px; }
.drop.over .s1 { box-shadow: 0 0 0 3px var(--ink), var(--shadow); }

.cutline { position: absolute; left: 18px; right: 18px; top: 38%; height: 0; border-top: 2px dashed rgba(28,37,65,.28); }
.cut-scissor {
  position: absolute; top: -13px; right: -4px; width: 26px; height: 26px; display: grid; place-items: center;
  background: var(--card); color: var(--cut); transform: rotate(-90deg);
}
.cut-scissor svg { width: 22px; height: 22px; }
.drop:hover .cut-scissor { animation: snipAcross 2.2s cubic-bezier(.5,0,.5,1) infinite; }
@keyframes snipAcross { 0% { right: -4px; } 100% { right: calc(100% - 22px); } }

.drop-idle, .drop-busy { display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; z-index: 1; background: var(--card); padding: 18px 22px; border-radius: 12px; }
.drop-icon {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: var(--hl); color: var(--ink); margin-bottom: 6px; box-shadow: 0 6px 0 -1px var(--ink);
  transition: transform .25s;
}
.drop:hover .drop-icon { transform: translateY(-4px); }
.drop-icon svg { width: 28px; height: 28px; }
.drop-idle strong { font-family: var(--display); font-size: 26px; font-weight: 600; }
.drop-idle u { text-decoration-color: var(--cut); text-decoration-thickness: 2px; text-underline-offset: 4px; color: var(--ink); }
.drop-busy { display: none; width: min(340px, 90%); }
body[data-stage="loading"] .drop-idle { display: none; }
body[data-stage="loading"] .drop-busy { display: flex; }
body[data-stage="loading"] .drop { cursor: progress; }
.busy-title { font-family: var(--display); font-size: 22px; font-weight: 600; }
.meter { width: 100%; height: 10px; border-radius: 99px; background: var(--paper-2); overflow: hidden; border: 1px solid var(--line); }
.meter span { display: block; height: 100%; width: 0; background: repeating-linear-gradient(-45deg, var(--ink) 0 8px, var(--ink-2) 8px 16px); transition: width .2s; border-radius: 99px; }
.drop-error { color: var(--cut); font-weight: 600; text-align: center; min-height: 1.6em; margin: 22px 0 0; }

/* ───────── How / FAQ ───────── */
.section-title { font-family: var(--display); font-size: clamp(28px, 3vw, 38px); margin: 0 0 28px; font-weight: 700; }
.how { padding: 56px 0 24px; border-top: 2px solid var(--ink); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps li { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; position: relative; box-shadow: var(--shadow); }
.steps li:nth-child(2) { transform: translateY(18px); }
.steps li:nth-child(3) { transform: translateY(36px); }
.step-n {
  position: absolute; top: -18px; left: 20px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--hl); font-family: var(--display); font-size: 22px; font-weight: 700;
}
.steps h3 { font-family: var(--display); font-size: 24px; margin: 0 0 6px; }
.steps p { margin: 0; color: var(--ink-2); font-size: 15px; }
.faq { padding: 84px 0 10px; max-width: 760px; }
.faq details { border-bottom: 1.5px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; list-style: none; padding: 14px 0; font-weight: 600; font-size: 17px; display: flex; justify-content: space-between; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--display); font-size: 26px; color: var(--cut); transition: transform .25s; line-height: 1; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 16px; color: var(--ink-2); }

/* ───────── Buttons & form bits ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none;
  border: 1.5px solid var(--ink); background: transparent; padding: 10px 18px; border-radius: 10px; font-weight: 600;
  transition: transform .15s, box-shadow .15s, background .15s; white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--ink); color: var(--paper); box-shadow: 0 4px 0 var(--cut); }
.btn.primary svg { color: var(--hl); }
.btn.primary:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--cut); }
.btn.primary:not(:disabled):active { transform: translateY(2px); box-shadow: 0 1px 0 var(--cut); }
.btn.ghost:hover { background: rgba(28,37,65,.06); }
.btn.ink { background: var(--hl); border-color: var(--ink); }
.btn.ink:not(:disabled):hover { box-shadow: 0 3px 0 var(--ink); transform: translateY(-1px); }
.btn.small { padding: 7px 12px; font-size: 14px; border-radius: 8px; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { border-color: var(--ink); }
input[type=text], input[type=number], select {
  border: 1.5px solid var(--line); background: var(--card); border-radius: 9px; padding: 8px 10px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(255,210,63,.55); }

/* ───────── Review header ───────── */
.review-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 10px 0 18px; }
.book-meta { display: flex; align-items: center; gap: 14px; min-width: 0; }
.book-ico { width: 52px; height: 64px; border-radius: 4px 10px 10px 4px; background: var(--ink); color: var(--hl); display: grid; place-items: center; box-shadow: inset -6px 0 0 rgba(255,255,255,.12), var(--shadow); flex: none; }
.book-ico svg { width: 24px; height: 24px; }
.book-meta h2 { font-family: var(--display); font-size: clamp(20px, 2.4vw, 28px); margin: 0; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.book-meta p { margin: 2px 0 0; font-size: 14px; }
.head-actions { display: flex; gap: 10px; }
.head-actions .btn.primary { padding: 12px 22px; font-size: 16px; }

.notice { display: none; padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-size: 15px; border: 1.5px solid; }
.notice.show { display: block; animation: rise .4s ease forwards; }
.notice.ok { background: #E9F3EA; border-color: #BCD9C2; color: #234D33; }
.notice.warn { background: #FBF0D9; border-color: #EBCF95; color: #6B4A12; }
.notice b { font-family: var(--display); font-size: 17px; }

/* ───────── Book strip ───────── */
.strip-wrap { margin-bottom: 14px; }
.strip { display: flex; height: 46px; border-radius: 8px; overflow: hidden; border: 1.5px solid var(--ink); background: var(--paper-2); box-shadow: 0 4px 0 rgba(28,37,65,.12); }
.seg-b {
  position: relative; border: 0; padding: 0; cursor: pointer; min-width: 4px; background: var(--c); color: #fff;
  border-left: 1px dashed rgba(255,255,255,.65); transition: filter .15s, flex-grow .3s; overflow: hidden;
  font-family: var(--display); font-size: 13px; font-weight: 600;
}
.seg-b:last-child { border-left: 0; }
.seg-b:hover { filter: brightness(1.08) saturate(1.1); }
.seg-b.sel { box-shadow: inset 0 0 0 3px var(--hl), inset 0 0 0 5px var(--ink); }
.seg-b span { position: absolute; inset: 0; display: grid; place-items: center; white-space: nowrap; }
.seg-b.k-intro { --c: #B9AE98; }
.seg-b.k-unit { background: repeating-linear-gradient(-45deg, var(--c) 0 6px, color-mix(in srgb, var(--c) 82%, #000) 6px 12px); }
.strip-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--mute); margin-top: 6px; padding: 0 2px; }

/* ───────── Advanced options ───────── */
.advanced { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 20px; }
.advanced summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-weight: 600; font-size: 15px; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced .chev { margin-inline-start: auto; transform: rotate(90deg); transition: transform .2s; }
.advanced[open] .chev { transform: rotate(-90deg); }
.adv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px 22px; padding: 4px 16px 18px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.seg, .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label, .chips label { cursor: pointer; }
.seg input, .chips input { position: absolute; opacity: 0; pointer-events: none; }
.seg span, .chips span { display: inline-block; padding: 6px 12px; border-radius: 99px; border: 1.5px solid var(--line); font-size: 14px; background: var(--paper); transition: .15s; }
.seg input:checked + span, .chips input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.seg input:focus-visible + span, .chips input:focus-visible + span { box-shadow: 0 0 0 3px var(--hl); }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; }
.toggle span { width: 40px; height: 22px; border-radius: 99px; background: var(--line); position: relative; transition: .2s; flex: none; }
.toggle span::after { content: ""; position: absolute; top: 3px; right: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.toggle input:checked + span { background: var(--ok); }
.toggle input:checked + span::after { right: 21px; }
.toggle input:focus-visible + span { box-shadow: 0 0 0 3px var(--hl); }

/* ───────── Workspace ───────── */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.lessons { list-style: none; margin: 0; padding: 0; }
.lesson {
  --c: var(--t1);
  position: relative; display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 4px 14px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 12px 12px;
  margin-bottom: 10px; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.lessons.anim .lesson { opacity: 0; animation: rise .45s calc(var(--i) * 35ms) ease forwards; }
.lesson::before { content: ""; position: absolute; right: -1px; top: 10px; bottom: 10px; width: 6px; border-radius: 6px 0 0 6px; background: var(--c); }
.lesson:hover { border-color: #BFB29A; }
.lesson.sel { border-color: var(--ink); box-shadow: 0 0 0 1.5px var(--ink), 0 8px 24px -12px rgba(28,37,65,.4); }
.lesson .num { grid-row: span 2; font-family: var(--display); font-size: 26px; font-weight: 700; color: var(--c); text-align: center; line-height: 1; }
.lesson .title {
  width: 100%; border: 1.5px solid transparent; background: transparent; padding: 4px 8px; font-weight: 600; font-size: 16px; border-radius: 8px;
}
.lesson .title:hover { border-color: var(--line); }
.lesson .title:focus { background: #fff; }
.lesson .meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 8px; font-size: 13.5px; color: var(--mute); }
.lesson .kind-tag { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
.lesson .bad { color: var(--cut); font-weight: 600; }
.lesson .side { grid-row: span 2; display: flex; align-items: center; gap: 6px; }
.stepper { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 9px; background: var(--paper); overflow: hidden; }
.stepper button { border: 0; background: none; width: 28px; height: 32px; cursor: pointer; font-size: 18px; color: var(--ink-2); }
.stepper button:hover { background: var(--paper-2); }
.stepper input { width: 48px; border: 0; border-radius: 0; text-align: center; padding: 4px 0; background: transparent; -moz-appearance: textfield; font-weight: 600; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper input:focus { box-shadow: none; background: #fff; }
.del { border: 0; background: none; color: var(--mute); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.del:hover { color: var(--cut); background: rgba(228,87,46,.1); }
.lesson.unit { background: color-mix(in srgb, var(--c) 7%, var(--card)); }
.lesson.unit .title { font-weight: 700; font-size: 17px; }
.lesson.intro { --c: #9A8F78; }
.lesson.intro .title { color: var(--mute); }
.cut-sep { display: flex; align-items: center; gap: 8px; margin: -4px 0 6px; height: 0; }

.add-row {
  width: 100%; padding: 14px; border: 2px dashed var(--line); border-radius: 12px; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; color: var(--ink-2); transition: .15s;
}
.add-row:hover { border-color: var(--ink); color: var(--ink); background: rgba(255,210,63,.18); }

/* viewer */
.viewer { position: sticky; top: 16px; }
.viewer-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.viewer-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.viewer-tag { font-size: 13.5px; font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pager { display: flex; align-items: center; gap: 6px; flex: none; }
.pg { font-size: 14px; color: var(--mute); display: flex; align-items: center; gap: 4px; }
.pg input { width: 54px; padding: 4px; text-align: center; font-weight: 600; color: var(--ink); }
.canvas-box { position: relative; background: var(--paper-2); border-radius: 8px; min-height: 300px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); }
.canvas-box canvas { display: block; width: 100%; height: auto; max-height: 62vh; object-fit: contain; }
.canvas-hint { position: absolute; top: 10px; right: 10px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--hl); color: var(--ink); display: none; box-shadow: 0 2px 0 var(--ink); }
.canvas-hint.show { display: block; }
.viewer-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.viewer-actions .btn { flex: 1; }

/* ───────── Overlay ───────── */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(28,37,65,.45); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.overlay-card { background: var(--card); border-radius: 18px; padding: 34px 30px 28px; width: min(440px, 100%); text-align: center; box-shadow: 0 30px 60px -20px rgba(0,0,0,.4); border: 1.5px solid var(--ink); }
.overlay-card h3 { font-family: var(--display); font-size: 28px; margin: 18px 0 4px; }
.cut-anim { position: relative; height: 40px; margin: 0 10px; }
.cut-anim .dash { position: absolute; left: 0; right: 0; top: 50%; border-top: 2.5px dashed var(--line); }
.cut-anim .dash::after { content: ""; position: absolute; right: 0; top: -2.5px; height: 2.5px; width: var(--p, 0%); background: var(--ink); transition: width .25s; }
.cut-anim .snip { position: absolute; top: 50%; right: var(--p, 0%); transform: translate(50%, -50%) rotate(-90deg); color: var(--cut); transition: right .25s; background: var(--card); padding: 2px; }
.cut-anim .snip svg { width: 32px; height: 32px; animation: chomp .35s ease-in-out infinite alternate; }
@keyframes chomp { to { transform: scaleX(.75); } }
.ov-done { display: none; gap: 10px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.overlay.done .ov-done { display: flex; }
.overlay.done .snip svg { animation: none; }
.overlay.done .snip { color: var(--ok); }

/* ───────── Footer ───────── */
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 22px clamp(18px, 4vw, 48px); border-top: 1px solid var(--line); font-size: 14px; }
.foot span { display: flex; align-items: center; gap: 6px; }

/* ───────── Responsive ───────── */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 8px; }
  .drop { aspect-ratio: auto; height: 380px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .viewer { position: static; order: -1; }
  .canvas-box canvas { max-height: 46vh; width: auto; max-width: 100%; }
}
@media (max-width: 640px) {
  .topnav { display: none; }
  .steps { grid-template-columns: 1fr; gap: 30px; }
  .steps li:nth-child(n) { transform: none; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .lesson { grid-template-columns: 38px minmax(0, 1fr); padding-left: 10px; }
  .lesson .num { font-size: 20px; }
  .lesson .num { grid-row: 1 / span 3; grid-column: 1; }
  .lesson .title { grid-row: 1; grid-column: 2; }
  .lesson .meta { grid-row: 2; grid-column: 2; }
  .lesson .side { grid-row: 3; grid-column: 2; justify-content: flex-start; padding: 6px 8px 0; }
  .strip { height: 36px; }
  .seg-b span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition: none !important; }
  .reveal, .lesson { opacity: 1; transform: none; }
  .hl::after { transform: skew(-8deg); }
}

/* ───────── SEO content sections ───────── */
.noscript { margin: 0; padding: 12px 20px; background: var(--hl); text-align: center; font-weight: 600; }
.who { padding: 96px 0 10px; }
.who-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.who-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; position: relative; overflow: hidden; }
.who-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--c, var(--t1)); }
.who-card:nth-child(2) { --c: var(--t2); }
.who-card:nth-child(3) { --c: var(--t3); }
.who-card h3 { font-family: var(--display); font-size: 22px; margin: 4px 0 8px; }
.who-card p { margin: 0; color: var(--ink-2); font-size: 15px; }
.why { margin-top: 28px; padding: 22px 26px; border-inline-start: 4px solid var(--hl); background: rgba(255,210,63,.12); border-radius: 0 var(--r) var(--r) 0; max-width: 900px; }
.why h3 { font-family: var(--display); font-size: 22px; margin: 0 0 8px; }
.why p { margin: 0; color: var(--ink-2); }
@media (max-width: 860px) { .who-grid { grid-template-columns: 1fr; } }
