/* motivation.khondon.io: a manuscript leaf with a gloss. Black ink for the words, red for
   the rubrics and the live values, gold for the night pages, as the old Arabic
   mathematical manuscripts were written. Three registers alternate: reading (parchment,
   with the margin carrying dates, Arabic names and topics), instrument (a working figure
   on its own tinted ground) and night (openers, quotations, plates). */
@font-face{font-family:'Li Subha Letterpress';src:url('../fonts/li-subha-letterpress.woff2') format('woff2');font-display:swap;unicode-range:U+0000-00FF,U+0980-09FF,U+200C-200D,U+0964-0965}
@font-face{font-family:'Figgins Pica';src:url('../fonts/figgins-pica.woff2') format('woff2');font-display:swap;unicode-range:U+0000-00FF}

:root{
  --paper:#f2ead7; --paper-2:#e7dcc4; --leaf:#f8f3e6;
  --ink:#1a1712; --ink-2:#463e33; --ink-3:#6b6253; --gloss:#5a4e3c; --rule:#d2c3a1; --rule-2:#b9a77f;
  --red:#ad2f1b; --red-2:#c83c26; --red-wash:rgba(200,60,38,.12);
  --lapis:#2a4c7d;
  --night:#0c0f0e; --night-2:#141917; --chalk:#ebe6dc; --chalk-2:#a7a196;
  --gold:#c9a35a; --gold-2:#e2c88f;
  --f-head:'Li Subha Letterpress','Tiro Bangla','Noto Serif Bengali',serif;
  --f-body:'Tiro Bangla','Noto Serif Bengali',serif;
  --f-ar:'Amiri','Noto Naskh Arabic','Geeza Pro',serif;
  --f-en:'Figgins Pica',Georgia,serif;
  --gut:clamp(1rem,4.5vw,3rem);
  color-scheme:light;
}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth;scroll-padding-top:4rem}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
body{
  margin:0;background:var(--paper);color:var(--ink);
  font-family:var(--f-body);font-size:clamp(1.06rem,1rem + .25vw,1.2rem);line-height:1.72;
  overflow-x:hidden;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .28 0 0 0 0 .18 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection{background:var(--red-2);color:#fff}
a{color:inherit;text-decoration-color:var(--rule-2);text-decoration-thickness:1px;text-underline-offset:.2em}
a:hover{text-decoration-color:currentColor}
[lang=ar],.ar{font-family:var(--f-ar);font-size:1.12em;line-height:1.6}
b,strong{font-weight:700}
p{margin:0 0 .95em}

/* ---- the grid: margin gloss, text, and a wide run on the right. One column on phones. */
.chap,.hero,.toc,.end,.sources,.foot{
  display:grid;
  grid-template-columns:[full-start] var(--gut) [wide-start gloss-start text-start side-start] minmax(0,1fr) [gloss-end text-end side-end wide-end] var(--gut) [full-end];
}
@media (min-width:1100px){
  .chap,.hero,.toc,.end,.sources,.foot{
    grid-template-columns:[full-start] minmax(var(--gut),1fr) [wide-start gloss-start] 12rem [gloss-end] 3rem [text-start] minmax(0,38rem) [text-end] 3rem [side-start] 12rem [side-end wide-end] minmax(var(--gut),1fr) [full-end];
  }
}
.chap > *,.toc > *,.sources > *,.foot > *{grid-column:gloss-start/text-end}
.night-band{background:var(--night);color:var(--chalk)}

/* ---- top bar */
.bar{position:sticky;top:0;z-index:40;display:flex;align-items:center;gap:.7rem;padding:.55rem var(--gut);
  background:rgba(12,15,14,.94);backdrop-filter:blur(6px);color:var(--chalk);font-size:.9rem}
.bar .mark{width:28px;height:28px;flex:none}
.bar .wm{font-family:var(--f-en);font-size:1rem;letter-spacing:.01em}
.bar .wm b{color:#ff3b2f;font-weight:400}
.bar nav{margin-left:auto;display:flex;gap:.1rem;overflow-x:auto;scrollbar-width:none}
.bar nav::-webkit-scrollbar{display:none}
.bar nav a{color:var(--chalk-2);text-decoration:none;padding:.25rem .55rem;white-space:nowrap;transition:color .2s}
.bar nav a:hover{color:#fff}
.bar nav a.on{color:var(--gold-2)}
.bar .prog{position:absolute;left:0;bottom:0;height:2px;width:100%;background:var(--gold);transform-origin:0 50%;transform:scaleX(var(--p,0))}
@media (max-width:760px){.bar nav{display:none}}

/* ---- the star patterns */
[data-w=pattern]{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.pattern{position:absolute;inset:0;width:100%;height:100%}
.pat-line{fill:none;stroke:var(--gold);stroke-width:1.1;stroke-linejoin:round;stroke-linecap:round;vector-effect:non-scaling-stroke;
  stroke-dasharray:var(--len,3000);stroke-dashoffset:var(--len,3000)}
.pattern.live .pat-line{animation:draw 2.2s cubic-bezier(.3,.1,.2,1) forwards}
@keyframes draw{to{stroke-dashoffset:0}}
@media (prefers-reduced-motion:reduce){.pat-line,.pattern.live .pat-line{animation:none;stroke-dashoffset:0}}

/* ---- hero: night, the title on the left, al-Kashi's illuminated folio running off the right edge */
.hero{position:relative;background:var(--night);color:var(--chalk);overflow:hidden;
  min-height:min(92svh,880px);align-content:center;padding:clamp(3.5rem,8vh,5.5rem) 0 clamp(3rem,7vh,4.5rem)}
.hero .pattern{opacity:.26;-webkit-mask-image:linear-gradient(90deg,#000 0,rgba(0,0,0,.6) 40%,transparent 62%);mask-image:linear-gradient(90deg,#000 0,rgba(0,0,0,.6) 40%,transparent 62%)}
.hero-in{grid-column:gloss-start/text-end;position:relative;z-index:2;max-width:34rem}
.kick{font-size:.9rem;line-height:1.5;color:var(--gold);margin:0 0 1.4rem}
.hero .ar-line{font-family:var(--f-ar);font-size:clamp(1.9rem,1.3rem + 2vw,3.1rem);line-height:1.45;color:var(--gold-2);margin:0;text-align:left}
.ar-cite{font-size:.85rem;color:var(--chalk-2);margin:.2rem 0 2rem}
.hero h1{font-family:var(--f-head);font-weight:400;font-size:clamp(3rem,1.9rem + 4.4vw,6rem);line-height:1.04;margin:0 0 1.6rem}
.hero .lede{font-size:clamp(1.06rem,1rem + .35vw,1.25rem);line-height:1.62;color:#d6d0c3;margin:0}
.hero-plate{margin:0;position:relative;z-index:1}
.hero-plate .hp-frame{overflow:hidden}
.hero-plate img{display:block;width:100%;height:auto}
.hero-plate figcaption{font-size:.78rem;line-height:1.5;color:var(--chalk-2);margin-top:.8rem;max-width:30rem}
.hero-plate figcaption p{margin:0 0 .2rem}
.hero-plate .credit a{color:var(--chalk-2);text-decoration-color:rgba(255,255,255,.2)}
@media (min-width:1100px){
  .hero-plate{position:absolute;right:-6vw;top:50%;width:min(50vw,900px);transform:translateY(-50%)}
  .hero-plate img{animation:settle 9s cubic-bezier(.2,.6,.2,1) both;transform-origin:30% 50%}
  .hero-plate figcaption{padding-left:2px}
}
@keyframes settle{from{transform:scale(1.07)}to{transform:none}}
@media (prefers-reduced-motion:reduce){.hero-plate img{animation:none}}
@media (max-width:1099px){.hero-plate{grid-column:wide-start/wide-end;grid-row:1;margin:0 0 2.4rem}.hero-in{grid-row:2}}

/* ---- contents: a chronology of the chapters across the centuries */
.toc{padding:clamp(3rem,7vh,4.5rem) 0 1rem}
.toc > *{grid-column:gloss-start/wide-end}
.toc-h{font-family:var(--f-head);font-size:1.6rem;margin:0 0 1rem}
.chrono{display:grid;grid-template-columns:subgrid;border-top:2px solid var(--ink)}
.axis,.row{grid-column:gloss-start/wide-end;display:grid;grid-template-columns:subgrid;align-items:center}
.axis{border-bottom:1px solid var(--rule-2)}
.axis-l{grid-column:gloss-start/gloss-end;font-size:.78rem;color:var(--ink-3)}
.axis-t{grid-column:text-start/wide-end;position:relative;height:2.2rem}
.axis-t i{position:absolute;top:.55rem;transform:translateX(-50%);font-style:normal;font-size:.8rem;color:var(--ink-3)}
.row{text-decoration:none;border-bottom:1px solid var(--rule);padding:.5rem 0;transition:background .2s}
.row:hover{background:var(--leaf)}
.rl{grid-column:gloss-start/gloss-end;font-family:var(--f-head);font-size:1.15rem;line-height:1.25}
.rl b{display:inline-block;min-width:1.6rem;color:var(--ink-3);font-weight:400}
.rl small{display:block;font-family:var(--f-body);font-size:.74rem;color:var(--ink-3);padding-left:1.6rem}
.rt{grid-column:text-start/wide-end;position:relative;height:2rem;
  background:repeating-linear-gradient(90deg,transparent 0,transparent calc(100%/15 - 1px),var(--rule) calc(100%/15 - 1px),var(--rule) calc(100%/15))}
.rt i{position:absolute;top:.72rem;height:.56rem;background:var(--ink);transition:background .2s}
.rt i.faint{background:repeating-linear-gradient(90deg,var(--rule-2) 0 6px,transparent 6px 10px)}
.row:hover .rt i{background:var(--red)}
.row:hover .rt i.faint{background:repeating-linear-gradient(90deg,var(--red) 0 6px,transparent 6px 10px)}
@media (max-width:1099px){.axis-l{display:none}.rl small{display:inline;padding-left:.6rem}.rt{height:1.4rem}.rt i{top:.4rem}}
.toc-key{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem 1.4rem;margin:1.2rem 0 0;font-size:.88rem;color:var(--ink-2)}
.toc-key > span:first-child{color:var(--ink-3)}
.toc-key .k{display:inline-flex;align-items:center;gap:.45rem}
.glyph{width:18px;height:18px;flex:none;color:var(--ink-2)}

/* ---- chapters: each opens on night with its numeral whole in the margin and a gold drawing of its own mathematics */
.chap{padding:0 0 2rem}
.chap-head{grid-column:full-start/full-end;display:grid;grid-template-columns:subgrid;position:relative;overflow:hidden;
  background:var(--night);color:var(--chalk);min-height:27rem;align-content:end;align-items:end;
  padding:clamp(4rem,9vh,5.5rem) 0 clamp(3rem,7vh,4rem);margin:0 0 clamp(4rem,9vh,5.5rem)}
.chap-num{grid-column:gloss-start/gloss-end;grid-row:1;margin:0 0 -.12em;font-family:var(--f-head);font-size:clamp(7rem,4rem + 6vw,11.5rem);line-height:.9;color:var(--gold)}
.chap-t{position:relative;grid-column:text-start/text-end;grid-row:1;max-width:31rem}
.chap-n{font-size:.92rem;line-height:1.5;color:var(--gold);margin:0 0 1rem}
.chap-n span{display:block}
.chap h2{font-family:var(--f-head);font-weight:400;font-size:clamp(2.8rem,1.8rem + 3.4vw,5rem);line-height:1.06;margin:0 0 1.1rem}
.chap .dek{color:#cfc9bc;font-size:1.12em;line-height:1.55;margin:0}
@media (min-width:1100px){.chap-num{text-align:right;padding-right:.15em}}
.emb{position:absolute;right:max(var(--gut),calc(50vw - 39rem));top:50%;transform:translateY(-50%);width:min(25vw,22rem);height:auto;overflow:visible}
.emb .ln{fill:none;stroke:var(--gold);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke;stroke-dasharray:1;stroke-dashoffset:1}
.emb .ln.dash{stroke-dasharray:.03 .025;stroke-dashoffset:0;opacity:0}
.emb .ln.red{stroke:#e0664f}
.emb .fl{fill:var(--gold);opacity:0}
.emb .dot{fill:var(--gold);opacity:0}
.emb .tx{fill:var(--gold-2);font-family:var(--f-body);font-size:17px;opacity:0}
.emb .tx.big{font-family:var(--f-head);font-size:64px}
.emb .tx.sm{font-size:14px;fill:var(--chalk-2)}
.emb .tx.red{fill:#e0664f}
.emb .gly{opacity:0;color:var(--gold)}
.emb .gly *{vector-effect:non-scaling-stroke;stroke-width:1.6}
.chap-head.live .emb .ln{animation:dash 1.5s cubic-bezier(.4,.1,.2,1) forwards}
.chap-head.live .emb .ln.dash{animation:fade .8s ease-out forwards}
.chap-head.live .emb .fl{animation:fade-35 .8s ease-out forwards}
.chap-head.live .emb .dot,.chap-head.live .emb .tx,.chap-head.live .emb .gly{animation:fade .8s ease-out forwards}
@keyframes fade-35{to{opacity:.35}}
@media (prefers-reduced-motion:reduce){.emb .ln{stroke-dashoffset:0}.emb .ln.dash,.emb .dot,.emb .tx,.emb .gly{opacity:1}.emb .fl{opacity:.35}.chap-head.live .emb *{animation:none!important}}
@media (max-width:1099px){
  .chap-head{min-height:0;padding-top:3rem;align-items:start}
  .chap-num{grid-column:text-start/text-end;grid-row:1;font-size:6.5rem;margin:0 0 .6rem}
  .chap-t{grid-row:2}
  .emb{display:none}
}

/* the gloss: the margin of the leaf */
.gl{font-size:.875rem;line-height:1.45;color:#4a4438}
.gl p{margin:0 0 .55rem}
.sec{font-family:var(--f-head);font-size:1.3rem;line-height:1;color:var(--red);margin:0 0 .7rem}
.when span,.yr span{display:block}
.yr{font-family:var(--f-head);font-size:1.25rem;line-height:1.3;color:var(--ink)}
.gl-ar{font-family:var(--f-ar);font-size:2rem;line-height:1.35;color:var(--ink);margin:.4rem 0 .7rem!important;text-align:left}
.topics{list-style:none;margin:.3rem 0 .7rem;padding:0;display:flex;flex-direction:column;gap:.35rem}
.topics li{display:inline-flex;align-items:center;gap:.5rem}
.fig-n{font-family:var(--f-head);color:var(--red);font-size:1.05rem;margin:0 0 .4rem}

/* a beat: gloss beside, heading and body in the text column */
.beat{grid-column:gloss-start/text-end;display:grid;grid-template-columns:subgrid;margin:0 0 clamp(4rem,9vh,6rem)}
.beat > h3{grid-column:text-start/text-end;font-family:var(--f-head);font-weight:400;font-size:clamp(1.65rem,1.25rem + 1.2vw,2.3rem);line-height:1.2;margin:0 0 1.1rem}
.beat > .bd{grid-column:text-start/text-end}
.bd p{position:relative}
.bd p:last-child{margin-bottom:0}
@media (min-width:1100px){
  .beat > .gl{grid-column:gloss-start/gloss-end;grid-row:1 / span 2;padding-top:.35rem}
  .beat > h3{grid-row:1}
  .beat > .bd{grid-row:2}
}
@media (max-width:1099px){
  .beat > .gl{display:flex;flex-wrap:wrap;align-items:baseline;gap:.1rem 1rem;grid-column:text-start/text-end;margin-bottom:.5rem}
  .beat > .gl > *{margin:0!important}
  .beat .gl-ar{font-size:1.5rem;flex-basis:100%}
  .beat .topics{flex-direction:row;gap:.2rem .9rem}
  .when span{display:inline}.when span + span::before{content:' · '}
}
/* the rubric: one line a chapter, marked in the margin the way a scribe marks it */
mark{background:none;color:inherit;padding:0;text-decoration:underline;text-decoration-color:rgba(173,47,27,.5);text-decoration-thickness:2px;text-underline-offset:.3em;text-decoration-skip-ink:none}
mark::before{content:'';position:absolute;left:-1.7rem;width:.5rem;height:.5rem;margin-top:.68em;background:var(--red);transform:rotate(45deg)}
@media (max-width:1099px){mark::before{left:-.7rem;width:.34rem;height:.34rem}}
.people{display:contents}

/* references: a number at the end of a passage; it opens a card of titles */
.cite{position:relative;display:inline}
@media (min-width:1100px){
  .bd p:last-child .cite{position:absolute;left:calc(100% + 2rem);bottom:.2em;width:8.5rem;display:block;line-height:1.3}
  .bd p:last-child .cite-b{font-size:.8rem;vertical-align:baseline;margin:0;padding:0;color:var(--ink-2);text-align:left;line-height:1.45;border-bottom:1px solid var(--rule-2)}
  .bd p:last-child .cite-b::before{content:'রেফারেন্স ';color:var(--ink-3)}
  .bd p:last-child .cite-b:hover,.bd p:last-child .cite-b[aria-expanded=true]{color:var(--red);border-color:var(--red)}
  .bd p:last-child .card{left:auto;right:0;top:auto;bottom:calc(100% + .5rem)}
  .bd p:last-child .card::before{top:auto;bottom:-.7rem}
}
.cite-b{font:inherit;font-size:.66em;line-height:1;vertical-align:.55em;color:var(--red);background:none;border:0;border-bottom:1px solid transparent;padding:.1em .1em;margin-inline-start:.2em;cursor:pointer}
.cite-b:hover,.cite-b[aria-expanded=true]{border-bottom-color:currentColor}
.cite-b:focus-visible{outline:2px solid var(--red-2);outline-offset:2px}
.card{position:absolute;left:-1rem;top:calc(100% + .5rem);z-index:30;width:min(25rem,86vw);display:none;text-align:left;
  background:var(--leaf);color:var(--ink-2);border-top:2px solid var(--ink);box-shadow:0 18px 40px -16px rgba(20,14,4,.45),0 0 0 1px rgba(26,23,18,.12);
  padding:.8rem 1rem .9rem;font-family:var(--f-body);font-size:.8rem;line-height:1.45;font-style:normal;letter-spacing:0}
.card::before{content:'';position:absolute;left:0;right:0;top:-.7rem;height:.7rem}
.cite:hover .card,.cite-b[aria-expanded=true] + .card{display:block}
.card-h{display:block;font-family:var(--f-head);font-size:.95rem;color:var(--red);margin-bottom:.4rem}
.ci{display:grid;grid-template-columns:1.9rem 1fr;gap:.2rem;margin:.3rem 0}
.ci-n{color:var(--ink-3);text-decoration:none}
.ci a{color:var(--ink-2)}
@media (max-width:760px){.card{position:fixed;left:.75rem;right:.75rem;bottom:.75rem;top:auto;width:auto;max-height:60vh;overflow:auto}}

/* the ayah: framed and centred on the leaf */
.ayah{grid-column:text-start/text-end;margin:0 0 clamp(4rem,9vh,5.5rem);padding:2.2rem 1.5rem 1.8rem;text-align:center;
  border-top:1px solid var(--ink);border-bottom:1px solid var(--ink);position:relative}
.ayah::before,.ayah::after{content:'';position:absolute;left:0;right:0;height:1px;background:var(--ink)}
.ayah::before{top:4px}.ayah::after{bottom:4px}
.ayah .ar{display:block;font-size:clamp(1.5rem,1.1rem + 1.5vw,2.5rem);line-height:1.6;color:var(--ink);margin:0 0 1rem}
.ayah cite{font-style:normal;font-size:.88rem;color:var(--ink-3);display:block}

/* a quotation: set on the leaf against a red rule at the edge of the text column */
.pull{grid-column:gloss-start/wide-end;display:grid;grid-template-columns:subgrid;margin:0 0 clamp(4rem,9vh,5.5rem)}
.pull-t{grid-column:text-start/wide-end;border-left:2px solid var(--red);padding:.3rem 0 .3rem 1.6rem;margin-left:calc(-1.6rem - 2px)}
.pull-t p{font-family:var(--f-body);font-size:clamp(1.3rem,1.05rem + .8vw,1.65rem);line-height:1.6;margin:0 0 1.1rem;color:var(--ink);max-width:40rem}
.pull-t cite{display:block;font-style:normal;font-size:.9rem;line-height:1.55;color:var(--ink-3);max-width:37rem}
@media (max-width:1099px){.pull-t{margin-left:0;padding-left:1rem}}

/* ---- plates: archival pages laid into the leaf, the caption in the margin, the big folios running off the right edge */
.plate{grid-column:gloss-start/full-end;display:grid;grid-template-columns:subgrid;margin:0 0 clamp(4rem,9vh,5.5rem);align-items:end}
.plate .frame{grid-column:text-start/text-end;grid-row:1;overflow:hidden;box-shadow:0 0 0 1px #cbbf9f}
.plate-text .frame{justify-self:start;max-width:100%}
.plate-bleed .frame{grid-column:text-start/full-end;box-shadow:none;border-top:1px solid #cbbf9f;border-bottom:1px solid #cbbf9f;border-left:1px solid #cbbf9f}
.plate .zoom{position:relative;transform-origin:var(--focus,50% 50%);transition:transform 8s cubic-bezier(.25,.1,.2,1)}
.plate img{display:block;width:100%;height:auto;mix-blend-mode:multiply}
.plate-text img{width:auto;max-width:100%}
.plate.live[style*='--focus'] .zoom{transform:scale(1.14)}
.plate .marks{position:absolute;inset:0;width:100%;height:100%}
.plate .marks rect{fill:none;stroke:var(--red);stroke-width:2.4;vector-effect:non-scaling-stroke;stroke-dasharray:1;stroke-dashoffset:1}
.plate.live .marks rect{animation:dash 1.4s cubic-bezier(.4,.1,.2,1) forwards}
@media (prefers-reduced-motion:reduce){.plate .zoom{transition:none}.plate.live .zoom{transform:none}.plate .marks rect{stroke-dashoffset:0}}
.plate .gl{grid-column:gloss-start/gloss-end;grid-row:1;margin:0}
.plate .gl p{margin:0 0 .5rem}
.credit{font-size:.76rem;color:var(--ink-3)}
.credit a{text-decoration-color:var(--rule)}
@media (max-width:1099px){.plate{grid-column:wide-start/wide-end}.plate .frame,.plate-bleed .frame{grid-column:text-start/text-end;border-right:1px solid #cbbf9f}.plate .gl{grid-column:text-start/text-end;grid-row:2;margin-top:.9rem}}

/* ---- the working figures: instruments on their own tinted ground, numbered in the margin */
.w{grid-column:full-start/full-end;display:grid;grid-template-columns:subgrid;background:var(--paper-2);
  margin:0 0 clamp(4rem,9vh,6rem);padding:clamp(2.8rem,6vh,3.8rem) 0 clamp(3rem,6vh,4rem);align-items:start;
  border-top:1px solid var(--rule-2);border-bottom:1px solid var(--rule-2)}
.w > .gl{grid-column:gloss-start/gloss-end;grid-row:1}
.w > .gl h4{font-family:var(--f-head);font-weight:400;font-size:1.45rem;line-height:1.25;margin:0 0 .6rem;color:var(--ink)}
.w > .w-body{grid-column:text-start/wide-end;grid-row:1}
@media (max-width:1099px){.w > .gl{grid-column:text-start/text-end}.w > .w-body{grid-row:2;grid-column:text-start/text-end;margin-top:1.2rem}}
.w-body.two,.w-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:clamp(1.2rem,3vw,2.6rem);align-items:start}
@media (max-width:700px){.w-body.two,.w-grid{grid-template-columns:1fr}}
.w-side > *:first-child{margin-top:0}
.ink-svg{width:100%;height:auto;display:block;overflow:visible}
.w-say{border-left:2px solid var(--red);padding:.15rem 0 .15rem 1rem;margin:1rem 0;min-height:4.6em;font-size:.98rem}
.w-eq{font-size:1.1em;margin:0 0 .8rem}
.w-mini{font-size:.88rem;color:var(--ink-3);margin:.3rem 0}
.w-err{color:var(--red)}

/* controls: the label over a long track, the value to the right */
.ctl{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"l o" "r r";align-items:end;gap:0 .8rem;margin:.7rem 0 .1rem;font-size:.92rem}
.ctl-l{grid-area:l;color:var(--ink-2);line-height:1.3}
.ctl output{grid-area:o;text-align:right;font-family:var(--f-head);font-size:1.45rem;line-height:1;color:var(--red)}
.ctl input{grid-area:r}
input[type=range]{-webkit-appearance:none;appearance:none;width:100%;height:44px;margin:0;cursor:pointer;--p:50%;
  background:repeating-linear-gradient(90deg,var(--ink-3) 0 1px,transparent 1px 10%) 0 calc(50% + 7px)/100% 5px no-repeat}
input[type=range]::-webkit-slider-runnable-track{height:1px;background:linear-gradient(90deg,var(--red) var(--p),var(--ink-3) var(--p))}
input[type=range]::-moz-range-track{height:1px;background:linear-gradient(90deg,var(--red) var(--p),var(--ink-3) var(--p))}
input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:17px;height:17px;margin-top:-8px;border-radius:2px;background:var(--red);border:0;transform:rotate(45deg);box-shadow:0 0 0 4px var(--paper-2);transition:transform .15s}
input[type=range]::-moz-range-thumb{width:15px;height:15px;border-radius:2px;background:var(--red);border:0;transform:rotate(45deg)}
input[type=range]:hover::-webkit-slider-thumb{transform:rotate(45deg) scale(1.15)}
input[type=range]:focus-visible{outline:none}
input[type=range]:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 4px var(--paper-2),0 0 0 6px var(--red)}
.num-in{font-family:var(--f-head);font-size:2.6rem;line-height:1.2;width:100%;max-width:16rem;padding:.1rem 0;border:0;border-bottom:2px solid var(--ink);border-radius:0;background:transparent;color:var(--ink)}
.num-in:focus{outline:none;border-bottom-color:var(--red)}
/* segmented buttons */
.steps,.seg{display:flex;flex-wrap:wrap;margin:.6rem 0}
.steps button,.seg button,.ar-btn{font:inherit;font-size:.9rem;padding:.4rem .85rem;border:1px solid var(--ink-3);background:transparent;cursor:pointer;color:var(--ink);min-height:42px;border-radius:0;margin:0 -1px -1px 0;transition:background .15s,color .15s}
.steps button[aria-pressed=true],.seg button[aria-pressed=true]{background:var(--ink);color:var(--paper);border-color:var(--ink);position:relative;z-index:1}
.steps button:hover:not([aria-pressed=true]),.seg button:hover:not([aria-pressed=true]){background:var(--leaf)}
.steps button.go,.btn-go{margin-left:.8rem;border:0;border-bottom:1px solid var(--red);color:var(--red);padding:.4rem .1rem;background:none;font:inherit;font-size:.92rem;cursor:pointer;min-height:42px}
.btn-go{margin-left:0}
.steps button.go:hover,.btn-go:hover{background:none;color:var(--red-2)}
.btn-go[disabled]{color:var(--ink-3);border-color:var(--rule-2);cursor:default}
.steps button:focus-visible,.seg button:focus-visible,.btn-go:focus-visible{outline:2px solid var(--red-2);outline-offset:2px}
.ar-btn{font-family:var(--f-ar);font-size:1.25rem;padding:.1rem .9rem}

/* svg ink */
.ink-svg .sq{fill:rgba(26,23,18,.06);stroke:var(--ink);stroke-width:2.2}
.ink-svg .rc{fill:rgba(173,47,27,.09);stroke:var(--ink);stroke-width:2}
.ink-svg .cn{fill:var(--red-wash);stroke:var(--red);stroke-width:2.2}
.ink-svg .ghost{fill:none;stroke:var(--rule-2);stroke-width:1.2;stroke-dasharray:4 6}
.ink-svg .gap{fill:none;stroke:var(--red);stroke-width:1.6;stroke-dasharray:6 6}
.ink-svg .dim{stroke:var(--red);stroke-width:2;fill:none}
.ink-svg text,.ink-svg .lab{font-family:var(--f-body);font-size:19px;fill:var(--ink)}
.ink-svg .lab.big{font-size:28px}
.ink-svg .lab.side{fill:var(--ink-2)}
.ink-svg .lab.red{fill:var(--red);font-weight:700}
.ink-svg .lab.small{font-size:15px;fill:var(--ink-3)}
.ink-svg .enter{animation:enter .7s cubic-bezier(.2,.7,.2,1) both;transform-box:fill-box}
.ink-svg .enter.from-left{transform-origin:0 50%}
.ink-svg .enter.from-top{transform-origin:50% 0}
.ink-svg .enter.from-tl{transform-origin:0 0}
@keyframes enter{from{opacity:0;transform:scale(.001,1)}to{opacity:1;transform:none}}
.ink-svg .enter.from-top{animation-name:enter-y}
.ink-svg .enter.from-tl{animation-name:enter-xy}
@keyframes enter-y{from{opacity:0;transform:scale(1,.001)}to{opacity:1;transform:none}}
@keyframes enter-xy{from{opacity:0;transform:scale(.2)}to{opacity:1;transform:none}}
.ink-svg .fade{animation:fade .6s ease-out both}
@keyframes fade{from{opacity:0}to{opacity:1}}
.ink-svg .draw-on{stroke-dasharray:1;stroke-dashoffset:1;animation:dash 1.2s cubic-bezier(.4,.1,.2,1) forwards}
@keyframes dash{to{stroke-dashoffset:0}}
@media (prefers-reduced-motion:reduce){.ink-svg .enter,.ink-svg .fade{animation:none}.ink-svg .draw-on{animation:none;stroke-dashoffset:0}}
.ink-svg .cell circle{fill:var(--paper);stroke:var(--ink-3);stroke-width:1.4;cursor:pointer;transition:fill .25s,stroke .25s}
.ink-svg .cell text{font-size:17px;pointer-events:none;transition:fill .25s}
.ink-svg .cell:hover circle{stroke:var(--red)}
.ink-svg .cell.on circle{fill:var(--red-2);stroke:var(--red)}
.ink-svg .cell.on text{fill:#fff;font-weight:700}
.ink-svg .cell.par circle{fill:var(--red-wash);stroke:var(--red)}
.ink-svg .cell:focus{outline:none}
.ink-svg .cell:focus-visible circle{stroke:var(--red);stroke-width:3}
.ink-svg .earth{fill:rgba(26,23,18,.04);stroke:var(--ink);stroke-width:2.4}
.ink-svg .mount{fill:rgba(26,23,18,.12);stroke:var(--ink);stroke-width:2}
.ink-svg .hz{stroke:var(--ink-3);stroke-width:1.4;stroke-dasharray:5 6}
.ink-svg .sight{stroke:var(--red);stroke-width:2.2}
.ink-svg .rad{stroke:var(--ink-3);stroke-width:1.4}
.ink-svg .ang{fill:none;stroke:var(--red);stroke-width:2}
.ink-svg .circ{fill:none;stroke:var(--ink-3);stroke-width:1.6}
.ink-svg .poly{fill:var(--red-wash);stroke:var(--red);stroke-width:1.6;stroke-linejoin:round;transition:d .4s}
.ink-svg .dial{fill:var(--leaf);stroke:var(--ink);stroke-width:2}
.ink-svg .tick{stroke:var(--ink-3);stroke-width:1.2}
.ink-svg .needle-g{transition:transform 1.1s cubic-bezier(.3,1.3,.4,1)}
.ink-svg .needle{stroke:var(--red);stroke-width:4;stroke-linecap:round}
.ink-svg .needle-dot{fill:var(--red)}
.ink-svg .west{stroke:var(--ink-3);stroke-width:1.2;stroke-dasharray:4 5}
.ink-svg .globe{fill:var(--leaf);stroke:var(--ink);stroke-width:2}
.ink-svg .grat{fill:none;stroke:var(--rule);stroke-width:1}
.ink-svg .gc{fill:none;stroke:var(--red);stroke-width:3;stroke-linecap:round}

/* numerals */
.num-rows{margin:1.2rem 0;display:grid}
.num-row{display:grid;grid-template-columns:minmax(7rem,11rem) 1fr;align-items:baseline;gap:1rem;padding:.45rem 0;border-bottom:1px solid var(--rule)}
.num-row:first-child{border-top:1px solid var(--rule)}
.num-k{color:var(--ink-3);font-size:.88rem}
.num-v{font-family:var(--f-head);font-size:2.8rem;line-height:1.25;letter-spacing:.03em}
.num-v.ar{font-family:var(--f-ar);font-size:2.8rem}
.num-v.en,.num-v.ro{font-family:var(--f-body);font-size:2.4rem;letter-spacing:.06em}
.num-v.none{font-family:var(--f-body);font-size:1rem;color:var(--red)}
.num-place{color:var(--ink-2);font-size:.96rem}
.num-place b{color:var(--red)}

/* relations */
.rel-name{font-size:2.3rem;margin:1rem 0 .3rem;line-height:1.25}
.rel-name .ar{color:var(--ink-3);margin-inline-end:.4rem}
.rel-name b{color:var(--red);font-family:var(--f-head);font-weight:400}
.rel-v p{margin:.25rem 0}
.rel-math{font-size:1rem}
.rel-take{font-size:.92rem;color:var(--ink-2);border-left:2px solid var(--red);padding:.1rem 0 .1rem .9rem;margin-top:.7rem!important}
.rel-chain{margin:.3rem 0 1.2rem;padding-inline-start:1.6rem;font-size:.98rem;list-style-type:bengali}
.rel-chain li{animation:fade .4s ease-out both}
.rel-chain li.fin{color:var(--red);font-weight:700;break-inside:avoid}
.rel-bars{margin-top:.6rem}
.rel-lab{font-size:.84rem;color:var(--ink-3);margin-top:.6rem}
.rel-row{position:relative;height:30px;border-bottom:1.5px solid var(--ink-3)}
.rel-row .tick{position:absolute;bottom:-5px;width:10px;height:10px;border-radius:50%;background:var(--ink-2);transform:translateX(-5px);animation:fade .4s ease-out both}
.rel-row.b .tick{background:var(--lapis)}
.rel-row.b{border-color:var(--lapis)}
.rel-row .tick.meet{width:16px;height:16px;bottom:-8px;transform:translateX(-8px);background:var(--red);box-shadow:0 0 0 4px var(--red-wash)}
.rel-foot{font-size:.9rem;color:var(--red);margin:.6rem 0 0}

/* triangle */
.expand{display:block;margin-top:.4rem;font-size:.98rem;color:var(--ink-2)}

/* roots */
.root-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(6.5rem,1fr));gap:.5rem;margin:1rem 0;direction:rtl}
.root-c{border:1px dashed var(--rule);padding:.4rem .3rem;text-align:center;color:var(--ink-3)}
.root-c .ar{display:block;font-size:2rem;line-height:1.5}
.root-c small{display:block;font-family:var(--f-body);font-size:.8rem;direction:ltr}
.root-c.used{border:1.5px solid var(--red);color:var(--ink);background:var(--red-wash)}
.root-c.used small{color:var(--red)}

/* amicable */
.ami-out p,.ami-rule p{margin:.6rem 0;font-size:.98rem}
.ami-out .sum{color:var(--ink-2);word-break:break-word}
.hit{color:var(--red);font-weight:700}
.miss{color:var(--ink-3)}
.pr{color:var(--red)} .np{color:var(--ink-3)}

/* birds: a hundred marks, and the price against a hundred dirhams */
.flock{display:grid;grid-template-columns:repeat(20,1fr);gap:5px;margin:.4rem 0 1rem;max-width:30rem}
.flock i{aspect-ratio:1;border-radius:50%;transition:background .3s,border-color .3s,transform .3s}
.flock i.d{background:var(--red)}
.flock i.c{background:var(--ink)}
.flock i.s{border:1.5px solid var(--ink-3);transform:scale(.62)}
.flock i.x{background:none;border:1px dashed var(--rule-2)}
.flock-key{display:flex;flex-wrap:wrap;gap:.3rem 1.1rem;font-size:.84rem;color:var(--ink-2);margin:0 0 .8rem}
.flock-key i{display:inline-block;width:.75em;height:.75em;border-radius:50%;margin-inline-end:.35rem;vertical-align:-.05em}
.flock-key .d{background:var(--red)}.flock-key .c{background:var(--ink)}.flock-key .s{border:1.5px solid var(--ink-3);width:.55em;height:.55em}
.price{position:relative;height:38px;margin:2.6rem 0 .4rem;border-bottom:1.5px solid var(--ink-3)}
.price .bar-v{position:absolute;left:0;bottom:0;height:12px;background:var(--red);transition:width .35s cubic-bezier(.3,.7,.3,1)}
.price .bar-v.ok{background:var(--ink)}
.price .hundred{position:absolute;bottom:-6px;width:2px;height:44px;background:var(--ink);transform:translateX(-1px)}
.price .hundred span{position:absolute;bottom:100%;left:50%;transform:translateX(-50%);font-size:.78rem;color:var(--ink-2);white-space:nowrap}
.price-scale{display:flex;justify-content:space-between;font-size:.76rem;color:var(--ink-3)}

/* pi: the digits lock in, and a ledger of the doublings */
.pi-out{margin-top:1.6rem;padding-top:1.2rem;border-top:1px solid var(--rule-2)}
.pi-v{font-family:var(--f-head);font-size:clamp(1.15rem,3.9vw,3.1rem);line-height:1.2;white-space:nowrap;letter-spacing:.02em;margin:0 0 .4rem}
.pi-v .ok{color:var(--red)}
.pi-v .no{color:var(--rule-2)}
.pi-v .ok{transition:color .3s}
.pi-n{font-size:.95rem;margin:.6rem 0 0}
.ledger{margin:1rem 0 0;border-top:1px solid var(--rule);font-size:.86rem;font-variant-numeric:tabular-nums}
.ledger div{display:grid;grid-template-columns:2.5rem 1fr 1fr;gap:.6rem;padding:.22rem 0;border-bottom:1px solid var(--rule);color:var(--ink-3)}
.ledger div:last-child{color:var(--ink);animation:fade .35s ease-out both}
.ledger div span:last-child{text-align:right}

/* qibla */
.qib-pics{display:grid;grid-template-columns:1fr 1fr;gap:1.4rem;margin:1rem 0;max-width:640px}
@media (max-width:520px){.qib-pics{grid-template-columns:1fr}}
.qib-out p{margin:.3rem 0}

/* olympiad milestones */
.imo-say{min-height:3.4em;margin:1rem 0 0;font-size:1rem;border-left:2px solid var(--red);padding:.1rem 0 .1rem 1rem}
.ink-svg .imo-axis{stroke:var(--ink);stroke-width:1.6}
.ink-svg .imo-yr{font-size:15px;fill:var(--ink-3)}
.ink-svg .imo-ms{cursor:pointer}
.ink-svg .imo-ms circle{fill:var(--leaf);stroke:var(--ink);stroke-width:2;transition:fill .2s,r .2s}
.ink-svg .imo-ms.on circle,.ink-svg .imo-ms:hover circle{fill:var(--red);stroke:var(--red)}
.ink-svg .imo-ms text{font-size:17px}
.ink-svg .imo-ms .t2{font-size:14px;fill:var(--ink-3)}
.ink-svg .imo-ms:focus{outline:none}
.ink-svg .imo-ms:focus-visible circle{stroke-width:4}
.ink-svg .imo-stem{stroke:var(--rule-2);stroke-width:1.2}
.ink-svg .imo-bar{fill:var(--ink)}
.ink-svg .imo-bar.big{fill:var(--red)}
.ink-svg .imo-pop{opacity:0;animation:fade .5s ease-out forwards}

/* the four roads: each topic, and the passages on this page that belong to it */
.roads{grid-column:gloss-start/wide-end;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,13rem),1fr));margin:1rem 0 1rem;border-top:2px solid var(--ink)}
.road{padding:1.4rem 1.3rem 1.6rem 0}
.road + .road{padding-left:1.3rem;border-left:1px solid var(--rule)}
.road .glyph{width:44px;height:44px;color:var(--red)}
.road h3{font-family:var(--f-head);font-weight:400;font-size:1.75rem;margin:.7rem 0 .4rem}
.road > p{margin:0;font-size:.92rem;color:var(--ink-2);line-height:1.6}
.road-h{font-size:.76rem;color:var(--ink-3);margin:1.2rem 0 .3rem!important}
.road ul{list-style:none;margin:0;padding:0;font-size:.86rem;line-height:1.4}
.road li{padding:.4rem 0;border-top:1px solid var(--rule)}
.road li a{text-decoration:none;color:var(--ink)}
.road li a:hover{color:var(--red)}
@media (max-width:620px){.road + .road{padding-left:0;border-left:0;border-top:1px solid var(--rule)}}

/* ---- the end: night again, the last words at the size of the first */
.end{position:relative;overflow:hidden;background:var(--night);color:var(--chalk);padding:clamp(6rem,16vh,10rem) 0 clamp(4.5rem,11vh,7rem);margin-top:3rem}
.end .pattern{opacity:.32;-webkit-mask-image:linear-gradient(270deg,#000 0,rgba(0,0,0,.5) 45%,transparent 70%);mask-image:linear-gradient(270deg,#000 0,rgba(0,0,0,.5) 45%,transparent 70%)}
.end-in{grid-column:gloss-start/wide-end;position:relative}
.end h2{font-family:var(--f-head);font-weight:400;font-size:clamp(2.8rem,1.4rem + 4.4vw,5.6rem);line-height:1.06;margin:0 0 2.4rem}
.end p{color:#d6d0c3;max-width:37rem;margin-left:calc(11.5rem + 3rem)}
@media (max-width:1099px){.end p{margin-left:0}}
.ayah.night{grid-column:text-start/text-end;position:relative;margin:3rem 0 0;border-color:var(--gold)}
.ayah.night::before,.ayah.night::after{background:var(--gold)}
.ayah.night .ar{color:var(--gold-2)}
.ayah.night cite{color:var(--chalk-2)}
.ayah.night .cite-b{color:var(--gold-2)}

/* ---- every reference, grouped by chapter, in two columns */
.sources{padding:clamp(3.5rem,9vh,5.5rem) 0 3rem;font-size:.84rem;line-height:1.5;color:var(--ink-2)}
.sources > *{grid-column:gloss-start/wide-end}
.sources h2{font-family:var(--f-head);font-weight:400;font-size:2.2rem;color:var(--ink);margin:0 0 1.4rem;padding-bottom:.7rem;border-bottom:2px solid var(--ink)}
.src-g{display:grid;grid-template-columns:subgrid;padding:1rem 0;border-bottom:1px solid var(--rule)}
.src-g h3{grid-column:gloss-start/gloss-end;font-family:var(--f-head);font-weight:400;font-size:1rem;line-height:1.35;color:var(--ink);margin:0 0 .5rem}
.src-g h3 span{display:block}
.src-g h3 span:first-child{color:var(--red)}
.src-g ol{grid-column:text-start/wide-end;margin:0;padding-inline-start:2.2rem;columns:2 18rem;column-gap:2.6rem}
.src-g li{margin:0 0 .4rem;break-inside:avoid;scroll-margin-top:5rem;padding-left:.2rem}
.src-g li:target{background:var(--red-wash);box-shadow:0 0 0 4px var(--red-wash)}
.src-g li::marker{color:var(--ink-3);font-size:.95em}
.src-g a{text-decoration:none}
.src-g a:hover{text-decoration:underline;text-decoration-color:var(--rule-2)}
@media (max-width:1099px){.src-g h3,.src-g ol{grid-column:text-start/text-end}}

/* ---- colophon */
footer.foot{position:relative;overflow:hidden;background:var(--night);color:var(--chalk-2);padding:clamp(3.5rem,8vh,5rem) 0 clamp(4rem,9vh,5.5rem);font-size:.85rem}
.foot .pattern{opacity:.22;-webkit-mask-image:linear-gradient(270deg,#000 10%,transparent 60%);mask-image:linear-gradient(270deg,#000 10%,transparent 60%)}
.foot > p{position:relative;grid-column:gloss-start/text-end;margin:0 0 .6rem}
.colo{display:flex;align-items:center;gap:.9rem;font-family:var(--f-head);font-size:1.25rem;color:var(--chalk)}
.colo .mark{width:40px;height:40px;flex:none}
.imo-bars{margin-top:1.4rem;max-width:34rem}
.imo-b{display:grid;grid-template-columns:3.2rem 1fr;align-items:center;gap:.6rem;margin:.35rem 0;font-size:.88rem;color:var(--ink-2)}
.imo-b .bw{display:flex;align-items:center;gap:.6rem}
.imo-b i{display:block;height:14px;background:var(--ink);min-width:3px}
.imo-b i.big{background:var(--red)}
.imo-b b{font-family:var(--f-head);font-weight:400;font-size:1.2rem;color:var(--ink)}

/* results in the figures, set large */
.bir-out .big-v,.qib-out .big-v{display:block;font-family:var(--f-head);font-weight:400;font-size:clamp(1.8rem,1.4rem + 1vw,2.3rem);line-height:1.15;color:var(--red);margin:.2rem 0 .3rem}
.bird-out p:nth-child(2) b{font-family:var(--f-head);font-weight:400;font-size:1.7rem;color:var(--ink)}
.bird-out p:nth-child(2) b.hit{color:var(--red)}
.ami-out .hit,.ami-rule .hit{font-family:var(--f-head);font-weight:400;font-size:1.3rem}
.pi-n b{font-family:var(--f-head);font-weight:400;font-size:1.5rem}
.loupe{margin-top:1rem}
.loupe .lp-arc{fill:var(--red-wash);stroke:var(--ink-3);stroke-width:1.6}
.loupe .lp-chord{stroke:var(--red);stroke-width:2.4}
.loupe .lp-v{fill:var(--red)}
/* amicable: the two numbers and the divisors that carry one to the other */
.ami-flow{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.4rem 1rem;margin:1rem 0 .4rem}
.ami-n{font-family:var(--f-head);font-size:clamp(2.2rem,1.6rem + 1.6vw,3.2rem);line-height:1;color:var(--ink)}
.ami-n.back{color:var(--red)}
.ami-arrow{position:relative;height:2px;background:var(--ink-3)}
.ami-arrow::after{content:'';position:absolute;right:-1px;top:-4px;border:5px solid transparent;border-left:8px solid var(--ink-3);border-right:0}
.ami-chips{display:flex;flex-wrap:wrap;gap:.3rem;margin:.2rem 0 .6rem}
.ami-chips i{font-style:normal;font-size:.8rem;line-height:1;padding:.32rem .45rem;border:1px solid var(--rule-2);border-radius:999px;background:var(--leaf);animation:fade .35s ease-out both}

/* the four topics as one matrix */
.mx{grid-column:gloss-start/wide-end;margin:1rem 0 1rem;border-top:2px solid var(--ink);font-size:.86rem}
.mx-r{display:grid;grid-template-columns:minmax(0,1fr) repeat(4,minmax(0,8.6rem));align-items:center;border-bottom:1px solid var(--rule)}
.mx-h{align-items:start;border-bottom:1px solid var(--ink)}
.mx-h .mx-c{display:flex;flex-direction:column;align-items:center;text-align:center;padding:1rem .5rem 1.1rem;gap:.35rem}
.mx-h .glyph{width:34px;height:34px;color:var(--red)}
.mx-h b{font-family:var(--f-head);font-weight:400;font-size:1.25rem;color:var(--ink)}
.mx-h small{font-size:.74rem;line-height:1.4;color:var(--ink-3)}
.mx-l{display:block;padding:.45rem .8rem .45rem 0;text-decoration:none;color:var(--ink);line-height:1.35}
.mx-l span{display:inline-block;min-width:2.6rem;font-family:var(--f-head);color:var(--red)}
a.mx-l:hover{color:var(--red)}
.mx-r:not(.mx-h):hover{background:var(--leaf)}
.mx-c{display:flex;justify-content:center;border-left:1px solid var(--rule);align-self:stretch;align-items:center}
.mx-c i{width:11px;height:11px;background:var(--ink);transform:rotate(45deg)}
@media (max-width:760px){.mx-r{grid-template-columns:minmax(0,1fr) repeat(4,2.4rem)}.mx-h small,.mx-h b{display:none}.mx-h .glyph{width:22px;height:22px}}

/* the bar: which chapter, and where it falls in the centuries */
.bar .where{display:flex;align-items:center;gap:.7rem;margin-left:1.2rem;color:var(--chalk-2);font-size:.8rem;white-space:nowrap;opacity:0;transition:opacity .3s}
.bar .where.on{opacity:1}
.bar .rail{position:relative;width:7.5rem;height:6px;background:repeating-linear-gradient(90deg,rgba(255,255,255,.18) 0 1px,transparent 1px calc(100%/15))}
.bar .rail i{position:absolute;top:0;bottom:0;background:var(--gold);transition:left .4s,width .4s}
@media (max-width:1250px){.bar .where-t{display:none}}

/* contents: bars a touch heavier, and they grow in */
.rt i{height:.66rem;top:.67rem;transform-origin:0 50%}
.toc.live .rt i{animation:grow .9s cubic-bezier(.3,.7,.2,1) both}
.toc .row:nth-child(3) .rt i{animation-delay:.06s}.toc .row:nth-child(4) .rt i{animation-delay:.12s}.toc .row:nth-child(5) .rt i{animation-delay:.18s}.toc .row:nth-child(6) .rt i{animation-delay:.24s}.toc .row:nth-child(7) .rt i{animation-delay:.3s}.toc .row:nth-child(8) .rt i{animation-delay:.36s}.toc .row:nth-child(9) .rt i{animation-delay:.42s}
@keyframes grow{from{transform:scaleX(0)}to{transform:none}}
.rt i.faint{background:var(--rule-2)}
.row:hover .rt i.faint{background:var(--red)}
.row .rl::after{content:'';display:none}
@media (prefers-reduced-motion:reduce){.toc.live .rt i{animation:none}}

/* hero labels a step larger, the ayah close to the title */
.kick{font-size:.95rem}
.ar-cite{font-size:.9rem;margin:.2rem 0 1.5rem}
@media (max-width:1099px){.hero-plate{grid-row:2;margin:2.2rem 0 0}.hero-in{grid-row:1}.hero-plate .hp-frame{aspect-ratio:16/9}.hero-plate img{height:100%;object-fit:cover}}
.w-wide{max-width:44rem;margin:0 0 1rem}

/* ======== round five: a symmetric leaf, sidenotes on the right, three opener layouts, two plate sizes ======== */
.gl{font-size:.875rem;color:#4f483c}
.when,.yr{font-family:var(--f-body);font-size:.875rem;line-height:1.45;color:#4f483c}
.yr{margin:0 0 .55rem}

/* a beat: date and names on the left, story in the middle, its references on the right */
.beat{grid-column:gloss-start/side-end}
@media (min-width:1100px){
  .beat > .sn{grid-column:side-start/side-end;grid-row:2;align-self:start}
}
.sn{font-size:.82rem;line-height:1.45;color:#4f483c}
.sn-h{font-family:var(--f-head);font-size:.95rem;color:var(--ink);margin:.25rem 0 .5rem!important}
.sn ol{list-style:none;margin:0;padding:0}
.sn li{margin:0 0 .55rem;padding-left:1.5rem;text-indent:-1.5rem}
.sn-n{display:inline-block;width:1.5rem;text-indent:0;text-decoration:none;color:var(--ink-3)}
.sn a{text-decoration:none}
.sn a:not(.sn-n):hover{text-decoration:underline;text-decoration-color:var(--rule-2)}
@media (max-width:1099px){
  .beat > .sn{grid-column:text-start/text-end;margin-top:1.2rem;padding-top:.8rem;border-top:1px solid var(--rule)}
  .beat > .gl{display:grid;grid-template-columns:auto 1fr;column-gap:1rem;align-items:baseline}
  .beat > .gl .sec{grid-row:1}
  .beat > .gl .when,.beat > .gl .yr{grid-row:1;grid-column:2}
  .beat > .gl .gl-ar,.beat > .gl .topics{grid-column:1/-1}
  .beat .topics{flex-direction:row;gap:.2rem .9rem;margin-top:.3rem!important}
}

/* the key sentence: a pale gold wash, nothing else */
mark{text-decoration:none;background:linear-gradient(transparent 12%,rgba(225,196,120,.55) 12%,rgba(225,196,120,.55) 92%,transparent 92%);padding:0 .06em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
mark::before{content:none}

/* references inside quotations: quiet numbers */
.cite-b{color:var(--ink-3)}

/* openers: three compositions in turn */
.chap-head{min-height:30rem;grid-template-rows:auto auto auto;row-gap:0;align-content:end;align-items:end}
.chap-head > *{position:relative}
.chap-n{font-size:.95rem;letter-spacing:.01em;margin:0 0 1rem}
.chap-num{margin:0}
.chap h2{margin:0}
.chap .dek{margin:1.1rem 0 0}
.chap .dek:empty{display:none}
.emb{position:relative;right:auto;top:auto;transform:none;width:100%;height:auto}
.emb .ln{stroke-width:1.5}
.emb .tx.sm{font-size:13px}
/* a: the numeral hung large in the margin on the title's baseline, the drawing to the right */
.lay-a .chap-n{grid-column:text-start/text-end;grid-row:1}
.lay-a .chap-num{grid-column:gloss-start/gloss-end;grid-row:2;align-self:last baseline;justify-self:end;font-size:clamp(9rem,5rem + 9vw,18rem);line-height:.8;padding-right:.08em}
.lay-a h2{grid-column:text-start/text-end;grid-row:2;align-self:last baseline;max-width:32rem;font-size:clamp(2.6rem,1.7rem + 2.8vw,4.4rem)}
.lay-a .dek{grid-column:text-start/text-end;grid-row:3;max-width:30rem}
.lay-a .emb{grid-column:text-end/side-end;grid-row:1/4;align-self:center;width:min(24vw,21rem);justify-self:end;margin-right:-1rem}
/* b: the drawing large on the left, the words on the right */
.lay-b .emb{grid-column:gloss-start/text-start;grid-row:1/4;align-self:center;width:min(36vw,32rem);margin-left:-1rem}
.lay-b .chap-n,.lay-b h2,.lay-b .dek{grid-column:text-start/side-end;padding-left:min(14vw,13rem)}
.lay-b .chap-n{grid-row:1}
.lay-b h2{grid-row:2}
.lay-b .dek{grid-row:3}
.lay-b .chap-num{position:absolute;right:max(var(--gut),calc(50vw - 34rem));top:2.4rem;font-size:3.4rem;line-height:1;color:var(--gold);opacity:.9}
/* c: the drawing centred like a seal, the title centred under it */
.lay-c{min-height:38rem;text-align:center;justify-items:center}
.lay-c .emb{grid-column:gloss-start/side-end;grid-row:1;width:min(40vw,26rem);margin:0 0 1.6rem}
.lay-c .chap-n{grid-column:gloss-start/side-end;grid-row:2}
.lay-c .chap-n span{display:inline}.lay-c .chap-n span + span::before{content:' · '}
.lay-c h2{grid-column:gloss-start/side-end;grid-row:3}
.lay-c .dek{grid-column:gloss-start/side-end;grid-row:4;max-width:34rem}
.lay-c .chap-num{position:absolute;left:50%;top:1.8rem;transform:translateX(-50%);font-size:3rem;line-height:1;color:var(--gold)}
@media (max-width:1099px){
  .chap-head,.lay-c{min-height:0;text-align:left;justify-items:stretch}
  .chap-head .emb{display:block;grid-column:text-start/text-end!important;grid-row:1!important;width:min(78vw,20rem)!important;margin:0 0 1.4rem!important;justify-self:start}
  .chap-head .chap-n,.chap-head h2,.chap-head .dek{grid-column:text-start/text-end!important;padding-left:0!important}
  .chap-head .chap-n{grid-row:2!important}.chap-head h2{grid-row:3!important}.chap-head .dek{grid-row:4!important}
  .chap-head .chap-num{position:absolute!important;right:var(--gut)!important;left:auto!important;top:1.4rem!important;transform:none!important;font-size:3.4rem!important;grid-row:auto!important}
}

/* plates: two sizes, column and the full width of the leaf, never cut; the caption on the plate's foot */
.plate{grid-column:gloss-start/side-end;align-items:end}
.plate .frame,.plate-bleed .frame{box-shadow:0 0 0 1px #cfc4a8,0 8px 30px rgba(40,28,8,.12);border:0}
.plate-column .frame{grid-column:text-start/text-end;justify-self:start}
.plate-column img{width:auto;max-width:100%}
.plate-wide .frame{grid-column:gloss-start/side-end;grid-row:1}
.plate-wide .gl{grid-column:gloss-start/gloss-end;grid-row:2;margin-top:1rem}
@media (min-width:1100px){
  .plate-wide{row-gap:0}
  .plate-wide .gl{display:contents}
  .plate-wide .gl .fig-n{grid-column:gloss-start/gloss-end;grid-row:2;margin:1rem 0 0}
  .plate-wide .gl p:nth-child(2){grid-column:text-start/text-end;grid-row:2;margin:1rem 0 0}
  .plate-wide .gl .credit{grid-column:side-start/side-end;grid-row:2;margin:1.1rem 0 0}
}
@media (max-width:1099px){.plate-wide .frame,.plate-column .frame{grid-column:text-start/text-end}.plate-wide .gl{grid-column:text-start/text-end}}

/* quotations: large, across the margin and the column, the opening mark hung outside */
.pull{grid-column:gloss-start/side-end}
.pull-t{grid-column:gloss-start/text-end;border:0;padding:0;margin:0;position:relative}
.pull-t .qm{position:absolute;right:calc(100% + .25rem);top:-.35em;font-family:var(--f-head);font-size:5rem;line-height:1;color:var(--gold)}
.pull-t p{font-family:var(--f-body);font-size:clamp(1.45rem,1.1rem + 1.1vw,2.15rem);line-height:1.48;max-width:none;margin:0 0 1.2rem}
.pull-t cite{font-size:.92rem;color:#4f483c;padding-top:.8rem;border-top:1px solid var(--rule-2);max-width:none}
@media (max-width:1099px){.pull-t{grid-column:text-start/text-end}.pull-t .qm{position:static;display:block;height:2.2rem;font-size:4rem}}

/* figures: the stage on the left of the band, controls and readout on the right */
.w > .w-body{grid-column:text-start/side-end}
.w-wide{max-width:none}
.big-v{font-size:clamp(1.6rem,1.3rem + .8vw,2rem)!important}
.bird-out p:nth-child(2) b{font-size:1.5rem}
.ami-out .hit,.ami-rule .hit{font-family:var(--f-body);font-weight:700;font-size:1.05rem}
.ink-svg .lab.small{font-size:15px}
.bir-out .w-mini,.w-mini{font-size:.86rem;color:#4f483c}
.frame-p .circ{stroke:var(--rule-2)}
.frame-p .poly{fill:rgba(173,47,27,.06);stroke:var(--ink-3);stroke-width:1.4}
.frame-p.past .poly{stroke:var(--ink-2)}
.frame-p.on .poly{fill:var(--red-wash);stroke:var(--red);stroke-width:2}
.frame-p.on text{fill:var(--red);font-weight:700}
/* one tab style: no boxes, an ink rule under the chosen one */
.steps,.seg{gap:0 1.1rem;border-bottom:1px solid var(--rule-2)}
.steps button,.seg button{border:0;border-bottom:2px solid transparent;margin:0 0 -1px;padding:.5rem .1rem;min-height:44px;background:none!important;color:var(--ink-3)}
.steps button[aria-pressed=true],.seg button[aria-pressed=true]{background:none;color:var(--ink);border-bottom-color:var(--ink)}
.steps button:hover:not([aria-pressed=true]),.seg button:hover:not([aria-pressed=true]){color:var(--ink)}
.steps button.go{margin-left:auto;align-self:center;min-height:36px;padding:.3rem .8rem;border:1px solid var(--ink);border-radius:2px;color:var(--ink);margin-bottom:.35rem}
.steps button.go:hover{background:var(--ink)!important;color:var(--paper)}
.btn-go{border:1px solid var(--ink);border-radius:2px;color:var(--ink);padding:.35rem .9rem;min-height:38px}
.btn-go:hover{background:var(--ink);color:var(--paper)}
/* Arf */
.arf-pick{display:flex;align-items:center;gap:1rem;margin:.4rem 0}
.arf-pick .ctl-l{font-family:var(--f-en);font-size:1.1rem;min-width:1.2rem}
.arf-grid{display:grid;grid-template-columns:1fr 1fr;gap:.6rem;margin:.2rem 0 1rem}
.arf-c{display:flex;justify-content:space-between;align-items:baseline;padding:.7rem .9rem;border:1px solid var(--rule-2);background:var(--leaf);transition:background .25s,border-color .25s}
.arf-c b{font-family:var(--f-head);font-weight:400;font-size:1.8rem;line-height:1}
.arf-c.maj{border-color:var(--red);background:rgba(200,60,38,.08)}
.arf-c.maj b{color:var(--red)}
.arf-in{font-size:.86rem;color:#4f483c}
.arf-out{font-size:1rem}
.arf-out .big-v{display:inline;color:var(--red);font-family:var(--f-head);margin-left:.3rem}

/* seams: a figure that ends a chapter runs straight into the next opener */
.chap{padding-bottom:0}
.chap > :last-child{margin-bottom:clamp(4rem,9vh,5.5rem)}
.chap > .w:last-child{margin-bottom:0}

/* the end: headline and words on one edge */
.end{padding-top:clamp(6rem,15vh,9rem)}
.end-in{grid-column:text-start/side-end}
.end p{margin-left:0}
.end h2{font-size:clamp(2.6rem,1.6rem + 3.6vw,5rem)}

/* hero: the words and the whole folio side by side */
.hero{min-height:min(90svh,860px)}
.hero-in{grid-column:gloss-start/text-end;max-width:33rem}
.hero h1{font-size:clamp(3rem,1.9rem + 3.8vw,5.4rem)}
@media (min-width:1100px){
  .hero-plate{position:relative;right:auto;top:auto;transform:none;width:auto;grid-column:text-start/side-end;grid-row:1;align-self:center;margin-left:21rem}
  .hero-in{grid-row:1}
}
.hero-plate .hp-frame{box-shadow:0 30px 60px -30px rgba(0,0,0,.8)}

/* the colophon, plain */
footer.foot{padding:3rem 0 3.5rem}

/* ======== round six: one rule for each thing ======== */
.gl,.when{font-size:.9rem;color:#4a443a}
.ink-svg .lab.tiny{font-size:13px;fill:var(--ink-3)}

/* openers: one template. Numeral in the margin on the title's baseline, words in the column, the drawing in a fixed box */
.chap-head{min-height:35rem;grid-template-rows:1fr auto auto auto;align-content:stretch;align-items:end;text-align:left;justify-items:stretch;padding:4.5rem 0 4rem}
.chap-head .chap-n{grid-column:text-start/text-end;grid-row:2;padding:0}
.chap-head .chap-num{position:relative!important;inset:auto!important;transform:none!important;grid-column:gloss-start/gloss-end;grid-row:3;align-self:last baseline;justify-self:end;font-size:10rem;line-height:.8;color:var(--gold);opacity:1;padding-right:.1em}
.chap-head h2{grid-column:text-start/text-end;grid-row:3;align-self:last baseline;max-width:31rem;padding:0;font-size:clamp(2.6rem,1.7rem + 2.6vw,4.4rem)}
.chap-head .dek{grid-column:text-start/text-end;grid-row:4;max-width:31rem;padding:0}
.chap-head .chap-n span{display:block}
.chap-head .chap-n span + span::before{content:none}
.chap-head .emb{grid-column:text-end/side-end;grid-row:1/5;align-self:center;justify-self:end;width:20rem;height:auto;margin:0}
@media (max-width:1099px){
  .chap-head{min-height:0;grid-template-rows:auto;padding:2.6rem 0 3rem}
  .chap-head .emb{grid-row:1!important;width:min(70vw,17rem)!important}
  .chap-head .chap-num{grid-column:text-start/text-end!important;grid-row:2!important;justify-self:start!important;font-size:6rem!important;right:auto!important;top:auto!important;margin:.6rem 0 .4rem}
  .chap-head .chap-n{grid-row:3!important}.chap-head h2{grid-row:4!important}.chap-head .dek{grid-row:5!important}
}

/* beats: the Arabic name as a seal in the right margin, at one size */
.seal{grid-column:side-start/side-end;grid-row:1/3;align-self:start;margin:.2rem 0 0;font-family:var(--f-ar);font-size:1.75rem;line-height:1.45;color:var(--ink);text-align:right}
@media (max-width:1099px){.seal{grid-column:text-start/text-end;grid-row:auto;text-align:left;font-size:1.45rem;margin:0 0 .3rem}}
.beat > .gl{border-top:0}

/* references: a quiet number at the end of the passage that opens its card */
@media (min-width:1100px){
  .bd p:last-child .cite{position:relative;left:auto;bottom:auto;width:auto;display:inline;line-height:inherit}
  .bd p:last-child .cite-b{font-size:.66em;vertical-align:.55em;margin-inline-start:.2em;padding:.1em;border-bottom:1px solid transparent;color:var(--ink-3)}
  .bd p:last-child .cite-b::before{content:none}
  .bd p:last-child .card{left:-1rem;right:auto;top:calc(100% + .5rem);bottom:auto}
  .bd p:last-child .card::before{top:-.7rem;bottom:auto}
}
.cite-b:hover,.cite-b[aria-expanded=true]{color:var(--red)}
.src-g ol{list-style-type:bengali}

/* plain captions inside figures: no red rules */
.w-say,.rel-take,.imo-say{border-left:0;padding-left:0}
.w-say{min-height:3.4em;color:var(--ink-2)}

/* the ornament */
.orn{display:flex;align-items:center;gap:.9rem;margin:0 0 1.6rem;color:#a8843f;max-width:20rem}
.orn::before,.orn::after{content:'';flex:1;height:1px;background:currentColor;opacity:.55}
.orn svg{width:18px;height:18px;flex:none;fill:currentColor;stroke:currentColor;stroke-width:1}
.orn svg rect{stroke-width:1.2}

/* quotations: the ornament, then the words in the text face */
.pull-t{grid-column:text-start/side-end}
.pull-t p{font-size:clamp(1.4rem,1.1rem + .9vw,1.95rem);line-height:1.5}
.pull-t .qm{display:none}

/* plates: a keyline, no shadow; the caption in the left margin, at the top */
.plate{align-items:start}
.plate .frame,.plate-bleed .frame{box-shadow:0 0 0 1px rgba(0,0,0,.15)}
.plate-wide .frame{grid-column:text-start/side-end;grid-row:1}
.plate-wide .gl{display:block;grid-column:gloss-start/gloss-end;grid-row:1;margin:0}
@media (min-width:1100px){.plate-wide .gl .fig-n,.plate-wide .gl p:nth-child(2),.plate-wide .gl .credit{grid-column:auto;grid-row:auto;margin:0 0 .5rem}}
.plate .gl{padding-top:.1rem}
@media (max-width:1099px){.plate-wide .frame{grid-column:text-start/text-end}.plate .gl,.plate-wide .gl{grid-row:2;grid-column:text-start/text-end;margin-top:.9rem}}

/* figures: no band; a ruled figure on the page, its drawing on a tinted stage */
.w{background:none;border-top:1px solid var(--ink);border-bottom:1px solid var(--rule-2);margin:0 0 clamp(4rem,9vh,5.5rem);padding:2rem 0 2.4rem}
.chap > .w:last-child{margin-bottom:clamp(4rem,9vh,5.5rem)}
.w .ink-svg:not(.loupe){background:#e9dfc7;border-radius:2px}
.w .ink-svg.emb{background:none}
input[type=range]::-webkit-slider-thumb{box-shadow:0 0 0 4px var(--paper)}
.num-l{display:grid;grid-template-columns:auto 1fr;align-items:end;gap:1rem;max-width:22rem}
.num-l .ctl-l{padding-bottom:.6rem}
.arf-c{padding:1.2rem 1.2rem}
.arf-c b{font-size:2.6rem}
.arf-grid{gap:.8rem}
.qib-pics{max-width:none}

/* contents: hairline bars with a dot at each end, rules on the labelled centuries, sections counted */
.axis-t,.rt{grid-column:text-start/text-end}
.rc{grid-column:side-start/side-end;font-size:.82rem;color:var(--ink-3);text-align:right}
.rt{background:repeating-linear-gradient(90deg,transparent 0,transparent calc(100%/15*.5 - .5px),var(--rule) calc(100%/15*.5 - .5px),var(--rule) calc(100%/15*.5 + .5px),transparent calc(100%/15*.5 + .5px),transparent calc(100%/15*2))}
.rt i{height:3px;top:calc(50% - 1.5px);background:var(--ink);border-radius:2px;min-width:0;overflow:visible}
.rt i::before,.rt i::after{content:'';position:absolute;top:-3.5px;width:10px;height:10px;border-radius:50%;background:var(--ink)}
.rt i::before{left:-5px}.rt i::after{right:-5px}
.rt i.faint{background:var(--rule-2)}
.rt i.faint::before,.rt i.faint::after{background:var(--rule-2)}
.row:hover .rt i,.row:hover .rt i::before,.row:hover .rt i::after{background:var(--red)}
.row:hover .rc{color:var(--red)}
@media (max-width:1099px){.rc{display:none}}

/* hero: the verse as epigraph, a large title, the folio running off the right edge */
.hero{min-height:min(88svh,840px);overflow:hidden}
.hero .ar-line{font-size:clamp(1.6rem,1.3rem + .8vw,2.25rem)}
.ar-cite{margin:.1rem 0 1.6rem}
.kick{margin:0 0 .9rem}
.hero h1{font-size:clamp(3.2rem,2rem + 4.6vw,6.6rem);line-height:1.02}
.hero-in{max-width:34rem}
.hero-cap{margin-top:2rem;font-size:.82rem;line-height:1.5;color:var(--chalk-2);max-width:30rem}
.hero-cap p{margin:0 0 .2rem}
.hero-cap .credit a{color:var(--chalk-2);text-decoration-color:rgba(255,255,255,.2)}
@media (min-width:1100px){
  .hero-plate{position:absolute!important;grid-column:auto!important;right:-4vw!important;top:50%!important;transform:translateY(-50%)!important;width:min(54vw,800px)!important;margin:0!important}
}
.hero-plate .hp-frame{box-shadow:none}

/* the closing verse, a page to itself */
.ayah.night{margin-top:5rem;padding:3rem 1.5rem 2.6rem;border:0}
.ayah.night::before,.ayah.night::after{content:none}
.ayah.night .orn{margin:0 auto 2rem;max-width:22rem;color:var(--gold)}
.ayah.night .ar{font-size:clamp(2rem,1.4rem + 2vw,3.2rem)}

/* ======== round seven ======== */
/* openers: the drawing large on the right, running to the page edge; numeral on the title's first line */
.chap-head{min-height:min(84svh,40rem);position:relative}
.chap-head .chap-num{align-self:first baseline}
.chap-head h2{align-self:first baseline;max-width:27rem}
.chap-head .dek{max-width:27rem}
@media (min-width:1100px){
  .chap-head .emb{position:absolute!important;right:0;top:50%;transform:translateY(-50%)!important;width:min(40vw,36rem)!important;grid-column:auto;grid-row:auto}
  .chap-head .emb .tx{font-size:15px}
  .chap-head .emb .tx.sm{font-size:12px}
  .chap-head .emb .tx.big{font-size:60px}
  /* two openers lay their drawing across the whole plate */
  .chap-head.v-wide{grid-template-rows:auto auto auto auto;min-height:min(92svh,46rem)}
  .chap-head.v-wide .emb{position:relative!important;right:auto;top:auto;transform:none!important;grid-column:gloss-start/side-end!important;grid-row:1!important;width:100%!important;max-height:22rem;margin:0 0 2.4rem}
  .chap-head.v-wide .chap-n{grid-row:2}.chap-head.v-wide .chap-num,.chap-head.v-wide h2{grid-row:3}.chap-head.v-wide .dek{grid-row:4}
  .chap-head.v-wide h2,.chap-head.v-wide .dek{max-width:40rem}
}
.chap-head .chap-n{font-size:.95rem}

/* the seal: one size per length, on one line, under a gold hairline */
.seal{white-space:nowrap;padding-top:.7rem;border-top:1px solid #c9a35a;font-size:1.9rem}
.seal.s2{font-size:1.55rem}.seal.s3{font-size:1.2rem}

/* references hold on to the last word, in red, as runs */
.nw{white-space:nowrap}
.cite-b,.bd p:last-child .cite-b{color:var(--red)!important;font-size:.7em!important}

/* the key sentence, rubricated: red ink, as a scribe marks it (three on the page) */
mark{background:none;color:var(--red);padding:0}

/* figures: one well for every instrument */
.w > .w-body{background:#e8dfc8;padding:clamp(1.2rem,2.5vw,2rem);border-radius:2px}
.w .ink-svg:not(.loupe){background:none}
.w-say{min-height:0}
.ctl{grid-template-areas:"l o" "r r" "e e"}
.ctl-l{font-size:.92rem}
.ctl output{font-size:1.6rem}
.ctl-ends{grid-area:e;display:flex;justify-content:space-between;font-size:.8rem;color:var(--ink-3);margin-top:-.4rem}
input[type=range]{background:none}
input[type=range]::-webkit-slider-runnable-track{height:2px;background:linear-gradient(90deg,var(--red) var(--p),#b9a77f var(--p))}
input[type=range]::-moz-range-track{height:2px;background:linear-gradient(90deg,var(--red) var(--p),#b9a77f var(--p))}
input[type=range]::-webkit-slider-thumb{width:22px;height:22px;margin-top:-10px;box-shadow:0 0 0 4px #e8dfc8}
input[type=range]:hover::-webkit-slider-thumb,input[type=range]:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 4px #e8dfc8,0 0 0 9px rgba(173,47,27,.18)}
/* one button: red outline, filled on hover */
.btn-go,.steps button.go{border:1px solid var(--red)!important;color:var(--red)!important;font-size:.92rem;min-height:40px;padding:.35rem 1rem;border-radius:2px;background:none!important}
.btn-go:hover,.steps button.go:hover{background:var(--red)!important;color:#fff!important}
.btn-go[disabled]{opacity:.5}
/* tabs: a red rule under the chosen one */
.steps button,.seg button{font-size:.92rem}
.steps button[aria-pressed=true],.seg button[aria-pressed=true]{border-bottom-color:var(--red);color:var(--ink)}
/* switches: two joined boxes, 44px */
.sw{display:inline-flex;border:1px solid var(--ink-2)}
.sw button{font:inherit;font-size:1.15rem;min-width:52px;min-height:44px;border:0;background:var(--leaf);cursor:pointer;color:var(--ink)}
.sw button + button{border-left:1px solid var(--ink-2)}
.sw button[aria-pressed=true]{background:var(--ink);color:var(--paper)}
.sw button:focus-visible{outline:2px solid var(--red);outline-offset:2px}
.arf-pick .ctl-l{font-size:1.3rem}
/* numerals: a boxed field, the places spelled out */
.num-in{border:1px solid var(--ink-2);border-radius:2px;padding:.2rem .7rem;background:var(--leaf);max-width:13rem}
.num-l{grid-template-columns:1fr;gap:.3rem}
.num-l .ctl-l{padding:0}
.num-rows{margin-top:1.2rem}
.num-place .pv{display:grid;grid-template-columns:2.6rem auto 1fr;align-items:baseline;gap:.6rem;padding:.35rem 0;border-bottom:1px solid #d2c3a1}
.num-place .pv b{font-family:var(--f-head);font-weight:400;font-size:2.2rem;color:var(--red);line-height:1}
.pv-x{font-size:1.05rem}
.pv-n{font-size:.86rem;color:var(--ink-3);text-align:right}

/* plates: one width for every manuscript */
.plate-wide .frame{grid-column:text-start/side-end;justify-self:start;max-width:100%}
.plate-wide img{width:auto;max-width:100%}

/* quotations: a gold mark hung in the margin; the text face, a measured line */
.pull-t .qm{display:block;position:absolute;right:calc(100% + .9rem);top:-.25em;font-family:var(--f-head);font-size:6.5rem;line-height:1;color:#b8913f}
.pull-t .orn{display:none}
.pull-t p{max-width:45rem;font-size:clamp(1.45rem,1.15rem + .9vw,2.05rem)}
.pull-t cite{max-width:45rem;font-size:.92rem}
.pull-night{grid-column:full-start/full-end;background:var(--night);color:var(--chalk);padding:clamp(4rem,10vh,6rem) 0}
.pull-night .pull-t p{color:#f1ece2}
.pull-night .pull-t cite{color:var(--chalk-2);border-color:rgba(235,230,220,.2)}
.pull-night .pull-t .qm{color:var(--gold)}
.pull-night .cite-b{color:var(--gold-2)!important}
@media (max-width:1099px){.pull-t .qm{position:static;display:block;height:3.2rem;font-size:5rem}}

/* hero: the title first, the verse under the words as an epigraph */
.hero h1{line-height:1.12}
.epi{margin-top:2rem;padding-top:1.2rem;border-top:1px solid rgba(201,163,90,.5);max-width:26rem}
.epi .ar-line{font-size:1.75rem!important;margin:0}
.epi .ar-cite{margin:.2rem 0 0}
.hero-plate .hp-frame{filter:drop-shadow(0 30px 50px rgba(0,0,0,.6))}
.hero::after{content:'';position:absolute;right:0;top:0;bottom:0;width:60%;background:radial-gradient(60% 70% at 70% 50%,rgba(201,163,90,.10),transparent 70%);pointer-events:none}
@media (max-width:1099px){.hero-plate{grid-row:1!important;margin:0 0 2rem!important}.hero-in{grid-row:2!important}.hero::after{display:none}}

/* contents: the axis to the right edge, counts under the names */
.axis-t,.rt{grid-column:text-start/side-end}
.rc{display:none}
.rl{font-size:1.25rem}
.rl small{font-size:.82rem}
.axis-t i{font-size:.82rem}
.rl small::after{content:attr(data-n)}

/* the matrix as a summary object on its own ground */
.mx{background:#e8dfc8;padding:0 1.4rem 1rem;border-top:0;box-shadow:inset 0 2px 0 var(--ink)}

/* the close: centred */
.end-in{grid-column:gloss-start/side-end;text-align:center}
.end h2{margin-left:auto;margin-right:auto;max-width:18ch}
.end p{margin-left:auto;margin-right:auto}

.emb .tx.huge{font-family:var(--f-head);font-size:150px}
.chap-head.v-wide .emb{max-height:none!important;height:auto}
.emb-wide .tx{font-size:20px}
.emb-wide .tx.sm{font-size:17px}
@media (max-width:1099px){.chap-head .emb-wide{width:100%!important}}

/* ======== round eight ======== */
/* drawings that ink themselves in: the dash must be measured in the path's own units, so no non-scaling stroke */
.emb .ln{vector-effect:none;stroke-width:1.3}
.emb-wide .ln{stroke-width:1.1}
.emb .gly *{vector-effect:none;stroke-width:.45}
.plate .marks rect{vector-effect:none;stroke-width:3}
/* the people's life dates as the right-margin seal */
.seal.life{white-space:normal;font-family:var(--f-head);font-size:1.75rem;line-height:1.15;color:var(--ink);text-align:left;direction:ltr}
.seal.life b{font-weight:400;display:block}
.seal.life span{display:block;font-family:var(--f-body);font-size:.9rem;color:#4a443a;margin-top:.35rem}
/* Arabic seals: one face, one size, two balanced lines at most */
.seal:not(.life){white-space:normal;font-size:1.6rem!important;text-wrap:balance}
/* apparatus at a readable size */
.gl,.when,.plate .gl p,.credit,.w-mini,.sn{font-size:.9rem}
.credit{font-size:.82rem}
.gl,.when,.w-mini,.pv-n,.arf-in{color:#5a5347}
.mx-h small{font-size:.82rem;text-align:left}
.mx-h .mx-c{align-items:flex-start;text-align:left}
/* figures: a lighter ground than the page, the rule inside the leaf */
.w{border-top:0;border-bottom:0;padding:0;grid-column:gloss-start/side-end}
.w > .w-body{background:#f8f2e4;box-shadow:inset 0 1px 0 var(--ink);padding:clamp(1.4rem,2.6vw,2.2rem)}
.w > .gl{padding-top:1rem;border-top:1px solid var(--ink)}
.w-note{font-size:.86rem;color:#5a5347;margin:.4rem 0 0}
.chap{padding-bottom:7.5rem}
.chap > :last-child,.chap > .w:last-child{margin-bottom:0}
/* the key sentence: a soft gold wash (three on the page) */
mark{color:inherit;background:rgba(201,164,92,.3);padding:0 .08em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
/* contents: fixed rows, the count on its own line */
.row{min-height:4rem}
.rl small::after{display:block}
/* the close: the paragraph on the text column, the verse under a double rule */
.end-in{text-align:left}
.end-in h2{margin-left:0;max-width:16ch}
.end-in p{margin-left:calc(12rem + 3rem)}
@media (max-width:1099px){.end-in p{margin-left:0}}
.ayah.night{border-top:1px solid var(--gold);border-bottom:1px solid var(--gold)}
.ayah.night::before,.ayah.night::after{content:'';background:var(--gold)}
/* plates: a soft shadow, every image on the same right edge */
.plate .frame,.plate-bleed .frame{box-shadow:0 8px 30px rgba(40,28,8,.18)}
.plate-wide .frame{justify-self:end}
