/* ============ SlideCraft ============ */
*, *::before, *::after { box-sizing: border-box; }
:root {
  --ui-bg: #08090B;
  --ui-bg2: #0E1013;
  --ui-panel: #12151A;
  --ui-line: rgba(255,255,255,.10);
  --ui-line2: rgba(255,255,255,.18);
  --ui-ink: #F2F4F7;
  --ui-muted: #8E97A3;
  --ui-accent: #C9A227;
  --ui-radius: 3px;
  --font: 'Inter', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, monospace;
}
html, body { margin: 0; height: 100%; }
body {
  background: var(--ui-bg); color: var(--ui-ink); font-family: var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-size: 15px; line-height: 1.5;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }

/* ---------- shell ---------- */
.shell { display: flex; flex-direction: column; min-height: 100%; }
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 16px 26px; border-bottom: 1px solid var(--ui-line);
  position: sticky; top: 0; z-index: 30; background: rgba(8,9,11,.86); backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; font-size: 16px; }
.brand .glyph {
  width: 22px; height: 22px; display: grid; place-items: center;
  border: 1px solid var(--ui-line2); border-radius: 2px; color: var(--ui-accent); font-size: 11px; font-weight: 700;
}
.brand small { color: var(--ui-muted); font-weight: 400; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; margin-inline-start: 6px; }
.topbar .spacer { flex: 1; }
.topbar .links { display: flex; gap: 18px; font-size: 13px; color: var(--ui-muted); }
.topbar .links a:hover { color: var(--ui-ink); }

.vbar .btn, .vbar select.btn { padding: 6px 9px; font-size: 12px; }
.vbar .pager .btn { padding: 4px 8px; font-size: 15px; line-height: 1; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px;
  border: 1px solid var(--ui-line2); border-radius: var(--ui-radius);
  font-size: 13.5px; font-weight: 500; color: var(--ui-ink); background: transparent;
  transition: background .18s, border-color .18s, transform .18s;
}
.btn:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ui-accent); border-color: var(--ui-accent); color: #10120F; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); background: var(--ui-accent); }
.btn.ghost { border-color: transparent; color: var(--ui-muted); }
.btn.ghost:hover { color: var(--ui-ink); background: rgba(255,255,255,.06); }

/* ---------- landing ---------- */
.landing { width: min(1180px, 100% - 48px); margin: 0 auto; padding: 54px 0 80px; }
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; font-size: 11.5px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--ui-accent); margin-bottom: 22px;
}
.eyebrow::before { content: ''; width: 26px; height: 1px; background: currentColor; display: inline-block; }
h1.hero-title {
  font-size: clamp(34px, 4.1vw, 58px); line-height: 1.02; letter-spacing: -.035em;
  font-weight: 600; margin: 0 0 20px;
}
h1.hero-title em { font-style: normal; color: var(--ui-accent); }
.hero p.lead { color: var(--ui-muted); font-size: 16.5px; line-height: 1.6; max-width: 46ch; margin: 0 0 28px; }
.hero .ar { display: block; font-size: 15px; color: #A6AEBA; margin-top: 14px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.trust { display: flex; gap: 22px; margin-top: 30px; flex-wrap: wrap; }
.trust div { font-size: 12.5px; color: var(--ui-muted); display: flex; align-items: center; gap: 8px; }
.trust i { width: 5px; height: 5px; border-radius: 50%; background: var(--ui-accent); display: inline-block; }

.dropzone {
  position: relative; border: 1px dashed rgba(255,255,255,.22); border-radius: 4px;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01));
  padding: 44px 30px; text-align: center; transition: border-color .2s, background .2s, transform .2s;
}
.dropzone.hot { border-color: var(--ui-accent); background: rgba(201,162,39,.07); transform: translateY(-1px); }
.dropzone .ico {
  width: 46px; height: 46px; margin: 0 auto 16px; display: grid; place-items: center;
  border: 1px solid var(--ui-line2); border-radius: 3px; color: var(--ui-accent);
}
.dropzone h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.dropzone p { margin: 0 0 20px; color: var(--ui-muted); font-size: 13.5px; }
.dropzone .fine { margin: 16px 0 0; font-size: 11.5px; color: #6E7683; letter-spacing: .02em; }
.preview-card {
  margin-top: 18px; border: 1px solid var(--ui-line); border-radius: 3px; overflow: hidden;
  aspect-ratio: 16 / 9; background: #0A0C0F; position: relative;
}
.preview-card .badge {
  position: absolute; top: 10px; left: 10px; z-index: 3; font-size: 10.5px; letter-spacing: .18em;
  text-transform: uppercase; color: rgba(255,255,255,.75); background: rgba(0,0,0,.45);
  padding: 5px 9px; border-radius: 2px; border: 1px solid rgba(255,255,255,.14);
}

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 64px; padding-top: 34px; border-top: 1px solid var(--ui-line); }
.step h4 { margin: 0 0 8px; font-size: 14px; font-weight: 600; letter-spacing: -.005em; }
.step p { margin: 0; color: var(--ui-muted); font-size: 13px; line-height: 1.6; }
.step .n { font-family: var(--mono); font-size: 11px; color: var(--ui-accent); letter-spacing: .12em; display: block; margin-bottom: 10px; }

