/* Amiri (Naskh), SIL OFL 1.1, self-hosted. Used only for the textbook-page scene. */
@font-face { font-family: 'Amiri'; font-style: normal; font-weight: 400; font-display: swap; src: url(../shared/fonts/amiri-arabic-400-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: 'Amiri'; font-style: normal; font-weight: 700; font-display: swap; src: url(../shared/fonts/amiri-arabic-700-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }

/* MARK FUEL · Paper Mark v3 — the emblem as a stage.
   Navy is the night the logo lives in; paper is where you study. The page moves between the two.
   Only identity colours (navy, sky, paper) and the app's faces (Cairo, Inter). */
:root {
  --navy: #0B2E59; --navy2: #1B4B80; --stage: #061A33; --stage2: #0A2547; --sky: #378AE6; --sky2: #72B9ED; --sky3: #9ED4F5; --ice: #B5DDF4;
  --cream: #FCF9F2; --paper: #FFFDF8; --paper2: #F3EEE3; --marker: #FDE68A;
  --page: #F7F8FB; --page2: #EEF3F9; --panel: #FFFFFF;
  --text: #0B2E59; --body: #2E4361; --muted: #5B6B80; --line: #DCE5F0; --line2: #C6D3E3;
  --on-dark: #FCF9F2; --on-dark2: #B9CBE2; --on-dark3: #8FA8C6; --dark-line: rgba(181,221,244,.18);
  --link: #1D63B8; --focus: #1D63B8;
  --btn: #0B2E59; --btn-ink: #FFFFFF; --btn-hover: #1B4B80;
  --ink-outline: #0B2E59;
  --r-again: #E11D48; --r-hard: #B45309; --r-good: #1D63B8; --r-easy: #047857;
  --r-again-l: #E11D48; --r-hard-l: #D97706; --r-good-l: #378AE6; --r-easy-l: #059669;
  --shadow-paper: 0 1px 0 rgba(11,46,89,.06), 0 24px 48px -22px rgba(11,46,89,.38);
  --shadow-float: 0 2px 0 rgba(11,46,89,.05), 0 40px 80px -30px rgba(6,26,51,.55);
  --emblem-navy-a: #1b4b80; --emblem-navy-b: #0b2e59; --emblem-stroke: #0b2e59;
  --f-ar: "Cairo", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --f-en: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --nav-h: 68px; --gut: max(24px, calc((100% - 1320px) / 2));
  --ease-fuel: cubic-bezier(.16,1,.3,1); --ease-spark: cubic-bezier(.2,.9,.3,1.3);
  color-scheme: light; font-family: var(--f-ar);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --page: #08121F; --page2: #0B1A2C; --panel: #0E1C30; --text: #E6EDF7; --body: #C6D3E3; --muted: #A6B8CE; --line: #22374F; --line2: #2E4A6B;
  --link: #9ED4F5; --focus: #9ED4F5; --btn: #378AE6; --btn-ink: #06182E; --btn-hover: #72B9ED; --ink-outline: #72B9ED;
  --r-again: #FB7185; --r-hard: #FBBF24; --r-good: #6AAEF0; --r-easy: #34D399; --r-again-l: #FB7185; --r-hard-l: #FBBF24; --r-good-l: #6AAEF0; --r-easy-l: #34D399;
  --shadow-paper: 0 24px 48px -20px rgba(0,0,0,.7); --shadow-float: 0 40px 80px -30px rgba(0,0,0,.8); --stage: #040F1E; --stage2: #071A33; color-scheme: dark; } }
:root[data-theme="dark"] {
  --page: #08121F; --page2: #0B1A2C; --panel: #0E1C30; --text: #E6EDF7; --body: #C6D3E3; --muted: #A6B8CE; --line: #22374F; --line2: #2E4A6B;
  --link: #9ED4F5; --focus: #9ED4F5; --btn: #378AE6; --btn-ink: #06182E; --btn-hover: #72B9ED; --ink-outline: #72B9ED;
  --r-again: #FB7185; --r-hard: #FBBF24; --r-good: #6AAEF0; --r-easy: #34D399; --r-again-l: #FB7185; --r-hard-l: #FBBF24; --r-good-l: #6AAEF0; --r-easy-l: #34D399;
  --shadow-paper: 0 24px 48px -20px rgba(0,0,0,.7); --shadow-float: 0 40px 80px -30px rgba(0,0,0,.8); --stage: #040F1E; --stage2: #071A33; color-scheme: dark;
}
html[lang="en"] { font-family: var(--f-en); }
body { background: var(--page); color: var(--body); font-size: 1.0625rem; line-height: 1.85; }
html[lang="en"] body { line-height: 1.6; }
h1, h2, h3 { color: var(--text); font-weight: 800; text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: var(--link); text-underline-offset: 3px; }
.num { font-family: var(--f-en); font-variant-numeric: tabular-nums; }
kbd { font: 600 11px/1 var(--f-en); padding: 3px 5px; border-radius: 5px; border: 1px solid var(--line2); color: var(--muted); }
@media (hover: none) { kbd { display: none; } }
section { position: relative; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.nb { white-space: nowrap; }

.ink-rule { display: flex; flex-direction: column; gap: 5px; margin-bottom: 26px; }
.ink-rule b { display: block; height: 5px; border-radius: 5px; }
.ink-rule b:nth-child(1) { width: 56px; background: var(--text); } .ink-rule b:nth-child(2) { width: 34px; background: var(--sky); } .ink-rule b:nth-child(3) { width: 20px; background: var(--sky2); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 14px; font-weight: 800; font-size: 1rem; text-decoration: none; border: 2px solid transparent; cursor: pointer; font-family: inherit;
  transition: background-color .2s, color .2s, transform .2s var(--ease-fuel), box-shadow .2s, border-color .2s; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-ink { background: var(--btn); color: var(--btn-ink); }
.btn-ink:hover { background: var(--btn-hover); }
.btn-line { background: transparent; color: var(--text); border-color: var(--line2); }
.btn-line:hover { border-color: var(--text); }
.btn-xl { min-height: 60px; padding: 0 30px; font-size: 1.12rem; border-radius: 18px; }
.btn kbd { color: inherit; border-color: color-mix(in srgb, currentColor 45%, transparent); }
.btn-paper { background: var(--paper); color: #0B2E59; box-shadow: 0 0 0 1px rgba(255,255,255,.4) inset, 0 18px 40px -14px rgba(114,185,237,.55); }
.btn-paper:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255,255,255,.4) inset, 0 24px 50px -14px rgba(114,185,237,.75); }
.btn-paper svg { width: 20px; height: 20px; fill: var(--sky); flex: none; }
.btn-ghost { color: var(--on-dark); border-color: rgba(252,249,242,.32); background: transparent; }
.btn-ghost:hover { border-color: var(--on-dark); }

/* ---------- Header: navy over navy scenes, paper elsewhere ---------- */
.hd { position: sticky; top: 0; z-index: 60; background: color-mix(in srgb, var(--page) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); transition: background-color .35s, border-color .35s; }
.hd-in { width: min(1320px, 100% - 48px); margin-inline: auto; height: var(--nav-h); display: flex; align-items: center; gap: 20px; }
.wm { display: grid; text-decoration: none; line-height: 1; flex: none; }
.wm-word { font: 900 22px/1 var(--f-en); letter-spacing: .01em; color: var(--text); }
.wm-word b { color: var(--sky); font-weight: 900; }
.wm-motto { font: 800 8.5px/1 var(--f-en); letter-spacing: .22em; color: var(--sky); margin-top: 5px; }
.hd-nav { display: flex; gap: 2px; margin-inline-start: 18px; }
.hd-nav a { text-decoration: none; color: var(--body); font-weight: 600; font-size: .97rem; padding: 8px 12px; border-radius: 10px; transition: color .2s, background-color .2s; }
.hd-nav a:hover { color: var(--text); background: var(--page2); }
.hd-tools { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.hd-lang { border: 1px solid var(--line2); background: transparent; border-radius: 999px; min-height: 36px; padding: 0 14px; font: 700 13px/1 var(--f-en); color: var(--text); cursor: pointer; }
html[lang="en"] .hd-lang { font-family: var(--f-ar); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--page2); border: 1px solid var(--line); }
.seg button { width: 32px; height: 30px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.seg svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(11,46,89,.18); }
.hd-login { color: var(--text); font-weight: 700; text-decoration: none; padding: 8px 10px; }
.hd-cta { min-height: 40px; padding: 0 18px; border-radius: 12px; background: var(--btn); color: var(--btn-ink); }
.hd-burger { display: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line2); background: transparent; color: var(--text); place-items: center; }
.hd-burger svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.hd-menu { display: grid; padding: 6px 24px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--page); }
.hd-menu a { padding: 14px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); font-weight: 600; }
.hd.is-dark { background: color-mix(in srgb, var(--stage) 88%, transparent); border-color: var(--dark-line); }
.hd.is-dark .wm-word, .hd.is-dark .hd-login, .hd.is-dark .hd-lang, .hd.is-dark .hd-burger { color: var(--on-dark); }
.hd.is-dark .hd-nav a { color: var(--on-dark2); }
.hd.is-dark .hd-nav a:hover { color: var(--on-dark); background: rgba(255,255,255,.06); }
.hd.is-dark .hd-lang, .hd.is-dark .hd-burger { border-color: var(--dark-line); }
.hd.is-dark .seg { background: rgba(255,255,255,.06); border-color: var(--dark-line); }
.hd.is-dark .seg button { color: var(--on-dark3); }
.hd.is-dark .seg button[aria-pressed="true"] { background: rgba(255,255,255,.14); color: var(--on-dark); box-shadow: none; }
.hd.is-dark .hd-cta { background: var(--paper); color: #0B2E59; }
.hd.is-dark .wm-motto { color: var(--sky2); }
@media (max-width: 960px) { .hd-nav, .hd-login { display: none; } .hd-burger { display: grid; } }
@media (max-width: 560px) { .hd-in { width: calc(100% - 28px); gap: 10px; } .seg { display: none; } .wm-word { font-size: 19px; } .wm-motto { font-size: 7.4px; letter-spacing: .18em; } .hd-tools { gap: 6px; } .hd-cta { padding: 0 14px; } .hd-lang { padding: 0 11px; } }
@media (max-width: 359px) { .wm-motto { display: none; } .hd-lang { display: none; } }
@media (min-width: 961px) { .hd-menu { display: none !important; } }

/* =================== 1 · The mark =================== */
.op { background: var(--stage); }
.op-stage { position: relative; overflow: hidden; isolation: isolate; color: var(--on-dark2);
  background: radial-gradient(90% 80% at 72% 46%, #12417A 0%, var(--navy) 38%, var(--stage) 100%); }
html[dir="ltr"] .op-stage { background: radial-gradient(90% 80% at 28% 46%, #12417A 0%, var(--navy) 38%, var(--stage) 100%); }
:root[data-theme="dark"] .op-stage { background: radial-gradient(90% 80% at 72% 46%, #0E3566 0%, #0A2547 38%, var(--stage) 100%); }
.op-sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.op-glow { position: absolute; width: 70vmin; height: 70vmin; inset-inline-end: 14%; top: 50%; translate: 0 -50%; border-radius: 50%; background: radial-gradient(closest-side, rgba(114,185,237,.32), rgba(55,138,230,.08) 60%, transparent); filter: blur(10px); }
html[dir="rtl"] .op-glow { inset-inline-end: auto; left: 14%; }
.op-rules { position: absolute; inset: 0; width: 100%; height: 100%; color: #9ED4F5; opacity: .11; -webkit-mask-image: radial-gradient(80% 70% at 50% 50%, #000 30%, transparent 85%); mask-image: radial-gradient(80% 70% at 50% 50%, #000 30%, transparent 85%); }
.op-orbit { position: absolute; inset: 0; width: 100%; height: 100%; }
html[dir="rtl"] .op-orbit { transform: scaleX(-1); }
.op-orbit .oo { stroke-dasharray: 1 1; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: no-preference) { .js .op-orbit .oo { animation: ooDraw 2.2s var(--ease-fuel) .5s both; } }
@keyframes ooDraw { from { stroke-dashoffset: 1; } }

.op-copy { position: relative; z-index: 3; }
.op-kicker { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: .98rem; color: var(--sky3); }
.op-kicker::before { content: ""; width: 28px; height: 3px; border-radius: 3px; background: var(--sky); }
.op h1 { margin-top: 18px; color: var(--on-dark); font-weight: 900; font-size: clamp(2.6rem, .9rem + 4.6vw, 5.7rem); line-height: 1.24; letter-spacing: -.005em; }
html[lang="en"] .op h1 { font-weight: 900; line-height: 1.0; letter-spacing: -.045em; font-size: clamp(2.7rem, .9rem + 4.8vw, 6rem); }
.op-lead { margin-top: 24px; max-width: 46ch; font-size: clamp(1.05rem, .95rem + .3vw, 1.22rem); line-height: 1.9; color: var(--on-dark2); }
html[lang="en"] .op-lead { line-height: 1.6; }
.op-cta { margin-top: 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; }
.op-more { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; color: var(--on-dark2); font-weight: 700; text-decoration: none; border-bottom: 1px solid var(--dark-line); }
.op-more svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease-fuel); }
.op-more:hover { color: var(--on-dark); border-color: var(--sky2); } .op-more:hover svg { transform: translateY(3px); }
.op-price-old { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--on-dark2); padding-inline-start: 22px; border-inline-start: 1px solid var(--dark-line); font-size: .9rem; line-height: 1.35; font-weight: 600; }
.op-price b { font: 900 2.1rem/1 var(--f-en); color: var(--on-dark); letter-spacing: -.02em; }
.op-price:hover b { color: var(--sky2); }

.op-mark { margin: 0; position: relative; z-index: 2; }
.emblem { width: 100%; height: auto; overflow: visible; display: block; }
.emblem .s-navy-a { stop-color: var(--emblem-navy-a); } .emblem .s-navy-b { stop-color: var(--emblem-navy-b); }
.op .emblem .e-back-face { stroke: #72B9ED; stroke-opacity: .55; }
.emblem .e-back, .emblem .e-front, .emblem .e-book, .emblem .e-star, .emblem .e-cell { transform-box: fill-box; transform-origin: 50% 100%; }
.emblem .e-star { transform-origin: center; }
.emblem .e-orbit-back, .emblem .e-orbit-front { stroke-dasharray: 1 1; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: no-preference) {
  .js .op-mark .e-book { animation: eBook .65s var(--ease-fuel) .08s both; }
  .js .op-mark .e-back { animation: eRise .8s var(--ease-fuel) .4s both; }
  .js .op-mark .e-front { animation: eRise .85s var(--ease-fuel) .6s both; }
  .js .op-mark .e-orbit-back { animation: eDraw .45s linear 1.05s both; }
  .js .op-mark .e-orbit-front { animation: eDraw .42s linear 1.5s both; }
  .js .op-mark .e-star { animation: eStar .5s var(--ease-fuel) 1.9s both; }
  .js .op-fan .fan { animation: fanIn .9s var(--ease-fuel) both; }
  .js .op-fan .f1 { animation-delay: .9s; } .js .op-fan .f2 { animation-delay: 1.05s; } .js .op-fan .f3 { animation-delay: 1.2s; }
}
.op-mark.played .e-book, .op-mark.played .e-back, .op-mark.played .e-front, .op-mark.played .e-orbit-back, .op-mark.played .e-orbit-front, .op-mark.played .e-star, .op-fan.played .fan { animation: none !important; }
@keyframes eBook { from { opacity: 0; transform: translateY(16px) scaleY(.12) scaleX(.86); } }
@keyframes eRise { from { opacity: 0; transform: translateY(115px) scale(.84); } }
@keyframes eDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes eStar { 0% { opacity: 0; transform: scale(.1) rotate(-22deg); } 75% { opacity: 1; transform: scale(1.08) rotate(3deg); } }
@keyframes fanIn { from { opacity: 0; transform: translateY(60px) rotate(0deg) scale(.9); } }

/* real cards fanned behind the emblem: depth, not decoration */
.op-fan { position: absolute; z-index: 1; pointer-events: none; }
.fan { position: absolute; width: 38%; aspect-ratio: 1.55; padding: 16px 18px 12px; border-radius: 16px; background: #fff; border: 1px solid #D9E5EF; color: #0B2E59; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 34px 60px -26px rgba(0,0,0,.65); display: grid; align-content: center; justify-items: center; gap: 8px; direction: rtl; text-align: center; }
.fan-wm { position: absolute; inset: -30%; transform: rotate(-12deg); opacity: .05; font: 800 11px/17px var(--f-ar); color: #0B1120; white-space: pre; overflow: hidden; pointer-events: none; }
.fan-k { position: relative; font: 700 10.5px/1.2 var(--f-ar); color: #94A3B8; }
.fan p { position: relative; font: 600 clamp(.78rem, .5rem + .5vw, 1rem)/1.75 var(--f-ar); }
.f1 { top: 4%; left: -3%; transform: rotate(-13deg); }
.f2 { top: -10%; right: 2%; transform: rotate(9deg) scale(.9); opacity: .96; }
.f3 { bottom: 12%; right: -5%; transform: rotate(-5deg) scale(.82); opacity: .9; }
.f1, .f2, .f3 { transform-origin: 50% 80%; }

.op-facts { position: relative; z-index: 3; display: flex; flex-wrap: wrap; gap: 0; margin: 0; border-top: 1px solid var(--dark-line); }
.op-facts > div { flex: 1 1 160px; padding: 14px 0 0; padding-inline-end: 22px; }
.op-facts dt { font-size: .82rem; color: var(--on-dark3); font-weight: 600; }
.op-facts dd { margin: 2px 0 0; color: var(--on-dark); font-weight: 700; font-size: .98rem; line-height: 1.5; }
.op-hint { display: none; }
.op-say { display: none; }
.pm-morph { display: none; }

/* ---- still mode (reduced motion / weak devices): a composed static storyboard ---- */
.still .op-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px clamp(32px, 5vw, 80px); align-items: center; padding: clamp(48px, 7vw, 110px) var(--gut) 0; }
.still .op-fan { inset: auto; display: none; }
.still .op-facts { grid-column: 1 / -1; margin-bottom: clamp(48px, 6vw, 80px); }
.still .op-study { grid-column: 1 / -1; margin-inline: calc(-1 * var(--gut)); background: var(--page); padding: clamp(56px, 7vw, 100px) var(--gut); }
@media (max-width: 860px) { .still .op-stage { grid-template-columns: minmax(0, 1fr); } .still .op-mark { order: -1; width: min(420px, 100%); justify-self: center; } }

/* ---- scrub mode: one sticky stage, JS writes the transforms ---- */
.scrub .op { height: 250vh; }
.scrub .op-stage { position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h)); height: calc(100svh - var(--nav-h)); }
.scrub .op-copy { position: absolute; top: 46%; inset-inline-start: var(--gut); width: min(620px, 45%); transform: translateY(-50%); }
.scrub .op-mark { position: absolute; top: 47%; inset-inline-end: calc(var(--gut) + 1%); width: min(640px, 44vw, 92svh); transform: translateY(-50%); pointer-events: none; }
.scrub .op-mark .emblem { will-change: transform; transform-origin: 0 0; }
.scrub .op-fan { top: 47%; inset-inline-end: calc(var(--gut) + 1%); width: min(640px, 44vw, 92svh); aspect-ratio: 600 / 450; transform: translateY(-50%); }
.scrub .op-facts { position: absolute; bottom: 26px; inset-inline: var(--gut); width: min(620px, 45%); }
.scrub .op-hint { display: flex; position: absolute; z-index: 3; bottom: 30px; inset-inline-end: var(--gut); align-items: center; gap: 10px; font-size: .86rem; font-weight: 700; color: var(--on-dark3); }
.scrub .op-hint i { width: 2px; height: 34px; background: linear-gradient(var(--sky2), transparent); border-radius: 2px; animation: hint 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes hint { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.scrub .op-day { position: absolute; inset: 0; z-index: 0; background: var(--page); opacity: 0; pointer-events: none; }
.scrub .op-say { display: block; position: absolute; z-index: 4; inset-inline-start: var(--gut); top: 50%; width: calc((100% - 600px) / 2 - var(--gut) - 32px); transform: translateY(-50%); opacity: 0;
  font-size: clamp(1.3rem, .9rem + 1.1vw, 1.9rem); line-height: 1.5; font-weight: 600; color: var(--on-dark2); }
.scrub .op-say b { display: block; color: var(--on-dark); font-weight: 900; }
html[lang="en"].scrub .op-say { line-height: 1.25; }
.pm-morph { position: absolute; z-index: 5; visibility: hidden; opacity: 0; --ear: 0px; box-sizing: border-box; border: 5px solid #0B2E59;
  background: linear-gradient(165deg, var(--paper) 35%, var(--paper2)); box-shadow: var(--shadow-float);
  clip-path: polygon(var(--ear) 0, 100% 0, 100% 100%, 0 100%, 0 var(--ear)); pointer-events: none; contain: layout paint; display: block; }
.pm-morph .pm-ear { opacity: 0; }
.pm-morph-art { position: absolute; inset: 0; width: 100%; height: 100%; }

/* (study screen styles: see "Study screen replica" below) */
.callouts, .callout-text { display: none; transition: opacity .32s var(--ease-fuel); }
@media (min-width: 1240px) {
  .scrub .op-study { justify-content: start; padding-inline-start: calc(var(--gut) + 40px); }
  .scrub .callouts { display: block; position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
  .co-line { fill: none; stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 1 1; stroke-linecap: round; }
  .scrub .callout-text { display: block; list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; pointer-events: none; }
  .callout-text li { position: absolute; width: 220px; display: grid; gap: 2px; font-size: .88rem; line-height: 1.55; color: var(--body); opacity: 0; }
  .callout-text b { color: var(--text); font-size: 1rem; font-weight: 900; }
}
.op-study.is-used .callouts, .op-study.is-used .callout-text { opacity: 0; }

@media (max-width: 1023px) {
  .scrub .op-copy { width: min(560px, 50%); }
  .scrub .op-say { width: auto; inset-inline: var(--gut); top: 28px; transform: none; text-align: center; font-size: 1.2rem; }
  .scrub .op-say br { display: none; } .scrub .op-say b { display: inline; }
}
@media (max-width: 860px) {
  .scrub .op { height: 210vh; }
  .scrub .op-stage { display: flex; flex-direction: column; justify-content: center; gap: clamp(14px, 3svh, 40px); padding: 18px 20px; }
  .scrub .op-copy, .scrub .op-mark { position: relative; top: auto; bottom: auto; inset: auto; transform: none; width: 100%; }
  .scrub .op-mark { width: min(440px, 84vw, 38svh); align-self: center; }
  .scrub .op-fan, .scrub .op-facts, .scrub .op-hint { display: none; }
  .op h1 { font-size: clamp(2.2rem, 1.2rem + 5vw, 3.2rem); margin-top: 10px; }
  html[lang="en"] .op h1 { font-size: clamp(2.3rem, 1.2rem + 5.4vw, 3.4rem); }
  .scrub .op-lead { margin-top: 12px; font-size: 1rem; line-height: 1.7; }
  .scrub .op-cta { margin-top: 18px; gap: 12px 18px; }
  .op-kicker { font-size: .88rem; }
  .scrub .op-study { padding: 10px 16px 14px; align-content: center; }
  .scrub .op-say { font-size: 1.05rem; text-align: start; top: 18px; }
}

/* (book styles: see "From the book, v4" below) */

/* =================== 3 · Timing, on the navy stage =================== */
.ob { background: radial-gradient(100% 80% at 50% 100%, #0E3566 0%, var(--stage) 70%); color: var(--on-dark2); }
.ob-stage { width: min(1320px, 100% - 48px); margin-inline: auto; padding-block: clamp(80px, 9vw, 130px); display: grid; gap: 26px; }
.ob h2 { color: var(--on-dark); }
.ob-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 24px 64px; align-items: end; }
.ob-lead { color: var(--on-dark2); max-width: 46ch; }
.ob-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.ob-opt { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--dark-line); background: rgba(255,255,255,.04); color: var(--on-dark2); font: inherit; font-weight: 800; cursor: pointer; transition: all .25s; }
.ob-opt i { width: 10px; height: 10px; border-radius: 50%; }
.o-hard i { background: #FBBF24; } .o-good i { background: #6AAEF0; } .o-easy i { background: #34D399; }
.ob-opt:hover { border-color: var(--on-dark3); color: var(--on-dark); }
.ob-opt[aria-checked="true"] { background: var(--paper); color: #0B2E59; border-color: var(--paper); }
.ob-fig { margin: 0; position: relative; }
.ob-svg { width: 100%; height: auto; max-height: min(46vh, 480px); overflow: visible; display: block; }
.ob-axis line { stroke: rgba(181,221,244,.22); stroke-width: 1.5; }
.ob-axis .ax-base { stroke: rgba(181,221,244,.45); stroke-width: 2; }
.ob-axis text { fill: var(--on-dark3); font: 600 13px var(--f-ar); }
html[lang="en"] .ob-axis text { font-family: var(--f-en); }
.ob-arcs path { fill: none; stroke: url(#gArc); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 1 1; filter: url(#fGlow); }
.ob-arcs path.ghost { stroke: rgba(181,221,244,.22); stroke-width: 2; stroke-dasharray: 2 8; filter: none; }
.ob-stops g { opacity: 0; transition: opacity .25s; }
.ob-stops rect.dot { fill: var(--paper); stroke: #0B2E59; stroke-width: 2; }
.ob-stops .ob-w { fill: var(--on-dark); font: 800 15px var(--f-ar); }
html[lang="en"] .ob-stops .ob-w { font-family: var(--f-en); font-size: 14px; }
.ob-stops .ob-n { fill: var(--on-dark3); font: 700 12px var(--f-en); }
.ob-traveller rect { fill: var(--paper); stroke: #0B2E59; stroke-width: 2.5; filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); }
.ob-traveller path { stroke: #378AE6; stroke-width: 3; stroke-linecap: round; } .ob-traveller .t2 { stroke: #0B2E59; }
.ob-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--dark-line); }
.ob-big { display: inline-flex; align-items: baseline; gap: 10px; color: var(--on-dark); }
.ob-big b { font: 900 clamp(3rem, 1.6rem + 4vw, 5.4rem)/1 var(--f-en); letter-spacing: -.04em; color: var(--on-dark); }
.ob-big span { font-weight: 800; font-size: 1.2rem; color: var(--sky2); }
.ob-sum-t { color: var(--on-dark2); font-size: 1.02rem; max-width: 52ch; }
.ob-sum-t b { color: var(--on-dark); }
.ob-note { font-size: .86rem; color: var(--on-dark3); }
.scrub .ob { height: 170vh; }
.scrub .ob-stage { position: sticky; top: var(--nav-h); min-height: calc(100svh - var(--nav-h)); padding-block: clamp(24px, 4vh, 56px); align-content: center; gap: 18px; }
@media (max-width: 860px) {
  .ob-head { grid-template-columns: minmax(0, 1fr); }
  .scrub .ob { height: 150vh; } .scrub .ob-lead { display: none; } .ob-pick { margin-top: 4px; }
}
@media (max-width: 699px) { .ob-axis text { font-size: 21px; } .ob-stops .ob-w, html[lang="en"] .ob-stops .ob-w { font-size: 22px; } .ob-stops .ob-n { display: none; } .ob-arcs path { stroke-width: 9; } .ob-stage { width: calc(100% - 32px); } }

/* =================== 4 · Science, typeset =================== */
.sci { background: var(--page); }
.sci-in { width: min(1320px, 100% - 48px); margin-inline: auto; padding-block: clamp(90px, 11vw, 170px); }
.sci h2 { font-size: clamp(2rem, .9rem + 3.6vw, 4.6rem); line-height: 1.5; font-weight: 800; max-width: 22ch; color: var(--text); }
html[lang="en"] .sci h2 { line-height: 1.08; letter-spacing: -.035em; max-width: 20ch; }
.sci sup { font: 800 .34em/1 var(--f-en); vertical-align: super; margin-inline: 3px 0; }
.sci sup a { color: var(--link); text-decoration: none; display: inline-grid; place-items: center; min-width: 1.7em; height: 1.7em; border: 1.5px solid currentColor; border-radius: 999px; }
.sci-foot { margin-top: clamp(40px, 5vw, 72px); display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 32px clamp(32px, 6vw, 100px); align-items: start; }
.sci-limit { color: var(--muted); max-width: 40ch; padding-top: 18px; border-top: 2px solid var(--text); font-weight: 600; }
.refs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line2); }
.refs li { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 2px 18px; padding: 18px 0; border-bottom: 1px solid var(--line2); scroll-margin-top: 100px; }
.ref-n { grid-row: 1 / span 2; font: 900 1.6rem/1 var(--f-en); color: var(--sky); }
.refs p { color: var(--text); font-weight: 700; }
.refs cite { font: 500 .86rem/1.5 var(--f-en); color: var(--muted); font-style: normal; direction: ltr; text-align: start; }
@media (max-width: 860px) { .sci-foot { grid-template-columns: minmax(0, 1fr); } .sci-in { width: calc(100% - 32px); } }

/* =================== 5 · Syllabus ruler =================== */
.sy { background: var(--page2); border-block: 1px solid var(--line); }
.sy-in { width: min(1320px, 100% - 48px); margin-inline: auto; padding-block: clamp(80px, 9vw, 130px); }
.sy-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 20px 64px; align-items: end; }
.sy-big { display: block; font: 900 clamp(4.5rem, 2rem + 8vw, 10rem)/.9 var(--f-en); letter-spacing: -.05em; color: var(--sky); margin-bottom: 6px; }
.sy-lead { max-width: 46ch; }
.ruler { list-style: none; margin: 56px 0 0; padding: 0; display: flex; gap: 10px; }
.ruler .u { flex: calc(var(--b) - var(--a) + 1) 1 0; min-width: 0; }
.u-name { display: block; font-weight: 900; color: var(--text); font-size: 1rem; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 2px solid var(--text); }
.ruler .u ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; }
.ls { --n: calc(var(--b) - var(--a) + 1); flex: var(--n) 1 0; min-width: 0; display: grid; gap: 8px; align-content: start; position: relative; }
.ls-bar { position: relative; display: block; height: 64px; border-radius: 12px; border: 2px solid var(--ink-outline); box-shadow: var(--shadow-paper);
  background: repeating-linear-gradient(90deg, transparent 0 calc(100% / var(--n) - 1px), rgba(11,46,89,.16) calc(100% / var(--n) - 1px) calc(100% / var(--n))), linear-gradient(170deg, var(--paper), var(--paper2)); }
html[dir="rtl"] .ls-bar { background: repeating-linear-gradient(-90deg, transparent 0 calc(100% / var(--n) - 1px), rgba(11,46,89,.16) calc(100% / var(--n) - 1px) calc(100% / var(--n))), linear-gradient(170deg, var(--paper), var(--paper2)); }
.ls-pin { position: absolute; top: 50%; inset-inline-start: calc((var(--p) - var(--a) + .5) / var(--n) * 100%); width: 26px; height: 26px; translate: -50% -50%; color: var(--sky); }
html[dir="rtl"] .ls-pin { translate: 50% -50%; }
.ls-pin svg { width: 100%; height: 100%; fill: currentColor; stroke: #0B2E59; stroke-width: 1.4; }
.ls b { font-size: .95rem; line-height: 1.45; color: var(--text); }
.ls .num { font-size: .84rem; color: var(--muted); font-weight: 700; direction: ltr; unicode-bidi: isolate; justify-self: start; }
.sy-legend { margin-top: 26px; display: flex; align-items: center; gap: 8px; font-size: .92rem; color: var(--muted); }
.sy-legend svg { width: 20px; height: 20px; fill: var(--sky); stroke: #0B2E59; stroke-width: 1.4; flex: none; }
:root[data-theme="dark"] .ls-bar { border-color: #72B9ED; }
@media (max-width: 860px) {
  .sy-head { grid-template-columns: minmax(0, 1fr); } .sy-in { width: calc(100% - 32px); }
  .ruler { flex-direction: column; gap: 28px; } .ruler .u ol { flex-direction: column; gap: 10px; }
  .ls { grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 6px; }
  .ls b { grid-row: 1; } .ls .num { grid-row: 1; align-self: center; }
  .ls-bar { grid-column: 1 / -1; grid-row: 2; height: 34px; border-radius: 9px; width: calc(var(--n) / 25 * 100%); min-width: 64px; }
}

/* =================== 6 · Join: the price card =================== */
.jn { background: var(--page); }
.jn-in { width: min(1320px, 100% - 48px); margin-inline: auto; padding-block: clamp(90px, 10vw, 150px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 7vw, 120px); align-items: start; }
.jn-card-wrap { position: relative; padding: 14px 14px 0; }
.jn-deck { position: absolute; inset: 26px 0 -6px 26px; border-radius: 30px; background: var(--navy); transform: rotate(3deg); box-shadow: var(--shadow-paper); }
html[dir="ltr"] .jn-deck { inset: 26px 26px -6px 0; transform: rotate(-3deg); }
:root[data-theme="dark"] .jn-deck { background: #1B4B80; }
.jn-card { position: relative; --ear: 46px; padding: clamp(28px, 3.4vw, 48px); border-radius: 30px; border: 2px solid #0B2E59; color: #0B2E59;
  background: linear-gradient(165deg, var(--paper) 40%, var(--paper2)); box-shadow: var(--shadow-float); clip-path: polygon(var(--ear) 0, 100% 0, 100% 100%, 0 100%, 0 var(--ear)); transform: rotate(-1.2deg); }
html[dir="ltr"] .jn-card { transform: rotate(1.2deg); }
.jn-card .pm-ear::before { border-radius: 0 0 12px 0; }
.jn-top { display: flex; justify-content: space-between; align-items: center; padding-inline-start: 0; padding-bottom: 16px; border-bottom: 1px dashed rgba(11,46,89,.25); }
html[dir="ltr"] .jn-top { padding-inline-start: 36px; }
html[dir="rtl"] .jn-top { padding-inline-end: 36px; }
.jn-k { font-weight: 900; color: #5B6B80; font-size: .95rem; }
.jn-card .pm-sig { font-size: 13px; }
.jn-price { margin-top: 22px; display: flex; align-items: flex-end; gap: 16px; color: #0B2E59; }
.jn-price .num { font: 900 clamp(4.6rem, 2rem + 6vw, 8.4rem)/.85 var(--f-en); letter-spacing: -.055em; }
.jn-cur { font-size: 1.05rem; font-weight: 800; line-height: 1.4; color: #5B6B80; padding-bottom: 8px; }
.jn-inc { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 10px; }
.jn-inc li { display: flex; gap: 12px; align-items: baseline; font-weight: 700; color: #2E4361; }
.jn-inc li::before { content: ""; flex: none; width: 12px; height: 12px; translate: 0 1px; background: var(--sky); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.jn-cta { width: 100%; margin-top: 30px; background: #0B2E59; color: #fff; }
.jn-cta:hover { background: #1B4B80; }
.jn-fine { margin-top: 14px; font-size: .84rem; line-height: 1.7; color: #5B6B80; }
.jn-side h3 { font-size: 1.5rem; font-weight: 900; }
.jn-steps { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 0; counter-reset: s; }
.jn-steps li { counter-increment: s; position: relative; display: grid; gap: 2px; padding: 0 0 22px; padding-inline-start: 56px; }
.jn-steps li::before { content: counter(s); position: absolute; inset-inline-start: 0; top: 0; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font: 900 15px/1 var(--f-en); background: var(--text); color: var(--page); }
.jn-steps li:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 18px; top: 42px; bottom: 4px; width: 2px; background: var(--line2); }
.jn-steps b { color: var(--text); font-size: 1.05rem; } .jn-steps code { background: var(--page2); padding: 1px 7px; border-radius: 6px; font-weight: 800; color: var(--text); }
.jn-par { margin-top: 40px; }
.parents { margin: 14px 0 0; }
.parents > div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.parents dt { font-weight: 800; color: var(--text); } .parents dd { margin: 2px 0 0; font-size: .97rem; }
@media (max-width: 960px) { .jn-in { grid-template-columns: minmax(0, 1fr); width: calc(100% - 32px); } }

/* =================== 7 · FAQ =================== */
.faq { background: var(--page); border-top: 1px solid var(--line); }
.faq-in { width: min(1320px, 100% - 48px); margin-inline: auto; padding-block: clamp(80px, 9vw, 130px); display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 32px clamp(32px, 6vw, 100px); align-items: start; }
.faq h2 { position: sticky; top: calc(var(--nav-h) + 32px); }
.qa-list details { border-bottom: 1px solid var(--line2); }
.qa-list details:first-child { border-top: 1px solid var(--line2); }
.qa-list summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 0; font-weight: 800; font-size: 1.12rem; color: var(--text); }
.qa-list summary::-webkit-details-marker { display: none; }
.qa-list summary::after { content: ""; flex: none; width: 16px; height: 16px; background: var(--sky); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); transition: transform .35s var(--ease-fuel); }
.qa-list details[open] summary::after { transform: rotate(45deg) scale(1.15); }
.qa-list details p { padding: 0 0 22px; max-width: 62ch; }
@media (max-width: 860px) { .faq-in { grid-template-columns: minmax(0, 1fr); width: calc(100% - 32px); } .faq h2 { position: static; } }

/* =================== 8 · Closing on the navy stage =================== */
.cl { background: radial-gradient(80% 90% at 30% 50%, #12417A 0%, var(--navy) 40%, var(--stage) 100%); overflow: hidden; }
html[dir="rtl"] .cl { background: radial-gradient(80% 90% at 70% 50%, #12417A 0%, var(--navy) 40%, var(--stage) 100%); }
.cl-in { width: min(1320px, 100% - 48px); margin-inline: auto; padding-block: clamp(90px, 10vw, 150px); display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 100px); align-items: center; }
.cl-mark { width: min(560px, 100%); justify-self: center; }
.cl .emblem .e-back-face { stroke: #72B9ED; stroke-opacity: .55; }
.cl h2 { color: var(--on-dark); font-size: clamp(2.3rem, 1.1rem + 3.6vw, 4.6rem); line-height: 1.3; font-weight: 900; }
html[lang="en"] .cl h2 { line-height: 1.02; letter-spacing: -.04em; }
.cl-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.cl-motto { margin-top: 30px; font: 800 clamp(.8rem, .7rem + .4vw, 1rem)/1 var(--f-en); letter-spacing: .32em; color: var(--sky2); }
.scrub .cl-mark .emblem .e-book, .scrub .cl-mark .emblem .e-back, .scrub .cl-mark .emblem .e-front, .scrub .cl-mark .emblem .e-star { opacity: 0; }
.scrub .cl-mark .emblem .e-orbit-back, .scrub .cl-mark .emblem .e-orbit-front { stroke-dashoffset: 1; }
@media (max-width: 860px) { .cl-in { grid-template-columns: minmax(0, 1fr); width: calc(100% - 32px); text-align: center; } .cl-mark { width: min(360px, 84%); } .cl-cta { justify-content: center; } .cl h2 { text-wrap: balance; } }

.ft { background: var(--stage); color: var(--on-dark3); border-top: 1px solid var(--dark-line); }
.ft-in { width: min(1320px, 100% - 48px); margin-inline: auto; padding: 36px 0 18px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.ft .wm-word { color: var(--on-dark); }
.ft p { font-size: .9rem; margin-top: 6px; }
.ft-links { display: flex; flex-wrap: wrap; gap: 6px 20px; } .ft-links a { color: var(--on-dark2); text-decoration: none; font-weight: 600; font-size: .92rem; }
.ft-links a:hover { color: var(--on-dark); }
.ft-base { width: min(1320px, 100% - 48px); margin-inline: auto; padding: 14px 0 28px; font-size: .82rem; border-top: 1px solid var(--dark-line); }
@media (max-width: 860px) { .ft-in, .ft-base { width: calc(100% - 32px); } }
.nw { white-space: nowrap; }
.fan-k .en { font-family: var(--f-en); font-weight: 700; }
:root:not([data-theme="dark"]) .ts.s-new { color: #04664A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ts.s-new { color: var(--r-easy); } }

/* =================== V4 · Hero finish: light, depth, one microinteraction =================== */
.op-mark::after { content: ""; position: absolute; z-index: -1; left: 12%; right: 12%; bottom: 4%; height: 16%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(114,185,237,.42), rgba(55,138,230,.12) 60%, transparent); filter: blur(14px); pointer-events: none; }
.op-stage::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(2,10,22,.55)); }
.scrub .op-stage::after { transition: opacity .3s; }
.btn-paper svg { transition: transform .3s var(--ease-fuel); }
.btn-paper:hover svg { transform: rotate(90deg) scale(1.1); }
.op h1 { text-wrap: balance; }

/* =================== V4 · Study screen replica (sizes and colours measured from the app) =================== */
:root { --app-bg: #FFFFFF; --app-head: #FBF8F1; --app-line: #EEF2F6; --fc-bg: #FFFFFF; --fc-bd: #D9E5EF; --fc-ink: #0B2E59; --wm-op: .045;
  --st-back-bg: #F1F5F9; --st-back-ink: #1E293B; --st-weak-bd: #CBD5E1; --st-weak-ink: #334155;
  --rt1-bg: rgba(255,241,242,.8); --rt1-bd: #FECDD3; --rt1-n: #881337; --rt1-w: #BE123C;
  --rt2-bg: rgba(255,251,235,.8); --rt2-bd: #FDE68A; --rt2-n: #0B2E59; --rt2-w: #BE123C;
  --rt3-bg: rgba(240,249,255,.8); --rt3-bd: #BAE6FD; --rt3-n: #0C4A6E; --rt3-w: #0369A1;
  --rt4-bg: rgba(236,253,245,.8); --rt4-bd: #A7F3D0; --rt4-n: #064E3B; --rt4-w: #047857; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --app-bg: #162334; --app-head: #0F1B2B; --app-line: #23364D; --fc-bg: #132B4A; --fc-bd: #2A4C78; --fc-ink: #E6EDF7; --wm-op: .08;
  --st-back-bg: transparent; --st-back-ink: #E6EDF7; --st-weak-bd: #334155; --st-weak-ink: #E6EDF7;
  --rt1-bg: #432536; --rt1-bd: #9B526C; --rt1-n: #FFD1DC; --rt1-w: #FFD1DC; --rt2-bg: #3B3020; --rt2-bd: #907144; --rt2-n: #FFE0A6; --rt2-w: #FFE0A6;
  --rt3-bg: #163454; --rt3-bd: #4D88BB; --rt3-n: #C5E3FF; --rt3-w: #C5E3FF; --rt4-bg: #143B36; --rt4-bd: #488C7C; --rt4-n: #B9F2DD; --rt4-w: #B9F2DD; } }
:root[data-theme="dark"] { --app-bg: #162334; --app-head: #0F1B2B; --app-line: #23364D; --fc-bg: #132B4A; --fc-bd: #2A4C78; --fc-ink: #E6EDF7; --wm-op: .08;
  --st-back-bg: transparent; --st-back-ink: #E6EDF7; --st-weak-bd: #334155; --st-weak-ink: #E6EDF7;
  --rt1-bg: #432536; --rt1-bd: #9B526C; --rt1-n: #FFD1DC; --rt1-w: #FFD1DC; --rt2-bg: #3B3020; --rt2-bd: #907144; --rt2-n: #FFE0A6; --rt2-w: #FFE0A6;
  --rt3-bg: #163454; --rt3-bd: #4D88BB; --rt3-n: #C5E3FF; --rt3-w: #C5E3FF; --rt4-bg: #143B36; --rt4-bd: #488C7C; --rt4-n: #B9F2DD; --rt4-w: #B9F2DD; }

.op-study { position: relative; z-index: 4; display: grid; justify-content: center; align-content: center; color: var(--body); }
.scrub .op-study { position: absolute; inset: 0; padding: 0 var(--gut); pointer-events: none; }
.scrub .op-study.is-live { pointer-events: auto; }
.app-shot { position: relative; width: min(880px, 100%); border-radius: 26px; background: var(--app-bg); border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 50px 100px -50px rgba(6,26,51,.55), 0 0 0 10px color-mix(in srgb, var(--sky2) 7%, transparent); }
.app-shot::before { content: ""; position: absolute; z-index: -1; inset: -12% -8%; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--sky2) 22%, transparent), transparent); pointer-events: none; }
.app-bar { display: flex; align-items: center; justify-content: space-between; height: 50px; padding: 0 22px; background: var(--app-head); border-bottom: 1px solid var(--app-line); border-radius: 26px 26px 0 0; }
.app-bar .wm-word { font-size: 16px; }
.app-tab { font: 700 12px/1 var(--f-ar); color: #fff; background: #0B2E59; padding: 7px 11px; border-radius: 8px; }
html[lang="en"] .app-tab { font-family: var(--f-en); }
.study { padding: 16px 24px 22px; display: grid; }
.st-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--app-line); }
.st-back { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; background: var(--st-back-bg); color: var(--st-back-ink); font-size: 12.5px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.st-count { display: inline-flex; gap: 22px; font: 800 18px/1 var(--f-en); font-variant-numeric: tabular-nums; }
.c-new { color: #0284C7; } .c-learn { color: #E11D48; } .c-rev { color: #059669; }
.st-weak { min-height: 44px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--st-weak-bd); background: transparent; color: var(--st-weak-ink); font: 700 12px/1.2 var(--f-ar); cursor: pointer; white-space: nowrap; }
html[lang="en"] .st-weak { font-family: var(--f-en); }
.st-weak .w-on { display: none; }
.st-weak[aria-pressed="true"] { background: #378AE6; color: #fff; border-color: #0B2E59; font-weight: 800; }
.st-weak[aria-pressed="true"] .w-off { display: none; } html[lang="ar"] .st-weak[aria-pressed="true"] .ar.w-on, html[lang="en"] .st-weak[aria-pressed="true"] .en.w-on { display: inline; }
.fc { position: relative; perspective: 1200px; padding: 34px 0; }
.fc-flip { position: relative; display: grid; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.fc[data-side="a"] .fc-flip { transform: rotateY(180deg); }
.fc-face { grid-area: 1 / 1; position: relative; overflow: hidden; min-height: 300px; padding: 48px; display: flex; align-items: center; justify-content: center; text-align: center;
  background: var(--fc-bg); border: 1px solid var(--fc-bd); border-radius: 24px; box-shadow: 0 3px 12px rgba(11,46,89,.063); color: var(--fc-ink);
  backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow-wrap: anywhere; }
.fc-q { cursor: pointer; }
.fc-a { transform: rotateY(180deg); }
.fc[data-side="q"] .fc-a, .fc[data-side="a"] .fc-q { pointer-events: none; }
.fc-wm { position: absolute; inset: -40%; transform: rotate(-12deg); opacity: var(--wm-op); font: 800 21.6px/32.4px var(--f-ar); color: #0B1120; white-space: pre; overflow: hidden; pointer-events: none; text-align: start; direction: ltr; }
:root[data-theme="dark"] .fc-wm { color: #0B1120; }
.fc-text, .fc-ans { position: relative; margin: 0; font: 600 22px/1.85 var(--f-ar); color: var(--fc-ink); text-wrap: pretty; }
.fc-ans { background: none; border: 0; padding: 12px; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 10px; text-decoration-color: color-mix(in srgb, var(--fc-ink) 45%, transparent); }
.fc-ans:hover { text-decoration-color: #378AE6; }
.fc-text bdi, .fc-ans bdi { font-family: var(--f-en); }
.st-bottom { padding-top: 16px; border-top: 1px solid var(--app-line); min-height: 79px; display: grid; align-content: start; }
.st-reveal { justify-self: center; width: 208px; min-height: 36px; padding: 8px 20px; border: 0; border-radius: 8px; background: #0B2E59; color: #fff; font: 600 14px/1.4 var(--f-ar); cursor: pointer; transition: background-color .2s; }
html[lang="en"] .st-reveal { font-family: var(--f-en); }
.st-reveal:hover { background: #378AE6; }
.st-rates { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.rt { min-height: 62px; padding: 6px 4px; border-radius: 8px; border: 1px solid; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font: inherit; cursor: pointer; transition: filter .15s; }
.rt:hover { filter: brightness(.97) saturate(1.15); }
.rt-wait { font: 500 10.5px/1.4 var(--f-ar); }
html[lang="en"] .rt-wait { font-family: var(--f-en); }
.rt-name { font: 700 15px/1.3 var(--f-ar); }
html[lang="en"] .rt-name { font-family: var(--f-en); font-size: 14px; }
.rt-again { background: var(--rt1-bg); border-color: var(--rt1-bd); color: var(--rt1-n); } .rt-again .rt-wait { color: var(--rt1-w); }
.rt-hard { background: var(--rt2-bg); border-color: var(--rt2-bd); color: var(--rt2-n); } .rt-hard .rt-wait { color: var(--rt2-w); }
.rt-good { background: var(--rt3-bg); border-color: var(--rt3-bd); color: var(--rt3-n); } .rt-good .rt-wait { color: var(--rt3-w); }
.rt-easy { background: var(--rt4-bg); border-color: var(--rt4-bd); color: var(--rt4-n); } .rt-easy .rt-wait { color: var(--rt4-w); }
.st-rates.is-in { animation: rtIn .2s cubic-bezier(.16,1,.3,1) both; }
@keyframes rtIn { from { opacity: 0; transform: translateY(6px); } }
.fc.is-leaving .fc-flip { opacity: 0; transition: opacity .15s ease-in; }
.st-feedback { width: min(880px, 100%); justify-self: center; margin-top: 14px; min-height: 3.2em; font-size: .95rem; color: var(--body); line-height: 1.65; text-align: center; }
.st-feedback b { color: var(--text); }
.st-feedback .keys { color: var(--muted); }
@media (hover: none), (pointer: coarse) { .st-feedback .keys { display: none; } }
.st-done { padding: 36px 8px 8px; display: grid; gap: 10px; text-align: center; justify-items: center; }
.st-done-title { font-weight: 800; font-size: 1.25rem; color: var(--text); }
.st-done-sub { color: var(--muted); font-size: .92rem; }
.st-done-list { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: .92rem; text-align: start; width: min(620px, 100%); }
.st-done-list li { padding: 8px 12px; border-radius: 10px; background: var(--page2); }
.st-done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.scrub .op-study .st-bar, .scrub .op-study .st-bottom, .scrub .op-study .st-feedback, .scrub .app-bar { opacity: 0; }
.scrub .app-shot { background: transparent; border-color: transparent; box-shadow: none; }
.scrub .app-shot::before { opacity: 0; }
.scrub .fc-flip { opacity: 0; }
.scrub .op-study.is-live .app-shot { background: var(--app-bg); border-color: var(--line); box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 50px 100px -50px rgba(6,26,51,.55), 0 0 0 10px color-mix(in srgb, var(--sky2) 7%, transparent); transition: background-color .3s, box-shadow .3s, border-color .3s; }
.scrub .op-study.is-live .app-shot::before { opacity: 1; transition: opacity .3s; }
/* the morph: the logo's paper card turning into the app's white card */
.pm-morph { position: absolute; z-index: 5; visibility: hidden; opacity: 0; box-sizing: border-box; border: 5px solid #0B2E59; background: var(--fc-bg); box-shadow: var(--shadow-float); pointer-events: none; contain: layout paint; display: block; overflow: hidden; }
.pm-morph::before { content: ""; position: absolute; inset: 0; background: linear-gradient(165deg, var(--paper) 35%, var(--paper2)); opacity: var(--paper-o, 1); }
.pm-morph-art { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (min-width: 1240px) { .scrub .op-study { justify-content: start; padding-inline-start: calc(var(--gut) + 20px); } }
@media (max-width: 860px) {
  .study { padding: 12px 14px 16px; }
  .app-bar { height: 44px; padding: 0 14px; } .app-shot { border-radius: 20px; } .app-bar { border-radius: 20px 20px 0 0; }
  .st-count { gap: 14px; font-size: 17px; }
  .st-back, .st-weak { font-size: 11.5px; padding: 0 9px; }
  .fc { padding: 18px 0; }
  .fc-face { min-height: 230px; padding: 24px 18px; border-radius: 20px; }
  .fc-text, .fc-ans { font-size: 19px; line-height: 1.8; }
  .st-reveal { width: 100%; min-height: 44px; }
  .st-rates { gap: 8px; } .rt { min-height: 56px; } .rt-name { font-size: 14px; } .rt-wait { font-size: 10px; }
  .st-feedback { font-size: .88rem; margin-top: 10px; }
  .scrub .op-study { padding: 10px 14px; }
}
@media (max-width: 380px) { .st-back { display: none; } .st-bar { justify-content: space-between; } .fc-text, .fc-ans { font-size: 17.5px; } }
@media (max-width: 860px) and (max-height: 760px) { .scrub .op-lead { display: none; } .scrub .fc-face { min-height: 190px; } .scrub .app-bar { display: none; } .scrub .fc { padding: 12px 0; } }

/* Answer source dialog, as in the app */
.src-dlg { width: min(860px, calc(100% - 24px)); max-height: calc(100svh - 40px); padding: 0; border: 0; border-radius: 22px; background: var(--app-bg); color: var(--body); box-shadow: 0 40px 120px rgba(0,0,0,.45); overflow: hidden; }
.src-dlg[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; animation: dlgIn .2s cubic-bezier(.16,1,.3,1); }
@keyframes dlgIn { from { opacity: 0; transform: translateY(8px); } }
.src-dlg::backdrop { background: rgba(6,18,33,.55); }
.src-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--app-line); background: var(--app-head); }
.src-head h2 { font-size: 1.12rem; font-weight: 800; } .src-head p { font-size: .82rem; color: var(--muted); }
.src-close { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line2); background: var(--app-bg); color: var(--text); font: 700 .85rem var(--f-ar); cursor: pointer; }
.src-body { overflow: auto; padding: 22px; background: #E7ECF2; }
:root[data-theme="dark"] .src-body { background: #0B1522; }
.src-page { margin: 0 auto; max-width: 620px; min-height: 0; border-radius: 4px; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.src-note { padding: 10px 20px 14px; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--app-line); }

/* =================== V4 · From the book: the textbook's own visual language, in subtle 3D =================== */
.bk { background: linear-gradient(180deg, var(--page) 0%, var(--page2) 100%); }
.bk-stage { width: min(1320px, 100% - 48px); margin-inline: auto; display: grid; grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr); gap: clamp(32px, 4.5vw, 80px); align-items: center; padding-block: clamp(80px, 9vw, 140px); }
.bk h2, .ob h2, .sy h2, .faq h2, .in h2 { font-size: clamp(2rem, 1.1rem + 2.8vw, 3.7rem); line-height: 1.28; font-weight: 900; }
html[lang="en"] .bk h2, html[lang="en"] .ob h2, html[lang="en"] .sy h2, html[lang="en"] .faq h2, html[lang="en"] .in h2 { line-height: 1.04; letter-spacing: -.035em; }
.bk-lead { margin-top: 20px; max-width: 46ch; font-size: 1.08rem; }
.bk-steps { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 4px; border-inline-start: 2px solid var(--line2); }
.bk-steps li { display: flex; align-items: center; gap: 14px; padding: 10px 18px; margin-inline-start: -2px; border-inline-start: 2px solid transparent; color: var(--muted); font-weight: 700; transition: color .3s, border-color .3s; }
.bk-steps li b { font: 900 .9rem/1 var(--f-en); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line2); color: var(--muted); transition: all .3s; }
.bk-steps li.is-on { color: var(--text); border-color: var(--sky); }
.bk-steps li.is-on b { background: var(--text); color: var(--page); border-color: var(--text); }
.bk-note { grid-column: 1 / -1; font-size: .84rem; color: var(--muted); max-width: 90ch; }
.bk-scene { position: relative; perspective: 2600px; padding: 20px 0 80px; }
.bk-table { position: absolute; left: 4%; right: 4%; bottom: 40px; height: 90px; border-radius: 50%; background: radial-gradient(closest-side, rgba(6,26,51,.34), transparent); filter: blur(18px); }
.bk-book { position: relative; transform: rotateX(19deg) rotateZ(-2.2deg) scale(.92); transform-origin: 50% 80%; transform-style: preserve-3d; }
html[dir="ltr"] .bk-book { transform: rotateX(19deg) rotateZ(2.2deg) scale(.92); }
.bk-spread { position: relative; display: grid; grid-template-columns: 1fr 1fr; direction: rtl; border-radius: 6px;
  box-shadow: 0 1px 0 #EAE5DA, 0 3px 0 #E1DACB, 0 5px 0 #D7CFBD, 0 7px 0 #CEC5B1, 0 9px 0 #C4BBA6, 0 40px 60px -26px rgba(6,26,51,.5); }
.bk-spread::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 56px; translate: -50% 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(30,41,59,.10) 38%, rgba(30,41,59,.24) 50%, rgba(30,41,59,.10) 62%, transparent); }
.bk-page { --tb-ink: #1F2937; position: relative; padding: clamp(22px, 2.4vw, 34px) clamp(18px, 2vw, 30px) 54px; min-height: 480px; background: #FFFEFB; color: var(--tb-ink);
  font: 400 clamp(.86rem, .74rem + .32vw, 1.04rem)/2.05 "Amiri", "Times New Roman", serif; direction: rtl; text-align: justify; }
.bk-r { border-radius: 3px 8px 8px 3px; background: linear-gradient(90deg, #EEEAE1 0%, #FFFEFB 9%, #FFFEFB 100%); }
.bk-l { border-radius: 8px 3px 3px 8px; background: linear-gradient(270deg, #EEEAE1 0%, #FFFEFB 9%, #FFFEFB 100%); }
.bk-page::before { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; background: linear-gradient(155deg, rgba(255,255,255,.5), transparent 40%, rgba(15,23,42,.035)); }
.tb-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .5fr); gap: 0 16px; }
.tb-main p { margin: 0 0 .55em; }
.tb-side { border-inline-start: 1.5px dotted #9CA3AF; padding-inline-start: 14px; display: grid; align-content: start; gap: 14px; font-size: .92em; line-height: 1.9; }
.tb-h { margin: .3em 0 .35em; font: 700 1.08em/1.6 "Amiri", "Times New Roman", serif; color: #0E8A3E; }
.tb-h span { font-family: "Times New Roman", serif; font-size: .82em; font-weight: 700; margin-inline-start: 6px; }
.tb-check { margin: 0; text-align: start; }
.tb-check b { color: #D32F2F; font-weight: 700; margin-inline-end: 4px; }
.tb-tick { width: 1.5em; height: 1.5em; vertical-align: -.35em; margin-inline-end: 2px; fill: none; stroke: #16A34A; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.tb-fig { margin: 0; padding: 8px 8px 4px; border: 1px solid #CBD5E1; border-radius: 10px; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.08); }
.tb-fig svg { display: block; width: 100%; height: auto; }
.tb-fig figcaption { font-size: .82em; line-height: 1.6; text-align: center; color: #374151; }
.tb-num { position: absolute; bottom: 16px; font: 400 1rem/1 "Times New Roman", serif; color: #111827; padding: 4px 12px; border: 1.5px solid #E11D48; border-radius: 40% / 60%; }
.bk-r .tb-num { left: 22px; } .bk-l .tb-num { right: 22px; }
.tb-hl { background: none; color: inherit; }
.tb-hl span { background-image: linear-gradient(#FFF176, #FFF176); background-repeat: no-repeat; background-position: 100% 60%; background-size: 100% 88%; box-decoration-break: clone; -webkit-box-decoration-break: clone; padding: 0 2px; }
.tb-ghost { display: block; height: .55em; margin: .75em 0; border-radius: 3px; background: #E5E7EB; }
.tb-ghost.s { width: 72%; } .tb-ghost.m { width: 88%; }
.bk-card { position: absolute; z-index: 3; width: min(420px, 58%); inset-inline-end: 8%; bottom: 0; display: grid; gap: 10px; justify-items: center; transform-origin: 50% 50%; }
.bk-card .fc-face { min-height: 168px; padding: 26px 24px; width: 100%; box-shadow: 0 2px 0 rgba(11,46,89,.04), 0 40px 70px -30px rgba(6,26,51,.55); }
.bk-card .fc-text { font-size: clamp(1rem, .9rem + .4vw, 1.22rem); }
.bk-card-src { font: 700 .8rem/1 var(--f-ar); color: var(--link); background: var(--panel); border: 1px solid var(--line); padding: 7px 12px; border-radius: 999px; box-shadow: 0 6px 14px -8px rgba(11,46,89,.3); }
html[lang="en"] .bk-card-src { font-family: var(--f-en); }
.scrub .bk { height: 170vh; }
.scrub .bk-stage { position: sticky; top: var(--nav-h); min-height: calc(100svh - var(--nav-h)); padding-block: clamp(24px, 4vh, 56px); align-content: center; }
.scrub .tb-hl span { background-size: 0% 88%; }
.scrub .bk-card { opacity: 0; }
@media (max-width: 960px) {
  .bk-stage { grid-template-columns: minmax(0, 1fr); width: calc(100% - 32px); }
  .bk-steps { display: none; }
  .scrub .bk { height: 150vh; }
  .scrub .bk-stage { gap: 10px; }
  .scrub .bk-lead { font-size: .96rem; margin-top: 8px; }
  .bk-page { min-height: 0; padding-bottom: 48px; }
}
@media (max-width: 700px) {
  .bk-l { display: none; } .bk-spread { grid-template-columns: 1fr; } .bk-spread::after { display: none; } .bk-r { border-radius: 8px; background: #FFFEFB; }
  .bk-book { transform: rotateX(14deg) rotateZ(-1.5deg); }
  .bk-page { font-size: .86rem; line-height: 1.95; padding: 18px 16px 46px; }
  .tb-cols { grid-template-columns: minmax(0, 1fr) minmax(0, .56fr); gap: 0 10px; }
  .bk-card { width: 86%; inset-inline-end: 7%; } .bk-card .fc-face { min-height: 130px; padding: 18px 16px; }
  .scrub .bk-note { display: none; }
}

/* =================== V4 · Inside the app =================== */
.in { background: linear-gradient(180deg, var(--page2), var(--page) 30%); }
.in-in { width: min(1320px, 100% - 48px); margin-inline: auto; padding-block: clamp(80px, 9vw, 140px); }
.in-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 20px 64px; align-items: end; }
.in-lead { max-width: 48ch; }
.in-body { margin-top: clamp(36px, 4vw, 60px); display: grid; grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
.in-tabs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; border-inline-start: 2px solid var(--line2); }
.in-tab { width: 100%; display: grid; gap: 4px; text-align: start; padding: 14px 18px; margin-inline-start: -2px; border: 0; border-inline-start: 2px solid transparent; background: transparent; color: var(--muted); font: inherit; cursor: pointer; border-radius: 0 12px 12px 0; transition: background-color .2s, border-color .2s, color .2s; }
html[dir="rtl"] .in-tab { border-radius: 12px 0 0 12px; }
.in-tab b { font-size: 1.12rem; font-weight: 800; color: var(--text); opacity: .72; transition: opacity .2s; }
.in-tab > span { display: none; font-size: .96rem; line-height: 1.75; color: var(--body); }
.in-tab:hover b { opacity: 1; }
.in-tab[aria-pressed="true"] { border-inline-start-color: var(--sky); background: var(--panel); box-shadow: 0 20px 40px -30px rgba(11,46,89,.35); }
.in-tab[aria-pressed="true"] b { opacity: 1; }
.in-tab[aria-pressed="true"] > span { display: block; }
.in-scene { position: relative; height: 420px; }
.ip { position: absolute; top: 50%; left: 50%; width: min(640px, 94%); translate: -50% -50%; background: var(--app-bg); border: 1px solid var(--line); border-radius: 22px; padding: 18px 20px; color: var(--text); font-size: .9rem; line-height: 1.6;
  box-shadow: 0 30px 60px -38px rgba(11,46,89,.45); transition: transform .3s cubic-bezier(.16,1,.3,1), opacity .3s, box-shadow .3s; opacity: 0; pointer-events: none; transform: scale(.94); }
.ip[data-rel="cur"] { opacity: 1; z-index: 3; transform: none; pointer-events: auto; box-shadow: 0 60px 100px -46px rgba(11,46,89,.6), 0 0 0 8px color-mix(in srgb, var(--sky2) 10%, transparent); }
.ip[data-rel="next"] { opacity: .55; z-index: 2; transform: translate(-46px, 26px) rotate(-3deg) scale(.93); pointer-events: auto; cursor: pointer; }
.ip[data-rel="prev"] { opacity: .35; z-index: 1; transform: translate(46px, -24px) rotate(2.5deg) scale(.9); pointer-events: auto; cursor: pointer; }
html[dir="ltr"] .ip[data-rel="next"] { transform: translate(46px, 26px) rotate(3deg) scale(.93); }
html[dir="ltr"] .ip[data-rel="prev"] { transform: translate(-46px, -24px) rotate(-2.5deg) scale(.9); }
.ip-home { padding: 0; overflow: hidden; }
.ip-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--app-head); border-bottom: 1px solid var(--app-line); }
.ip-bar .wm-word { font-size: 13px; }
.ip-chip { font: 700 10.5px/1 var(--f-ar); color: #fff; background: #0B2E59; padding: 6px 9px; border-radius: 7px; }
.ip-hello { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 14px 16px 10px; }
.ip-hello > b { font-size: 1.05rem; font-weight: 800; margin-inline-end: auto; }
.ip-streak { font: 800 12px/1 var(--f-en); color: var(--text); display: inline-flex; gap: 5px; align-items: center; }
.ip-live { font-size: 11px; font-weight: 700; color: #047857; background: #ECFDF5; border: 1px solid #A7F3D0; padding: 2px 8px; border-radius: 999px; }
.ip-daily { margin: 4px 14px 12px; padding: 20px 18px; border-radius: 16px; background: linear-gradient(135deg, #1B4B80, #0B2E59); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ip-daily > div:first-child { display: grid; } .ip-daily b { font-size: 1.35rem; font-weight: 900; } .ip-daily span { font-size: .74rem; color: #B9CBE2; }
.ip-c { display: inline-flex; gap: 14px; font: 800 1.25rem/1 var(--f-en); } .ip-c .c-new { color: #7DD3FC; } .ip-c .c-learn { color: #FDA4AF; } .ip-c .c-rev { color: #6EE7B7; }
.ip-short { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 14px 12px; }
.ip-short > span { padding: 10px; border: 1px solid var(--line); border-radius: 12px; font-size: .74rem; font-weight: 800; line-height: 1.4; }
.ip-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 10px 14px 14px; border-top: 1px solid var(--app-line); text-align: center; }
.ip-stats span { display: block; font-size: .72rem; color: var(--muted); } .ip-stats b { font: 900 1.3rem/1.2 var(--f-en); color: var(--text); }
.ip-t { font-weight: 800; font-size: .95rem; margin-bottom: 8px; } .ip-t2 { margin-top: 12px; }
.ip-list { list-style: none; margin: 0; padding: 0; }
.ip-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--app-line); font-size: .78rem; }
.ip-list li > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ip-list b { flex: none; font-size: .72rem; font-weight: 800; }
.st-rv { color: #047857; } .st-lr { color: #E11D48; } .st-nw { color: #0284C7; }
:root[data-theme="dark"] .st-rv { color: #34D399; } :root[data-theme="dark"] .st-lr { color: #FB7185; } :root[data-theme="dark"] .st-nw { color: #7DD3FC; }
.ip-weak-btn { display: inline-block; margin-top: 10px; font-size: .74rem; font-weight: 800; color: #fff; background: #378AE6; border: 1px solid #0B2E59; padding: 6px 10px; border-radius: 8px; }
.ip-lvl { display: grid; gap: 4px; margin-top: 8px; font-size: .76rem; font-weight: 700; }
.ip-lvl i { display: block; height: 7px; border-radius: 7px; background: linear-gradient(90deg, #059669 0 var(--a), #F59E0B var(--a) calc(var(--a) + var(--b)), var(--line) calc(var(--a) + var(--b))); }
html[dir="rtl"] .ip-lvl i { background: linear-gradient(270deg, #059669 0 var(--a), #F59E0B var(--a) calc(var(--a) + var(--b)), var(--line) calc(var(--a) + var(--b))); }
.ip-check { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ip-check li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: .8rem; font-weight: 700; }
.ip-check li.on { border-color: var(--text); }
.ip-check i { flex: none; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--line2); }
.ip-check li.on i { background: var(--text); border-color: var(--text); box-shadow: inset 0 0 0 3px var(--app-bg); }
.ip-goal { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--app-line); font-size: .8rem; font-weight: 700; }
.ip-goal b { font: 900 1.2rem/1 var(--f-en); }
.ip-note { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--page2); font-size: .78rem; }
.ip-note b { font-size: .86rem; }
.ip-lb { margin-top: 10px; } .ip-lb ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ip-lb li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 8px; font-size: .78rem; }
.ip-lb li.me { background: color-mix(in srgb, var(--sky) 12%, transparent); font-weight: 800; }
.ip-lb li b { font-weight: 900; color: var(--sky); } .ip-lb li i { font-style: normal; color: var(--muted); }
.ip-freeze { margin-top: 10px; font-size: .76rem; font-weight: 800; padding: 8px 10px; border: 1px dashed var(--line2); border-radius: 10px; text-align: center; }
.in-note { margin-top: 70px; font-size: .84rem; color: var(--muted); }
@media (max-width: 960px) {
  .in-in { width: calc(100% - 32px); } .in-head, .in-body { grid-template-columns: minmax(0, 1fr); }
  .in-tabs { display: flex; gap: 8px; border: 0; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
  .in-tabs li { flex: none; scroll-snap-align: start; }
  .in-tab { border: 1px solid var(--line2); border-radius: 999px !important; padding: 10px 16px; margin: 0; min-height: 44px; }
  .in-tab b { font-size: .92rem; white-space: nowrap; }
  .in-tab > span, .in-tab[aria-pressed="true"] > span { display: none; }
  .in-tab[aria-pressed="true"] { background: var(--text); border-color: var(--text); } .in-tab[aria-pressed="true"] b { color: var(--page); }
  .in-desc { display: block; font-size: .98rem; line-height: 1.8; margin-top: 4px; min-height: 5.4em; }
  .in-scene { height: auto; display: grid; }
  .ip { position: relative; top: auto; left: auto; translate: none; width: 100%; display: none; }
  .ip[data-rel="cur"] { display: block; box-shadow: 0 30px 60px -38px rgba(11,46,89,.45); }
  .in-note { margin-top: 24px; }
}
@media (min-width: 961px) { .in-desc { display: none; } }

@media (max-width: 560px) {
  .scrub .op-study { padding: 8px 8px; }
  .app-shot { border-radius: 18px; box-shadow: 0 30px 60px -40px rgba(6,26,51,.5); }
  .study { padding: 10px 10px 14px; }
  .st-bar { gap: 6px; }
  .st-count { gap: 10px; font-size: 16px; }
  .st-back, .st-weak { font-size: 11px; padding: 0 8px; min-height: 40px; }
  .st-rates { gap: 6px; } .rt-name { font-size: 13.5px; }
}
.src-page .tb-hl span { background-size: 100% 88% !important; animation: hlIn .6s .15s cubic-bezier(.16,1,.3,1) both; }
@keyframes hlIn { from { background-size: 0% 88%; } }
@media (prefers-reduced-motion: reduce) { .src-page .tb-hl span { animation: none; } }
.fc-wm div::before, .fan-wm div::before { content: attr(data-t); }

/* Amiri is fetched only when the textbook scene is near (JS adds .tb-font), so it never competes with the hero. */
html:not(.tb-font) .bk-page, html:not(.tb-font) .tb-h { font-family: "Times New Roman", serif; }
.tb-svgt { font-family: "Times New Roman", serif; }
html.tb-font .tb-svgt { font-family: "Amiri", serif; }

/* ---------- V5: the platform's study screen in a browser frame ---------- */
.study-real { position: relative; padding: 0 !important; display: block; }
#studyFrame { display: block; width: 100%; height: 560px; border: 0; border-radius: 0 0 26px 26px; background: #FCF9F2; color-scheme: normal; }
html[data-theme="dark"] #studyFrame { background: #101A28; }
.fc-ghost { position: absolute; pointer-events: none; visibility: hidden; }
.app-bar { justify-content: space-between; gap: 12px; }
.ab-dots { display: inline-flex; gap: 7px; } .ab-dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--app-line); }
.ab-ghost { visibility: hidden; }
.ab-url { flex: 0 1 340px; text-align: center; padding: 6px 14px; border-radius: 999px; background: var(--app-bg); border: 1px solid var(--app-line); font: 600 12.5px/1 var(--f-en); color: var(--muted); }
.pm-morph { clip-path: polygon(var(--ear, 0px) 0, 100% 0, 100% 100%, 0 100%, 0 var(--ear, 0px)); }
.pm-morph::before { background: linear-gradient(165deg, #FFFDF8 35%, #F3EEE3) !important; opacity: 1 !important; }
html[data-theme="dark"] .pm-morph::before { background: linear-gradient(165deg, #173156, #11284A) !important; }
.st-feedback { text-align: center; }
@media (max-width: 860px) { #studyFrame { border-radius: 0 0 20px 20px; } .ab-dots { display: none; } .ab-url { flex: 1; } }
.app-shot { width: min(880px, calc(100vw - 2 * var(--gut, 16px))); }
@media (max-width: 860px) { .app-shot { width: calc(100vw - 2 * var(--gut, 16px)); } }

/* ---------- V5 showcase: the real screens in a phone ---------- */
.in-scene { height: 660px; perspective: 1800px; }
.ph { position: absolute; top: 50%; left: 50%; margin: 0; width: 300px; aspect-ratio: 585 / 1266; translate: -50% -50%; padding: 11px; border-radius: 48px;
  background: linear-gradient(150deg, #2A3B52, #0E1A2B 55%, #22344B); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.14), inset 0 0 0 6px #0A1322, 0 50px 80px -40px rgba(6,26,51,.55), 0 18px 30px -18px rgba(6,26,51,.35);
  transition: transform .3s cubic-bezier(.16,1,.3,1), opacity .3s; opacity: 0; pointer-events: none; transform: scale(.94); border: 0; color: inherit; }
.ph::before { content: ""; position: absolute; z-index: 2; top: 20px; left: 50%; width: 86px; height: 24px; translate: -50% 0; border-radius: 14px; background: #05080E; }
.ph-body { position: relative; height: 100%; border-radius: 38px; overflow: hidden; background: #fff; }
.ph-body img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.ph-d { display: none; } html[data-theme="dark"] .ph-l { display: none; } html[data-theme="dark"] .ph-d { display: block; }
.ph[data-rel="cur"] { opacity: 1; z-index: 3; transform: none; pointer-events: auto; }
.ph[data-rel="next"] { opacity: .5; z-index: 2; transform: translateX(-190px) translateZ(-160px) rotateY(18deg) scale(.86); pointer-events: auto; cursor: pointer; }
.ph[data-rel="prev"] { opacity: .5; z-index: 1; transform: translateX(190px) translateZ(-160px) rotateY(-18deg) scale(.86); pointer-events: auto; cursor: pointer; }
html[dir="ltr"] .ph[data-rel="next"] { transform: translateX(190px) translateZ(-160px) rotateY(-18deg) scale(.86); }
html[dir="ltr"] .ph[data-rel="prev"] { transform: translateX(-190px) translateZ(-160px) rotateY(18deg) scale(.86); }
.ph[data-rel="cur"] .ph-body::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, rgba(255,255,255,.16), transparent 32%); }
.ph-floor { position: absolute; left: 50%; bottom: 18px; width: 340px; height: 40px; translate: -50% 0; border-radius: 50%; background: radial-gradient(closest-side, rgba(6,26,51,.28), transparent); filter: blur(4px); z-index: 0; }
@media (max-width: 960px) {
  .in-scene { height: auto; display: grid; justify-items: center; perspective: none; padding-block: 8px 20px; }
  .ph { position: relative; top: auto; left: auto; translate: none; display: none; width: min(280px, 76vw); }
  .ph[data-rel="cur"] { display: block; }
  .ph-floor { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ph { transition: opacity .2s; } }
.in-scene .ph, .in-scene .ph[data-rel] { padding: 11px; background: linear-gradient(150deg, #2A3B52, #0E1A2B 55%, #22344B); border: 0;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.14), inset 0 0 0 6px #0A1322, 0 50px 80px -40px rgba(6,26,51,.55), 0 18px 30px -18px rgba(6,26,51,.35); }
html[data-theme="dark"] .in-scene .ph { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.2), inset 0 0 0 6px #0A1322, 0 50px 90px -40px rgba(0,0,0,.8), 0 0 0 1px rgba(114,185,237,.12); }
.ph-body { padding-top: 34px; background: #FBF8F1; }
html[data-theme="dark"] .ph-body { background: #101A28; }
.ph-body img { top: 34px; height: calc(100% - 34px); }
.ph-body::before { content: "9:41"; position: absolute; top: 11px; inset-inline-end: 26px; font: 700 12px/1 var(--f-en); color: #0B2E59; direction: ltr; }
html[data-theme="dark"] .ph-body::before { color: #E6EDF7; }
.ph::before { top: 19px; width: 80px; height: 22px; }

/* ---------- V5 plans: three plans from the app, no decorative star ---------- */
.jn-in { align-items: start; }
.jn-h { font-size: clamp(2rem, 1.2rem + 2.4vw, 3.4rem); line-height: 1.25; font-weight: 900; color: var(--text); }
.jn-lead { margin-top: 14px; max-width: 54ch; color: var(--body); line-height: 1.85; }
.jn-list { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 12px; }
.jn-plan { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 20px 24px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 1px 0 rgba(11,46,89,.04), 0 18px 40px -32px rgba(11,46,89,.35); }
.jp-name { display: grid; gap: 2px; } .jp-name b { font-size: 1.2rem; font-weight: 900; color: var(--text); } .jp-name > span { font-size: .9rem; color: var(--muted); }
.jp-price { display: flex; align-items: baseline; gap: 10px; color: var(--text); }
.jp-price .num { font: 900 clamp(2rem, 1.4rem + 1.6vw, 2.8rem)/1 var(--f-en); letter-spacing: -.03em; }
.jp-price > span:last-child { font-size: .88rem; font-weight: 700; color: var(--muted); }
.jn-plan-season { grid-template-columns: 1fr; border-color: color-mix(in srgb, var(--sky) 45%, var(--line)); }
.jp-var > span { font-size: .92rem !important; line-height: 1.8; font-weight: 600 !important; color: var(--body) !important; }
.jn-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.jn-actions .btn { flex: 1 1 220px; justify-content: center; }
.jn-cta { width: auto; margin-top: 0; }
html[data-theme="dark"] .jn-cta { background: var(--sky); }
@media (max-width: 860px) { .jn-in { grid-template-columns: 1fr; } .jn-plan { padding: 16px 18px; } }

/* ---------- V5 textbook: real pages, a leaf that turns on the spine, contact shadow, curved light ---------- */
.b3-scene { position: relative; overflow: clip; overflow-clip-margin: 12px; border-radius: 4px; padding: 64px 0 90px; perspective: 2400px; perspective-origin: 50% 30%; }
.b3-cam { position: relative; transform-origin: 70% 13%; }
.b3-book { --open: 1; position: relative; display: grid; grid-template-columns: 1fr 1fr; direction: ltr; transform-style: preserve-3d; transform: rotateX(20deg) rotateZ(-1.5deg); transform-origin: 50% 60%; }
.b3-half, .b3-face { position: relative; aspect-ratio: 3 / 4; background: #fff; overflow: hidden; }
.b3-half img, .b3-face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.b3-left { grid-column: 1; border-radius: 6px 2px 2px 6px;
  box-shadow: -1px 1px 0 #ECE8DF, -2px 2px 0 #E2DDD2, -3px 3px 0 #D8D2C5, -4px 4px 0 #CEC7B8, -5px 5px 0 #C5BDAD, -7px 7px 0 #20344F, 0 30px 50px -24px rgba(6,26,51,.45); }
.b3-leaf { grid-column: 1; grid-row: 1; position: relative; transform-origin: 100% 50%; transform-style: preserve-3d; transform: rotateY(180deg); z-index: 2; }
.b3-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.b3-front { border-radius: 8px 3px 3px 8px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.b3-back { transform: rotateY(180deg); border-radius: 2px 6px 6px 2px;
  box-shadow: 1px 1px 0 #ECE8DF, 2px 2px 0 #E2DDD2, 3px 3px 0 #D8D2C5, 4px 4px 0 #CEC7B8, 5px 5px 0 #C5BDAD, 7px 7px 0 #20344F; overflow: visible; }
.b3-back img { border-radius: inherit; }
/* light: the paper curves down into the gutter and catches a soft band of light just off it */
.b3-curve { position: absolute; inset: 0; pointer-events: none; opacity: var(--open); }
.b3-left .b3-curve { background: linear-gradient(270deg, rgba(20,30,45,.30) 0%, rgba(20,30,45,.12) 3.5%, rgba(255,255,255,.22) 7%, rgba(255,255,255,0) 14%, rgba(0,0,0,0) 88%, rgba(20,30,45,.07) 100%), linear-gradient(180deg, rgba(255,255,255,.10), rgba(0,0,0,.04)); }
.b3-back .b3-curve { background: linear-gradient(90deg, rgba(20,30,45,.30) 0%, rgba(20,30,45,.12) 3.5%, rgba(255,255,255,.22) 7%, rgba(255,255,255,0) 14%, rgba(0,0,0,0) 88%, rgba(20,30,45,.07) 100%), linear-gradient(180deg, rgba(255,255,255,.12), rgba(0,0,0,.03)); }
.b3-gloss { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(120deg, rgba(255,255,255,.28), rgba(255,255,255,0) 38%), linear-gradient(90deg, rgba(0,0,0,0) 92%, rgba(0,0,0,.18)); }
.b3-hl { position: absolute; background: rgba(255, 222, 0, .38); mix-blend-mode: multiply; transform-origin: 100% 50%; transform: scaleX(1); border-radius: 2px; }
.b3-floor { position: absolute; left: -4%; right: -4%; bottom: -46px; height: 70px; border-radius: 50%; background: radial-gradient(closest-side, rgba(6,26,51,.32), rgba(6,26,51,.12) 60%, transparent); transform: translateZ(-2px); filter: blur(6px); pointer-events: none; }
html[data-theme="dark"] .b3-floor { background: radial-gradient(closest-side, rgba(0,0,0,.7), transparent); }
html[data-theme="dark"] .b3-half img, html[data-theme="dark"] .b3-face img { filter: brightness(.92); }
/* the card that lifts off the page: the platform's card face (study-card.css values) */
.b3-card { position: absolute; z-index: 5; width: min(440px, 62%); inset-inline-end: 4%; bottom: 0; display: grid; gap: 12px; justify-items: center; transform-origin: 50% 50%; }
.b3-deck { position: absolute; inset: 0 0 46px; border-radius: 22px; background: linear-gradient(165deg, #1B4B80, #0B2E59); transform: rotate(2.6deg) translate(-8px, -5px); }
.b3-cf { --ear: 46px; position: relative; width: 100%; min-height: 210px; display: flex; flex-direction: column; gap: 14px; padding: 26px 30px 20px; border: 2px solid #0B2E59; border-radius: 22px; color: #0B2E59; text-align: start; direction: rtl;
  clip-path: polygon(var(--ear) 0, 100% 0, 100% 100%, 0 100%, 0 var(--ear)); background: linear-gradient(165deg, #FFFDF8 35%, #F3EEE3); filter: drop-shadow(0 10px 16px rgb(11 46 89 / .12)); }
.b3-ear { position: absolute; top: 0; left: 0; width: var(--ear); height: var(--ear); background: #0B2E59; clip-path: polygon(0 100%, 100% 0, 100% 100%); display: grid; place-items: end; padding: 7px; }
.b3-ear svg { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 2; }
.b3-meta { padding-left: 42px; font: 800 12px/1.4 'Cairo', sans-serif; }
.b3-q { margin: 0; font: 700 clamp(17px, 1rem + .5vw, 22px)/1.8 'Cairo', sans-serif; }
.b3-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; }
.b3-rule { display: grid; gap: 5px; } .b3-rule b { display: block; height: 4px; border-radius: 4px; width: 46px; background: #0B2E59; } .b3-rule b + b { width: 28px; background: #378AE6; }
.b3-wm { font: 900 12px/1 'Inter', sans-serif; letter-spacing: .08em; } .b3-wm i { font-style: normal; color: #378AE6; }
html[data-theme="dark"] .b3-cf { background: linear-gradient(165deg, #173156, #11284A); border-color: #72B9ED; color: #F2F6FC; }
html[data-theme="dark"] .b3-rule b:first-child { background: #F2F6FC; }
.scrub .b3-card { opacity: 0; }
.b3-scene .bk-card-src { position: relative; }
@media (max-width: 700px) {
  .b3-scene { padding: 10px 0 70px; }
  .b3-card { width: 88%; inset-inline-end: 6%; } .b3-cf { --ear: 36px; min-height: 150px; padding: 18px 18px 14px; } .b3-meta { padding-left: 32px; }
}
@media (prefers-reduced-motion: reduce) { .b3-cam, .b3-leaf { transition: none; } }

.bk-copy { position: relative; z-index: 2; }
@media (max-width: 960px) { .b3-scene { overflow-clip-margin: 0; margin-top: 8px; } }
/* V5: the English nav is wider, so the header switches to the menu button earlier and tightens on small phones */
@media (max-width: 1120px) { .hd-nav, .hd-login { display: none; } .hd-burger { display: grid; } }
@media (max-width: 420px) { .hd-in { gap: 6px; } .hd-tools { gap: 4px; } .hd-cta { padding: 0 12px; } .hd-lang { padding: 0 9px; } .wm-word { font-size: 18px; } }

/* V5.1: the real colour cover on the front board, with a hinge groove and board edge */
.b3-front { border-radius: 10px 3px 3px 10px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.b3-front img { object-position: 50% 50%; }
.b3-front .b3-gloss { background:
  linear-gradient(90deg, rgba(0,0,0,0) 89%, rgba(0,0,0,.16) 91.5%, rgba(255,255,255,.14) 93%, rgba(0,0,0,.22) 100%),
  linear-gradient(125deg, rgba(255,255,255,.22), rgba(255,255,255,0) 34%),
  radial-gradient(120% 90% at 20% 10%, rgba(255,255,255,0), rgba(0,0,0,.12)); }

/* ---------- V5.1 hero cards: the platform's own card identity (Paper Mark), real questions ---------- */
.fan { width: 40%; aspect-ratio: auto; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; overflow: visible; display: block; text-align: start; color: #0b2e59; }
.fan-deck { position: absolute; inset: 6px 6px 2px; border-radius: 15px; background: linear-gradient(165deg, #1b4b80, #0b2e59); transform: rotate(2.6deg) translate(-5px, -3px); box-shadow: 0 30px 50px -26px rgba(0,0,0,.7); }
.fan-card { --ear: 24px; position: relative; display: block; padding: 12px 14px 10px; border: 1.5px solid #0b2e59; border-radius: 15px; min-height: 9.2em;
  background: linear-gradient(165deg, #fffdf8 35%, #f3eee3); clip-path: polygon(var(--ear) 0, 100% 0, 100% 100%, 0 100%, 0 var(--ear)); overflow: hidden; }
.fan-ear { position: absolute; top: 0; left: 0; width: var(--ear); height: var(--ear); }
.fan-ear::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 50%, #0b2e59 50%); border-radius: 0 0 5px 0; }
.fan-ear svg { position: absolute; width: 46%; height: 46%; right: 10%; bottom: 10%; overflow: visible; }
.fan-ear svg path { fill: none; stroke: #fff; stroke-width: 9; stroke-linejoin: round; }
.fan-in { display: flex; flex-direction: column; gap: 6px; min-height: calc(9.2em - 22px); transition: opacity .3s cubic-bezier(.16,1,.3,1), transform .3s cubic-bezier(.16,1,.3,1); }
.fan-in.out { opacity: 0; transform: translateY(6px); transition-duration: .2s; transition-timing-function: cubic-bezier(.7,0,.84,0); }
.fan-meta { padding-left: calc(var(--ear) - 4px); font: 800 10.5px/1.4 var(--f-ar); color: #0b2e59; direction: rtl; }
html[lang="en"] .fan-meta { direction: ltr; font-family: var(--f-en); }
.fan-q { margin: 0; flex: 1; direction: rtl; text-align: right; font: 700 clamp(.74rem, .52rem + .42vw, .92rem)/1.7 var(--f-ar); color: #0b2e59; text-wrap: pretty; }
.fan-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; border-top: 1px solid rgba(11,46,89,.16); direction: rtl; }
.fan-pg { font: 700 10px/1.2 var(--f-ar); color: #5b6b80; } .fan-pg b { color: #1d63b8; font-weight: 800; }
.fan-wm2 { font: 900 8.5px/1 var(--f-en); letter-spacing: .02em; color: #0b2e59; } .fan-wm2 i { font-style: normal; color: #378ae6; }
html[data-theme="dark"] .fan-card { background: linear-gradient(165deg, #173156, #11284a); border-color: #72b9ed; }
html[data-theme="dark"] .fan-deck { background: linear-gradient(165deg, #2a5a90, #1b4b80); }
html[data-theme="dark"] .fan-ear::before { background: linear-gradient(135deg, transparent 50%, #72b9ed 50%); }
html[data-theme="dark"] .fan-ear svg path { stroke: #06182e; }
html[data-theme="dark"] :is(.fan-meta, .fan-q, .fan-wm2) { color: #f2f6fc; }
html[data-theme="dark"] .fan-pg { color: #a6b8ce; } html[data-theme="dark"] .fan-pg b { color: #9ed4f5; }
html[data-theme="dark"] .fan-foot { border-color: rgba(114,185,237,.25); }
.f1 { top: 2%; left: -4%; } .f2 { top: -12%; right: 0; } .f3 { bottom: 8%; right: -6%; }
@media (max-width: 960px) { .fan { width: 44%; } .fan-card { --ear: 20px; padding: 10px 11px 8px; } }
@media (prefers-reduced-motion: reduce) { .fan-in { transition: none; } }
/* V5.1: on short laptop screens (e.g. 1366×657) the headline scales with the screen height, and the copy is centred
   in the space above the facts row, so the two never overlap */
.op h1 { font-size: clamp(2.3rem, min(.9rem + 4.6vw, 10svh), 5.7rem); }
html[lang="en"] .op h1 { font-size: clamp(2.4rem, min(.9rem + 4.8vw, 10.5svh), 6rem); }
@media (min-width: 861px) { .scrub .op-copy { top: calc(50% - 46px); } }
@media (min-width: 861px) and (max-height: 760px) { .op-lead { margin-top: 14px; line-height: 1.75; font-size: 1.02rem; } html[lang="en"] .op-lead { line-height: 1.55; } .op-cta { margin-top: 20px !important; } .op h1 { margin-top: 10px; } }
/* V5.1: the cards sit in the clear space around the emblem and in front of the orbit, so no line ever crosses their text */
.scrub .op-fan { z-index: 3; }
.f1 { top: -4%; left: -14%; } .f2 { top: -16%; right: -6%; } .f3 { bottom: -2%; right: -14%; }
.fan { width: 37%; }
.f1 { top: -3%; left: -6%; right: auto; } .f2 { top: -7%; right: -3%; left: auto; } .f3 { bottom: 3%; right: -6%; left: auto; top: auto; }
html[dir="ltr"] .f1 { left: auto; right: -6%; } html[dir="ltr"] .f2 { right: auto; left: -3%; } html[dir="ltr"] .f3 { right: auto; left: -6%; }
.fan { width: 35%; }
/* V5.1: the wordmark sits in the centre of the header; links on one side, tools on the other */
@media (min-width: 900px) {
  .hd-in { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; }
  .hd-in > .wm { grid-column: 2; grid-row: 1; justify-self: center; text-align: center; }
  .hd-in > .hd-nav { grid-column: 1; grid-row: 1; margin: 0; justify-self: start; }
  .hd-in > .hd-tools { grid-column: 3; grid-row: 1; margin: 0; justify-self: end; }
  .hd-in > .hd-burger { grid-column: 1; grid-row: 1; justify-self: start; }
  .wm { justify-items: center; }
}
.hd-nav a { white-space: nowrap; }
@media (max-width: 1320px) { html[lang="en"] .hd-nav, html[lang="en"] .hd-login { display: none; } html[lang="en"] .hd-burger { display: grid; } }
@media (min-width: 900px) { .hd-nav a { padding: 8px 8px; font-size: .92rem; } }
@media (max-width: 1240px) { .hd-nav, .hd-login { display: none; } .hd-burger { display: grid; } }
@media (max-width: 1400px) { html[lang="en"] .hd-nav, html[lang="en"] .hd-login { display: none; } html[lang="en"] .hd-burger { display: grid; } }

/* V5.1: the carousel is driven frame by frame from script on wide screens; on phones the new screen slides in */
@media (min-width: 961px) { .in-scene.in-js .ph { transition: none; pointer-events: auto; } .in-scene.in-js .ph:not([data-rel="cur"]) { cursor: pointer; } }
@media (max-width: 960px) { .in-scene { touch-action: pan-y; } .ph[data-rel="cur"] { animation: phIn .3s cubic-bezier(.16,1,.3,1); } }
@keyframes phIn { from { opacity: 0; transform: translateX(var(--ph-from, 18px)) scale(.98); } }
html[dir="rtl"] .ph { --ph-from: -18px; }
@media (prefers-reduced-motion: reduce) { .ph[data-rel="cur"] { animation: none; } }

/* ---------- V5.1 syllabus: one deck of the platform's cards per lesson ---------- */
.dk-unit { margin-top: clamp(40px, 5vw, 64px); }
.dk-uname { font-size: 1.05rem; font-weight: 900; color: var(--text); padding-bottom: 12px; border-bottom: 2px solid var(--ink-outline, #0b2e59); }
.dk-list { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 32px; }
.dk { display: grid; gap: 16px; align-content: start; }
.dk-stack { position: relative; display: block; width: 100%; padding: 0 10px 14px 0; border: 0; background: none; text-align: start; cursor: pointer; color: inherit; font: inherit; -webkit-tap-highlight-color: transparent; }
.dk-stack:disabled { cursor: default; }
.dk-stack:focus-visible { outline: 3px solid var(--sky); outline-offset: 6px; border-radius: 16px; }
.dk-under { position: absolute; inset: 0 10px 14px 0; border-radius: 16px; border: 1.5px solid #0b2e59; background: linear-gradient(165deg, #fffdf8 35%, #f3eee3); }
.dk-u1 { transform: translate(5px, 7px) rotate(1.6deg); }
.dk-u2 { transform: translate(10px, 14px) rotate(3.2deg); background: linear-gradient(165deg, #1b4b80, #0b2e59); }
.dk-card { --ear: 28px; position: relative; display: block; border: 2px solid #0b2e59; border-radius: 16px; padding: 14px 18px 12px; background: linear-gradient(165deg, #fffdf8 35%, #f3eee3);
  clip-path: polygon(var(--ear) 0, 100% 0, 100% 100%, 0 100%, 0 var(--ear)); box-shadow: 0 18px 30px -24px rgba(11,46,89,.55); transition: transform .2s cubic-bezier(.16,1,.3,1); }
@media (hover: hover) { .dk-stack:not(:disabled):hover .dk-card { transform: translate(-3px, -4px) rotate(-.8deg); } }
.dk-ear { position: absolute; top: 0; left: 0; width: var(--ear); height: var(--ear); }
.dk-ear::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 50%, #0b2e59 50%); border-radius: 0 0 6px 0; }
.dk-ear svg { position: absolute; width: 46%; height: 46%; right: 10%; bottom: 10%; overflow: visible; }
.dk-ear svg path { fill: none; stroke: #fff; stroke-width: 9; stroke-linejoin: round; }
.dk-in { display: flex; flex-direction: column; gap: 8px; min-height: 9.6em; transition: opacity .2s, transform .2s; }
.dk-in.out { opacity: 0; transform: translateX(14px); transition-timing-function: cubic-bezier(.7,0,.84,0); }
html[dir="rtl"] .dk-in.out { transform: translateX(-14px); }
.dk-meta { padding-left: calc(var(--ear) - 4px); font: 800 11.5px/1.4 var(--f-ar); color: #0b2e59; direction: rtl; }
html[lang="en"] .dk-meta { direction: ltr; font-family: var(--f-en); }
.dk-q { flex: 1; direction: rtl; text-align: right; font: 700 1rem/1.75 var(--f-ar); color: #0b2e59; text-wrap: pretty; }
.dk-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px solid rgba(11,46,89,.16); direction: rtl; }
.dk-pg { font: 700 11.5px/1.2 var(--f-ar); color: #5b6b80; } .dk-pg b { color: #1d63b8; }
.dk-wm { font: 900 9.5px/1 var(--f-en); color: #0b2e59; } .dk-wm i { font-style: normal; color: #378ae6; }
.dk-cap { display: grid; gap: 2px; }
.dk-cap b { font-size: 1rem; line-height: 1.5; color: var(--text); font-weight: 900; }
.dk-pages { font-size: .88rem; color: var(--muted); font-weight: 600; }
.sy-legend { display: block; margin-top: 40px; max-width: 70ch; }
html[data-theme="dark"] .dk-card, html[data-theme="dark"] .dk-u1 { background: linear-gradient(165deg, #173156, #11284a); border-color: #72b9ed; }
html[data-theme="dark"] .dk-u2 { background: linear-gradient(165deg, #2a5a90, #1b4b80); border-color: #72b9ed; }
html[data-theme="dark"] .dk-ear::before { background: linear-gradient(135deg, transparent 50%, #72b9ed 50%); }
html[data-theme="dark"] .dk-ear svg path { stroke: #06182e; }
html[data-theme="dark"] :is(.dk-meta, .dk-q, .dk-wm) { color: #f2f6fc; }
html[data-theme="dark"] .dk-pg { color: #a6b8ce; } html[data-theme="dark"] .dk-pg b { color: #9ed4f5; }
html[data-theme="dark"] .dk-foot { border-color: rgba(114,185,237,.25); }
html[data-theme="dark"] .dk-uname { border-color: #72b9ed; }
@media (max-width: 960px) { .dk-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .dk-list { grid-template-columns: minmax(0, 1fr); gap: 32px; } .dk-in { min-height: 0; } }
@media (prefers-reduced-motion: reduce) { .dk-in, .dk-card { transition: none; } }
@media (max-width: 600px) {
  .dk-list { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 84%; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 12px; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
  .dk-list::-webkit-scrollbar { display: none; }
  .dk { scroll-snap-align: start; }
}

/* ---------- V5.1 research: the real studies, each with what it found and where it shows up in the app ---------- */
.sci h2 { max-width: 24ch; line-height: 1.45; }
.sci-intro { margin-top: 28px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 16px clamp(32px, 5vw, 80px); align-items: start; }
.sci-intro p { max-width: 56ch; line-height: 1.9; color: var(--body); }
.sci-intro .sci-limit { padding-top: 0; border: 0; border-inline-start: 3px solid var(--sky); padding-inline-start: 16px; color: var(--muted); }
.rss { list-style: none; margin: clamp(40px, 5vw, 64px) 0 0; padding: 0; border-top: 2px solid var(--text); }
.rs { display: grid; grid-template-columns: 84px minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px clamp(20px, 3vw, 40px); padding: 26px 0; border-bottom: 1px solid var(--line2); align-items: start; }
.rs-y { font: 900 1.9rem/1 var(--f-en); color: var(--sky); letter-spacing: -.02em; }
.rs-src cite { display: grid; gap: 4px; font: normal 400 .9rem/1.5 var(--f-en); color: var(--muted); text-align: left; }
.rs-src cite b { font-size: 1.02rem; font-weight: 800; line-height: 1.4; color: var(--text); }
.rs-j { font-style: italic; }
.rs-doi { display: inline-block; margin-top: 8px; font: 700 .82rem/1.4 var(--f-en); color: var(--link); word-break: break-all; text-underline-offset: 3px; }
.rs-k { display: block; font-size: .82rem; font-weight: 800; color: var(--muted); margin-bottom: 4px; }
.rs p { margin: 0; line-height: 1.8; color: var(--text); }
.rs-use p { color: var(--body); }
@media (max-width: 1100px) { .rs { grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1fr); } .rs-src { grid-column: 2 / -1; } .rs-what { grid-column: 2; } .rs-use { grid-column: 3; } }
@media (max-width: 700px) { .sci-intro { grid-template-columns: minmax(0, 1fr); } .rs { grid-template-columns: minmax(0, 1fr); gap: 10px; } .rs-src, .rs-what, .rs-use { grid-column: auto; } .rs-y { font-size: 1.5rem; } }

/* V5.1: the dog-ear is the platform's own (public/index.html .mfsc-ear + study-card.css): same star path and viewBox,
   triangle with a 7px corner, star at 46% sitting 10% from the corner, white outline 9 units wide; dark theme
   uses the sky triangle with a navy star. Ear size follows the card: 36px, or 46px on wide cards, as in the app. */
:is(.fan-ear, .dk-ear, .b3-ear)::before { background: linear-gradient(135deg, transparent 50%, #0b2e59 50%) !important; border-radius: 0 0 7px 0 !important; }
:is(.fan-ear, .dk-ear, .b3-ear) svg { position: absolute !important; width: 46% !important; height: 46% !important; right: 10% !important; bottom: 10% !important; left: auto !important; top: auto !important; overflow: visible; }
:is(.fan-ear, .dk-ear, .b3-ear) svg path { fill: none !important; stroke: #fff !important; stroke-width: 9 !important; stroke-linejoin: round; }
html[data-theme="dark"] :is(.fan-ear, .dk-ear, .b3-ear)::before { background: linear-gradient(135deg, transparent 50%, #72b9ed 50%) !important; }
html[data-theme="dark"] :is(.fan-ear, .dk-ear, .b3-ear) svg path { stroke: #06182e !important; }
.dk-card { --ear: 36px; border-radius: 22px; }
.dk-under { border-radius: 22px; }
@media (min-width: 1200px) { .dk-card { --ear: 46px; } }
.fan-card { --ear: 30px; border-radius: 18px; } .fan-deck { border-radius: 18px; }
@media (max-width: 960px) { .fan-card { --ear: 26px; } }

/* V5.1: the closing card of a deck */
.dk-card { display: grid; }
.dk-card > .dk-in, .dk-card > .dk-end { grid-area: 1 / 1; }
.dk-end { display: grid; align-content: center; gap: 8px; padding: 10px 4px; text-align: center; opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; pointer-events: none; }
.dk-end-t { font-weight: 900; font-size: 1.05rem; line-height: 1.6; color: #0b2e59; }
.dk-end-s { font-size: .9rem; color: #5b6b80; line-height: 1.7; }
.dk-stack[aria-pressed="true"] .dk-in { opacity: 0; transform: translateY(-6px); }
.dk-stack[aria-pressed="true"] .dk-end { opacity: 1; transform: none; }
html[data-theme="dark"] .dk-end-t { color: #f2f6fc; } html[data-theme="dark"] .dk-end-s { color: #a6b8ce; }
.b3-ear { background: none !important; clip-path: none !important; padding: 0 !important; display: block !important; }
.b3-ear::before { content: ""; position: absolute; inset: 0; }
@media (prefers-reduced-motion: reduce) { .dk-end { transition: none; } }

/* ---------- V5.1 book realism: a cover board with thickness, light that follows the turn, a cast shadow ---------- */
.b3-scene { perspective: 1500px; }
.b3-book { --sf: 0; --sb: 0; --sh: 0; --shw: 90%; }
.b3-front::after, .b3-back::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; }
.b3-front::after { background: linear-gradient(90deg, rgba(8,12,20,.55), rgba(8,12,20,.85)); opacity: var(--sf); }
.b3-back::after { background: linear-gradient(270deg, rgba(8,12,20,.35), rgba(8,12,20,.7)); opacity: var(--sb); }
.b3-left::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(270deg, rgba(10,16,28,.75) 0%, rgba(10,16,28,.35) calc(var(--shw) * .45), rgba(10,16,28,0) var(--shw)); opacity: var(--sh); }
/* the cover board: 7px thick, seen when the cover stands on edge */
.b3-edge { position: absolute; left: 0; top: 0; bottom: 0; width: 7px; transform-origin: 0 50%; transform: rotateY(90deg);
  background: linear-gradient(90deg, #5e0f33, #8c1c4e 45%, #6a1239); border-radius: 2px; }
.b3-edge-top { left: 0; right: 0; bottom: auto; width: auto; height: 7px; transform-origin: 50% 0; transform: rotateX(-90deg); background: linear-gradient(180deg, #6a1239, #8c1c4e); }
.b3-front { transform: translateZ(0.5px); }
.b3-back { transform: rotateY(180deg) translateZ(0.5px); }
@media (prefers-reduced-motion: reduce) { .b3-left::after, .b3-front::after, .b3-back::after { opacity: 0; } }

/* V5.1 fix: the cover's thickness shows only while it turns; at rest (closed or open flat) it showed as a magenta strip on the page */
.b3-book { --ed: 0; }
.b3-edge { opacity: var(--ed); }
.b3-edge-top { display: none; }

/* V5.1: copyable CliQ alias */
.cp { position: relative; display: inline-flex; align-items: center; gap: 6px; vertical-align: baseline; margin: 0 2px; padding: 2px 10px; min-height: 30px;
  font: 700 .95em/1 Inter, system-ui, sans-serif; letter-spacing: .06em; color: inherit; background: color-mix(in srgb, currentColor 8%, transparent);
  border: 1px dashed color-mix(in srgb, currentColor 45%, transparent); border-radius: 8px; cursor: copy; transition: background .15s, border-color .15s; }
.cp:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.cp:focus-visible { outline: 2px solid #3b8fd9; outline-offset: 2px; }
.cp svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.cp.done { border-style: solid; border-color: #22a06b; }
.cp.done svg { stroke: #22a06b; opacity: 1; }
.cp-ok { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; font: 600 12px/1 Cairo, Inter, sans-serif; letter-spacing: 0;
  background: #0b2e59; color: #fff; border-radius: 6px; padding: 0; pointer-events: none; }
.cp.done .cp-ok { padding: 6px 8px; }

/* ---------- V5.1 contact: header button, sheet, and links in the FAQ ---------- */
.hd-contact { font: inherit; font-weight: 700; color: var(--text); background: transparent; border: 0; padding: 8px 10px; cursor: pointer; white-space: nowrap; }
.hd.is-dark .hd-contact { color: var(--on-dark); }
.hd-contact:hover, .hd-login:hover { text-decoration: underline; text-underline-offset: 4px; }
.hd-menu-btn { font: inherit; text-align: start; background: transparent; border: 0; color: inherit; cursor: pointer; }
/* "Contact us" sits in the top bar wherever it fits beside the centred wordmark; below that it lives in the menu. */
@media (max-width: 1119px) { .hd-contact { display: none; } }
@media (max-width: 1179px) { html[lang="en"] .hd-contact { display: none; } }
.ct { width: min(440px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line2); border-radius: 20px; background: var(--paper, #fff); color: var(--text); box-shadow: 0 30px 80px rgba(6,18,40,.28); }
.ct::backdrop { background: rgba(6,18,40,.5); }
.ct-in { padding: 22px; display: grid; gap: 10px; }
.ct-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ct-head h2 { margin: 0; font-size: 1.35rem; }
.ct-x { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line2); background: transparent; color: inherit; cursor: pointer; }
.ct-x svg, .ct-go { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ct-sub { margin: 0 0 6px; color: var(--text2, inherit); opacity: .85; }
.ct-row { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 14px; border: 1px solid var(--line2); border-radius: 14px; color: inherit; text-decoration: none; transition: border-color .15s, background .15s; }
.ct-row:hover, .ct-row:focus-visible { border-color: #3b8fd9; background: color-mix(in srgb, #3b8fd9 7%, transparent); }
.ct-row img { flex: none; }
.ct-txt { display: grid; gap: 2px; flex: 1; min-width: 0; }
.ct-txt b { font-size: 1rem; }
.ct-val { font-size: .9rem; opacity: .75; text-align: start; overflow-wrap: anywhere; }
html[dir="rtl"] .ct-val { text-align: right; }
html[dir="rtl"] .ct-go { transform: scaleX(-1); }
.ct-go { opacity: .5; flex: none; }
.ct-link { font-weight: 700; color: #1f6fb8; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; unicode-bidi: isolate; }
.ct-link:hover { text-decoration-thickness: 2px; }
html[data-theme="dark"] .ct-link { color: #72b9ed; }
.hd-menu .hd-menu-btn { padding: 14px 4px; border-bottom: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: inherit; }