/* ---------- viewer ---------- */
.viewer { position: fixed; inset: 0; display: none; flex-direction: column; background: #06070800; z-index: 40; }
.viewer.on { display: flex; }
.vbar {
  display: flex; align-items: center; gap: 9px; padding: 8px 12px;
  border-bottom: 1px solid var(--ui-line); background: rgba(8,9,11,.92); backdrop-filter: blur(12px);
  z-index: 6; flex-wrap: wrap;
}
.vbar .fname { font-size: 12.5px; font-weight: 500; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vbar .sub { font-size: 10.5px; color: var(--ui-muted); letter-spacing: .04em; }
.vbar .spacer { flex: 1; }
.control { display: flex; align-items: center; gap: 6px; }
.seg { display: inline-flex; border: 1px solid var(--ui-line2); border-radius: 2px; overflow: hidden; }
.seg button { padding: 6px 10px; font-size: 12px; color: var(--ui-muted); border-inline-end: 1px solid var(--ui-line); }
.seg button:last-child { border-inline-end: 0; }
.seg button.on { background: rgba(255,255,255,.10); color: var(--ui-ink); }
.swatches { display: inline-flex; gap: 6px; align-items: center; }
.swatch { width: 15px; height: 15px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); }
.swatch.on { box-shadow: 0 0 0 2px #08090B, 0 0 0 3px rgba(255,255,255,.6); }
label.tiny { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #6E7683; }

.stagewrap { flex: 1; position: relative; display: grid; place-items: center; padding: 0; overflow: hidden; background: radial-gradient(120% 120% at 50% 0%, #0D0F13 0%, #07080A 70%); }
.deck {
  position: relative; width: 100%; height: 100%;
  container-type: size; overflow: hidden;
  background: var(--bg); color: var(--ink); border-radius: 2px;
  box-shadow: 0 40px 90px -50px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.07);
}
.deck.thumb { width: 100%; height: auto; aspect-ratio: var(--ar, 1.7778); box-shadow: none; border-radius: 0; }

.pager { display: flex; align-items: center; gap: 12px; }
.pager .count { font-family: var(--mono); font-size: 12px; color: var(--ui-muted); letter-spacing: .06em; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255,255,255,.08); z-index: 8; }
.progress i { display: block; height: 100%; background: var(--ui-accent); width: 0; transition: width .35s ease; }

.hint { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); font-size: 11.5px; color: #6E7683; letter-spacing: .06em; z-index: 7; pointer-events: none; opacity: 1; transition: opacity .6s; }
.hint.gone { opacity: 0; }

.overview { position: absolute; inset: 0; background: #060709; z-index: 9; overflow: auto; padding: 26px; display: none; }
.overview.on { display: block; }
.ogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.ocard { position: relative; border: 1px solid var(--ui-line); border-radius: 3px; overflow: hidden; cursor: pointer; background: #0A0C0F; transition: border-color .18s, transform .18s; }
.ocard:hover { border-color: rgba(255,255,255,.3); transform: translateY(-2px); }
.ocard.on { border-color: var(--ui-accent); }
.ocard .olabel { position: absolute; bottom: 0; left: 0; right: 0; padding: 5px 8px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.65); background: linear-gradient(transparent, rgba(0,0,0,.6)); z-index: 2; }

.notes { position: absolute; right: 18px; bottom: 26px; width: min(380px, 34vw); max-height: 42vh; overflow: auto; background: rgba(14,16,19,.96); border: 1px solid var(--ui-line2); border-radius: 3px; padding: 14px 16px; font-size: 13px; line-height: 1.6; color: #C9D0D9; z-index: 7; display: none; }
.notes.on { display: block; }
.notes h5 { margin: 0 0 8px; font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ui-accent); }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(10px); background: #14171C; border: 1px solid var(--ui-line2); color: var(--ui-ink); padding: 11px 18px; border-radius: 3px; font-size: 13px; opacity: 0; transition: opacity .25s, transform .25s; z-index: 100; pointer-events: none; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

.loading { position: fixed; inset: 0; display: none; place-items: center; background: rgba(6,7,9,.92); z-index: 90; }
.loading.on { display: grid; }
.loading .box { text-align: center; width: 280px; }
.loading .bar { height: 2px; background: rgba(255,255,255,.12); margin-top: 16px; overflow: hidden; }
.loading .bar i { display: block; height: 100%; width: 0; background: var(--ui-accent); transition: width .2s; }
.loading p { margin: 0; font-size: 13px; color: var(--ui-muted); letter-spacing: .04em; }

/* ============ deck themes ============ */
.deck {
  --ar: 1.7778;
  --bg: #0A0C0F; --ink: #F4F6F8; --muted: #98A4B0; --line: rgba(255,255,255,.14);
  --surface: #12161B; --accent: #C9A227; --wash: radial-gradient(120% 90% at 12% -10%, rgba(201,162,39,.14), transparent 60%);
  --shadow: 0 24px 60px -40px rgba(0,0,0,.85);
  --pad-x: 6.4cqw; --pad-y: 5.2cqw;
  font-family: var(--font);
}
.deck[data-theme="obsidian"] { --bg:#0A0C0F; --ink:#F4F6F8; --muted:#96A1AC; --line:rgba(255,255,255,.13); --surface:#12161B; --accent:#C9A227; --wash: radial-gradient(120% 95% at 8% -15%, rgba(201,162,39,.16), transparent 58%); }
.deck[data-theme="porcelain"] { --bg:#F6F4EF; --ink:#17181A; --muted:#6C7278; --line:rgba(23,24,26,.16); --surface:#FFFFFF; --accent:#0E5A4A; --wash: radial-gradient(110% 90% at 100% -20%, rgba(14,90,74,.10), transparent 60%); --shadow: 0 22px 50px -34px rgba(23,24,26,.35); }
.deck[data-theme="midnight"] { --bg:#0B1424; --ink:#E9EFFA; --muted:#8CA0C0; --line:rgba(160,190,255,.20); --surface:#14213A; --accent:#D98324; --wash: radial-gradient(120% 100% at 85% -10%, rgba(217,131,36,.18), transparent 62%); }
.deck[data-theme="sage"] { --bg:#EDF1EA; --ink:#1B241E; --muted:#5E6E62; --line:rgba(27,36,30,.16); --surface:#FFFFFF; --accent:#2F6B4F; --wash: radial-gradient(100% 80% at 0% 0%, rgba(47,107,79,.10), transparent 60%); --shadow: 0 22px 50px -34px rgba(27,36,30,.32); }

.deck::before { content: ''; position: absolute; inset: 0; background: var(--wash); pointer-events: none; z-index: 0; }
.deck[data-theme="midnight"]::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5; z-index: 0;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: 8.3333% 100%;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.5), transparent 70%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.5), transparent 70%);
}
.deck[data-theme="porcelain"]::after, .deck[data-theme="sage"]::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 0.55cqw; background: var(--accent); opacity: .9; z-index: 1;
}

/* slides */
.slide {
  position: absolute; inset: 0; z-index: 2; padding: var(--pad-y) var(--pad-x) calc(var(--pad-y) * .82);
  display: flex; flex-direction: column; color: var(--ink);
  opacity: 0; visibility: hidden; transition: opacity .42s ease, transform .42s ease;
  transform: translateY(1.2cqw);
}
.slide.on { opacity: 1; visibility: visible; transform: none; }
.slide.prev { transform: translateY(-1.2cqw); }
.slide[data-dirhint="fwd"]:not(.on) { transform: translateY(-1.4cqw); }
.slide[data-dirhint="back"]:not(.on) { transform: translateY(1.4cqw); }

.frame { display: flex; flex-direction: column; height: 100%; position: relative; z-index: 2; }
.stagebody { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.hdr { display: flex; align-items: center; gap: 1.1cqw; font-size: .8cqw; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); margin-bottom: 2.4cqw; }
.hdr .mark { width: .5cqw; height: .5cqw; background: var(--accent); flex: 0 0 auto; }
.hdr .kicker { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62%; }
.hdr .pg { margin-inline-start: auto; font-variant-numeric: tabular-nums; letter-spacing: .14em; color: var(--muted); }
.hdr .pg i { font-style: normal; opacity: .45; }

.content { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.chead { flex: 0 0 auto; }
.title { font-size: 3.4cqw; line-height: 1.08; font-weight: 600; letter-spacing: -.022em; margin: 0; max-width: 88%; }
[dir="rtl"].title, .title[dir="rtl"] { letter-spacing: 0; font-size: 3.5cqw; line-height: 1.28; }
.rule { height: 1px; width: 4.2cqw; background: var(--accent); margin: 1.5cqw 0 2.4cqw; transform-origin: left center; }
[dir="rtl"] .rule { transform-origin: right center; }

/* bullets */
.list { display: flex; flex-direction: column; gap: .35cqw; overflow: hidden; }
.list.two { display: grid; grid-template-columns: 1fr 1fr; column-gap: 3.4cqw; align-content: start; }
.item { display: flex; align-items: flex-start; gap: 1.05cqw; font-size: 1.5cqw; line-height: 1.5; padding: .5cqw 0; color: var(--ink); }
.item .mk { flex: 0 0 auto; width: .95cqw; height: 1px; background: var(--accent); margin-top: .82cqw; opacity: .9; }
.item .tx { flex: 1; }
.item .tx.b { font-weight: 600; }
.item.lvl1 { font-size: 1.28cqw; color: var(--muted); }
.item.lvl2 { font-size: 1.15cqw; color: var(--muted); }
.item.lvl1 .mk, .item.lvl2 .mk { width: .6cqw; opacity: .6; }

/* statement */
.statement { justify-content: center; }
.statement .title { max-width: 78%; }
.bigtext { font-size: 2.35cqw; line-height: 1.4; font-weight: 300; color: var(--ink); margin: 0; max-width: 78%; letter-spacing: -.005em; }
.bigtext[dir="rtl"] { font-size: 2.45cqw; line-height: 1.6; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 2.4cqw 2.2cqw; align-content: start; }
.stat { border-top: 1px solid var(--line); padding-top: 1.3cqw; position: relative; }
.stat::before { content: ''; position: absolute; top: -1px; inset-inline-start: 0; width: 2.6cqw; height: 1px; background: var(--accent); }
.snum { font-size: 4.6cqw; font-weight: 300; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.slab { font-size: 1.05cqw; color: var(--muted); margin-top: 1.1cqw; line-height: 1.45; max-width: 26ch; }
[dir="rtl"] .snum { letter-spacing: 0; font-weight: 400; }

/* table */
.tablewrap { overflow: hidden; }
.tbl { width: 100%; border-collapse: collapse; font-size: 1.15cqw; }
.tbl th { text-align: start; font-size: .78cqw; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); font-weight: 600; padding: 0 1.1cqw 1.1cqw 0; border-bottom: 1px solid var(--accent); }
.tbl td { padding: 1.05cqw 1.1cqw 1.05cqw 0; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: top; }
.tbl tr td:first-child { font-weight: 500; }
.tbl[dir="rtl"] th, .tbl[dir="rtl"] td { text-align: right; }

/* chart */
.chart { display: flex; flex-direction: column; gap: .5cqw; }
.crow { display: grid; grid-template-columns: 15cqw 1fr 5.5cqw; align-items: center; gap: 1.4cqw; padding: .55cqw 0; }
.clab { font-size: 1.05cqw; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctrack { height: .8cqw; background: rgba(128,128,128,.18); border-radius: 1px; overflow: hidden; }
.cbar { display: block; height: 100%; width: var(--w, 0); background: var(--accent); transform-origin: left center; animation: barGrow .95s cubic-bezier(.16,1,.3,1) both; animation-delay: var(--d, 0ms); }
.cval { font-size: 1.05cqw; font-variant-numeric: tabular-nums; color: var(--ink); text-align: end; }

/* media split */
.split { display: grid; grid-template-columns: 1.02fr 1fr; gap: 4.2cqw; align-items: center; flex: 1; min-height: 0; }
.split .scol { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.split .mcol { min-width: 0; display: flex; align-items: center; justify-content: center; height: 100%; }
.media { margin: 0; border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; background: var(--surface); aspect-ratio: 4 / 3; width: 100%; max-height: 100%; }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media figcaption { font-size: .78cqw; color: var(--muted); padding: .7cqw .9cqw; border-top: 1px solid var(--line); letter-spacing: .04em; }

/* full image */
.full { position: absolute; inset: 0; }
.full .media.bleed { position: absolute; inset: 0; border: 0; box-shadow: none; aspect-ratio: auto; width: 100%; height: 100%; }
.full .media.bleed img { width: 100%; height: 100%; object-fit: cover; }
.scrim { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.78) 0%, rgba(0,0,0,.28) 46%, rgba(0,0,0,.08) 100%); }
.fcap { position: absolute; inset: auto 0 0 0; padding: 4.4cqw var(--pad-x) 4.6cqw; color: #fff; }
.fcap .title { color: #fff; max-width: 70%; }
.fsub { color: rgba(255,255,255,.78); font-size: 1.2cqw; margin: 1cqw 0 0; max-width: 58%; line-height: 1.5; }

/* cover */
.cover { display: flex; flex-direction: column; justify-content: center; height: 100%; position: relative; }
.ckick { font-size: .82cqw; letter-spacing: .3em; text-transform: uppercase; color: var(--accent); margin-bottom: 2.2cqw; }
.ctitle { font-size: 6.2cqw; line-height: 1.03; font-weight: 600; letter-spacing: -.032em; margin: 0; max-width: 84%; }
.ctitle[dir="rtl"] { letter-spacing: 0; line-height: 1.24; font-size: 6cqw; }
.ctitle.small { font-size: 4.8cqw; max-width: 70%; }
.csub { font-size: 1.62cqw; color: var(--muted); max-width: 58%; line-height: 1.5; margin: 0; }
.csub[dir="rtl"] { font-size: 1.7cqw; line-height: 1.7; }
.cmeta { margin-top: 4.2cqw; font-size: .82cqw; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.cover .rule { margin: 2.6cqw 0 2.4cqw; }

/* section */
.section { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; height: 100%; }
.secnum { font-size: 1cqw; letter-spacing: .34em; color: var(--accent); margin-bottom: 2.4cqw; }
.sectitle { font-size: 4.6cqw; line-height: 1.12; font-weight: 600; letter-spacing: -.025em; margin: 0; max-width: 78%; }
.sectitle[dir="rtl"] { letter-spacing: 0; line-height: 1.35; }
.section .rule { margin: 2.4cqw auto 2cqw; transform-origin: center; }
.secsub { font-size: 1.25cqw; color: var(--muted); margin: 0; max-width: 62%; line-height: 1.6; }

/* quote */
.quote { justify-content: center; max-width: 86%; }
.quote[dir="rtl"] { align-items: flex-end; text-align: right; }
.quote[dir="rtl"] .qmark { transform: scaleX(-1); }
.quote[dir="rtl"] .rule { margin-inline-start: auto; }
.qmark { font-family: Georgia, 'Times New Roman', serif; font-size: 6.4cqw; line-height: .5; color: var(--accent); opacity: .85; margin-bottom: 1.4cqw; }
.quote blockquote { margin: 0; font-size: 3cqw; line-height: 1.34; font-weight: 300; letter-spacing: -.015em; }
.quote blockquote[dir="rtl"] { font-size: 3.1cqw; line-height: 1.55; letter-spacing: 0; }
.qattr { font-size: .95cqw; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

/* closing */
.closing { display: flex; flex-direction: column; justify-content: center; height: 100%; }
.closing .rule { margin: 0 0 2.6cqw; }

/* motion */
@keyframes rise { from { opacity: 0; transform: translateY(1.1cqw); } to { opacity: 1; transform: none; } }
@keyframes maskUp { from { opacity: 0; transform: translateY(.55em); clip-path: inset(0 0 100% 0); } to { opacity: 1; transform: none; clip-path: inset(0 0 -10% 0); } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes clipIn { from { clip-path: inset(0 0 100% 0); transform: scale(1.04); } to { clip-path: inset(0 0 0 0); transform: none; } }
@keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.slide .r { animation-duration: .78s; animation-timing-function: cubic-bezier(.16,1,.3,1); animation-fill-mode: both; animation-delay: var(--d, 0ms); animation-name: rise; }
.slide .r.mask { animation-name: maskUp; animation-duration: .95s; }
.slide .r.grow { animation-name: grow; animation-duration: .85s; }
.slide .r.clipin { animation-name: clipIn; animation-duration: 1s; }
.deck[data-motion="off"] .slide .r, .deck[data-motion="off"] .cbar { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .slide .r, .cbar { animation: none !important; }
  .slide { transition: none; }
}

/* overview thumbnails */
.ocard .deck { pointer-events: none; }
.ocard .deck::before, .ocard .deck::after { opacity: .8; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 34px; }
  .steps { grid-template-columns: 1fr; }
  .vbar .fname { max-width: 16ch; }
  .deck { width: 100%; }
}

/* print: one slide per page, page size set per deck by preparePrint() */
@media print {
  html, body { margin: 0 !important; padding: 0 !important; height: auto !important; background: #fff; }
  .topbar, .vbar, .hint, .progress, .overview, .notes, .toast { display: none !important; }
  .viewer, .stagewrap, .deck { margin: 0 !important; padding: 0 !important; border: 0 !important; }
  .landing { display: none !important; }
  .viewer { position: static; display: block !important; }
  .stagewrap { padding: 0; background: none; display: block; overflow: visible; }
  .deck { height: auto !important; overflow: visible; container-type: normal; box-shadow: none; border-radius: 0; }
  .deck::after { display: none; }
  .slide {
    position: relative !important; inset: auto; container-type: size;
    opacity: 1 !important; visibility: visible !important; transform: none !important;
    background: var(--bg);
    page-break-after: always; break-after: page; overflow: hidden;
  }
  .slide:last-child { page-break-after: auto; break-after: auto; }
  .slide .r, .cbar { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* calm motion */
.deck[data-motion="calm"] .slide .r { animation-duration: .42s; }
.deck[data-motion="calm"] .slide .r.clipin { animation-name: rise; }
.deck[data-motion="calm"] .slide { transition-duration: .28s; }
.deck[data-motion="calm"] .cbar { animation-duration: .5s; }

/* ================= refinement pass ================= */
.hdr { border-bottom: 1px solid var(--line); padding-bottom: .85cqw; margin-bottom: 2.6cqw; font-size: .76cqw; }
.hdr .kicker { max-width: 70%; }
.title { font-size: 3.5cqw; letter-spacing: -.024em; }
.title[dir="rtl"] { font-size: 3.6cqw; line-height: 1.24; letter-spacing: 0; }
.rule { width: 3.6cqw; margin: 1.5cqw 0 2.7cqw; }
.slide [dir="rtl"] { letter-spacing: 0; }

.content > .list, .content > .stats, .content > .tablewrap, .content > .chart { margin-block: auto; }
.list { gap: .2cqw; }
.item { font-size: var(--isize, 1.62cqw); line-height: 1.5; padding: .58cqw 0; }
.item .mk { width: 1.05cqw; margin-top: .9cqw; }
.item.lvl1 { font-size: 1.34cqw; }
.item.lvl2 { font-size: 1.18cqw; }
.list.two { column-gap: 4cqw; }

.stats { gap: 2.8cqw 2.6cqw; }
.stat { padding-top: 1.5cqw; }
.snum { font-size: 5cqw; }
.slab { font-size: 1.08cqw; margin-top: 1.2cqw; }

.tablewrap { max-width: 94%; }
.tbl { font-size: 1.16cqw; }
.tbl th { font-size: .74cqw; padding: 0 .9cqw 1.2cqw 0; }
.tbl td { padding: 1.15cqw .9cqw 1.15cqw 0; }
.tbl td.num, .tbl th.num { text-align: end; font-variant-numeric: tabular-nums; }

.bigtext { font-size: 3cqw; max-width: 76%; line-height: 1.38; }
.bigtext[dir="rtl"] { font-size: 3.05cqw; line-height: 1.58; }

/* cover composition */
.cover { justify-content: center; }
.ckick { margin-bottom: 2.6cqw; font-size: .78cqw; }
.ckick[dir="rtl"] { font-size: .92cqw; }
.ctitle { font-size: 5.3cqw; max-width: 90%; }
.ctitle[dir="rtl"] { font-size: 5.1cqw; line-height: 1.24; }
.csub { font-size: 1.55cqw; margin-top: .6cqw; }
.csub[dir="rtl"] { font-size: 1.62cqw; line-height: 1.65; }
.cmeta { position: absolute; inset-inline-start: 0; bottom: 0; margin: 0; font-size: .76cqw; }
.cover .rule { margin: 2.4cqw 0 2.2cqw; }

/* section */
.section { align-items: center; text-align: center; }
.secnum { font-size: 1.02cqw; letter-spacing: .38em; margin-bottom: 2.6cqw; }
.sectitle { font-size: 4.1cqw; max-width: 74%; }
.sectitle[dir="rtl"] { font-size: 4.2cqw; line-height: 1.32; }
.section .rule { margin: 2.6cqw auto 2.2cqw; }
.secsub { font-size: 1.2cqw; }

/* quote */
.quote { max-width: 82%; }
.quote blockquote { font-size: 2.9cqw; line-height: 1.36; }
.quote blockquote[dir="rtl"] { font-size: 3cqw; line-height: 1.58; }
.qmark { font-size: 5.6cqw; margin-bottom: 1.6cqw; }
.qattr { margin-top: .4cqw; }

/* media: mirror for rtl */
.slide[data-dir="rtl"] .split { direction: rtl; }
.split { gap: 4.6cqw; }
.split .list { margin-block: 0; }
.split .item { font-size: 1.35cqw; padding: .55cqw 0; }
.split .title { font-size: 2.7cqw; }
.split .title[dir="rtl"] { font-size: 2.85cqw; }

/* full-bleed image caption */
.fcap .title { font-size: 3.6cqw; max-width: 76%; }
.fsub { font-size: 1.15cqw; }

/* closing */
.closing .ctitle.small { font-size: 4.6cqw; }

/* overview + viewer tweaks */
.vbar .spacer { min-width: 6px; }
label.tiny { font-size: 9.5px; letter-spacing: .14em; }
.pager .count { font-size: 11px; min-width: 62px; text-align: center; }

.deck[data-motion="off"] .slide { transition: none; }
/* cover layout: main block + meta in flow */
.cover { display: flex; flex-direction: column; }
.cmain { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0; }
.cmeta { position: static; margin: 0; padding-top: 1.6cqw; border-top: 1px solid var(--line); }

/* full-bleed image slides lose the content padding */
.slide.t-image { padding: 0; }
.slide.t-image .frame { padding: 0; }

/* closing: centered */
.closing { align-items: center; text-align: center; }
.closing .rule { margin: 0 auto 2.6cqw; transform-origin: center; }
.closing .csub { max-width: 70%; }

/* chart refinement */
.chart { margin-block: auto; max-width: 96%; }
.crow { grid-template-columns: 14cqw 1fr 6cqw; gap: 1.6cqw; padding: .62cqw 0; align-items: center; }
.ctrack { height: 1.15cqw; background: transparent; border-inline-start: 1px solid var(--line); }
.cbar { background: var(--accent); border-radius: 0 1px 1px 0; }
.chart[dir="rtl"] .cbar { border-radius: 1px 0 0 1px; transform-origin: right center; }
.chart[dir="rtl"] .ctrack { border-inline-start: 0; border-inline-end: 1px solid var(--line); }
.clab { font-size: 1.05cqw; }
.cval { font-weight: 500; }

/* ---- fill the frame ---- */
.title { font-size: 3.7cqw; }
.title[dir="rtl"] { font-size: 3.8cqw; }
.item { padding: .72cqw 0; line-height: 1.55; }
.tbl { font-size: 1.3cqw; }
.tbl th { font-size: .78cqw; padding: 0 .9cqw 1.35cqw 0; }
.tbl td { padding: 1.5cqw .9cqw 1.5cqw 0; }
.tablewrap { max-width: 100%; }
.snum { font-size: 5.6cqw; }
.stat { padding-top: 1.7cqw; }
.slab { font-size: 1.15cqw; margin-top: 1.3cqw; }
.ctrack { height: 1.4cqw; }
.crow { padding: .85cqw 0; }
.clab, .cval { font-size: 1.18cqw; }
.fcap { padding-bottom: 5.2cqw; }

/* centre the whole content block, not just the list */
.content { justify-content: center; }
.content > .list, .content > .stats, .content > .tablewrap, .content > .chart { margin-block: 0; }
.tbl td.num, .tbl th.num { text-align: start; }

/* compact toolbar so it stays on one line */
.vbar { flex-wrap: nowrap; overflow-x: auto; gap: 7px; }
.vbar::-webkit-scrollbar { height: 0; }
@media (max-width: 1500px) {
  .vbar .btn, .vbar select.btn { padding: 5px 7px; font-size: 11.5px; }
  .vbar .fname { max-width: 15ch; font-size: 11.5px; }
  .vbar .sub { display: none; }
  .vbar label.tiny { display: none; }
  .vbar .swatch { width: 13px; height: 13px; }
}
