@font-face { font-family: "thmanyah sans"; src: url(assets/fonts/thmanyahsans-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "thmanyah sans"; src: url(assets/fonts/thmanyahsans-Medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "thmanyah sans"; src: url(assets/fonts/thmanyahsans-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }

/* Sila 4 identity (الهوية/sila4.json) */
:root {
  --primary: #1A5B5E; --accent: #02B28E; --jade-ink: #017A62; --jade: #019A7B; --deep: #0F3D36; --soft: #CFF2DF; --leaf: #88D588;
  --tint: #E8F6F5; --ink: #173336; --slate: #4E6B68; --ground: #F5F9F8; --line: #D3DDDB; --paper: #fff;
  --rail: 18.5rem; --bar: 0px; --gutter: clamp(1rem, 4vw, 3.5rem);
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light; accent-color: var(--accent);
}

* { box-sizing: border-box; }
/* smooth only after load: on a refresh the browser restores the position at once instead of gliding there */
html.ready { scroll-behavior: smooth; }
html { scroll-padding-top: calc(var(--bar) + 1rem); -webkit-text-size-adjust: 100%; scrollbar-color: #a9c1bd var(--ground); }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 1rem/1.75 "thmanyah sans", "Geeza Pro", system-ui, sans-serif; font-feature-settings: "kern"; overflow-x: clip; }
h1, h2, h3, h4, p { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; }
ol, ul { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
::selection { background: var(--soft); color: var(--deep); }
.mast ::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 1rem; top: -4rem; z-index: 9; background: var(--paper); color: var(--deep); font-weight: 500; padding: .5rem 1rem; border-radius: 8px; }
.skip:focus { top: 1rem; }
.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ── Masthead: the book's cover ─────────────────────────── */
.mast { position: relative; overflow: hidden; background: var(--deep); color: #fff; isolation: isolate; }
.mast::after { content: ""; position: absolute; inset: auto 0 0; height: 6px; background: linear-gradient(to left, var(--leaf), var(--accent) 45%, var(--primary)); }
.mast-ring { --rw: clamp(24rem, 46vw, 46rem); position: absolute; z-index: -1; width: var(--rw); inset-inline-end: calc(var(--rw) * -.06); bottom: calc(var(--rw) * -.1); opacity: .85; }
.mast-in { max-width: 82rem; margin: 0 auto; padding: clamp(2rem, 4.2vw, 3.5rem) var(--gutter) clamp(2.25rem, 4.6vw, 3.75rem);
  display: flex; align-items: center; gap: clamp(1.25rem, 3.5vw, 3rem); }
.mast-logo { width: clamp(5.5rem, 10vw, 8.75rem); height: auto; flex: none; }
.mast-text { padding-inline-start: clamp(1.25rem, 3.5vw, 3rem); border-inline-start: 1px solid rgb(136 213 136 / .3); }
.mast h1 { font-size: clamp(2rem, 4.6vw, 4rem); line-height: 1.12; font-weight: 700; text-wrap: balance; max-width: 14ch; }
.mast-facts { margin-top: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.25rem; font-size: clamp(1rem, 1.4vw, 1.15rem); font-weight: 500; color: var(--leaf); font-variant-numeric: tabular-nums; }
.mast-facts span + span::before { content: ""; display: inline-block; width: .35rem; height: .35rem; border-radius: 50%; background: currentColor; margin-inline-end: 1.25rem; vertical-align: middle; opacity: .6; }
.mast-facts span.g::before { display: none; }

/* ── Layout: contents rail + works ─────────────────────── */
.layout { max-width: 82rem; margin: 0 auto; display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); gap: clamp(1.5rem, 3vw, 3rem); padding: 0 var(--gutter); }
.rail { position: relative; }
/* the rail sticks with the page; it never scrolls on its own, so nothing in it moves unless the reader scrolls */
.rail-in { position: sticky; top: 0; padding: 1.5rem .25rem 1.5rem; }
.search { display: flex; align-items: center; gap: .6rem; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 0 .9rem; color: var(--slate);
  transition: border-color .2s, box-shadow .2s; }
.search:hover { border-color: #b7c9c6; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgb(2 178 142 / .14); color: var(--jade-ink); }
.search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; color: var(--ink); caret-color: var(--accent); padding: .7rem 0; outline: none; }
.search input::placeholder { color: var(--slate); opacity: 1; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; width: 1rem; height: 1rem; cursor: pointer; background: var(--slate);
  -webkit-mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.4" stroke-linecap="round"><path d="M6 6l12 12M18 6 6 18"/></svg>') center / contain no-repeat; }
.toc { margin-top: 1rem; font-size: .9rem; }
.toc-btn, .scrim { display: none; }
.toc-p > a { display: flex; align-items: flex-start; gap: .6rem; line-height: 1.45; padding: .32rem .65rem; border-radius: 8px; text-decoration: none; font-weight: 500; color: var(--primary);
  transition: background-color .2s, color .2s; }
.toc a:hover { color: var(--deep); }
.toc-p > a:hover { background: rgb(232 246 245 / .7); }
.toc-p.on > a { background: transparent; color: var(--deep); box-shadow: inset 0 0 0 1.5px var(--primary); }

main { padding: 1.75rem 0 5rem; min-width: 0; min-height: 70vh; outline: none; }

/* ── Axes: the book's running heads ─────── */

.session { margin-top: 1.25rem; }
.session + .session { margin-top: clamp(3rem, 6vw, 4.5rem); }
/* the head reaches a little past the cards so their edges never show beside it while they scroll under */
.session-head { --pad: .5rem; position: sticky; top: var(--bar); z-index: 2; margin-inline: calc(var(--pad) * -1); padding: .9rem var(--pad) .8rem;
  background: linear-gradient(var(--primary), var(--primary)) center bottom / calc(100% - 2 * var(--pad)) 2px no-repeat, var(--ground);
  font-size: clamp(1.3rem, 2.3vw, 1.8rem); line-height: 1.45; font-weight: 700; color: var(--deep); text-wrap: balance;
  display: flex; align-items: center; gap: .85rem; }

/* ── Cards: one paper each ─────────────────────────────── */
.cards { margin-top: 1.5rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1.5rem; }
.card { position: relative; display: flex; flex-direction: column; overflow: hidden; background: var(--paper); border-radius: 22px;
  box-shadow: 0 0 0 1px rgb(15 61 54 / .07), 0 1px 2px rgb(15 61 54 / .05), 0 10px 28px -18px rgb(15 61 54 / .3);
  transition: box-shadow .4s var(--ease), translate .4s var(--ease); }
/* the identity band draws across the top on hover */
.card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; z-index: 1; background: linear-gradient(to left, var(--leaf), var(--accent) 50%, var(--primary));
  scale: 0 1; transform-origin: right; transition: scale .5s var(--ease); }
.card:hover, .card:focus-within { translate: 0 -4px; box-shadow: 0 0 0 1px rgb(2 178 142 / .22), 0 2px 4px rgb(15 61 54 / .05), 0 24px 44px -22px rgb(15 61 54 / .42); }
.card:hover::before, .card:focus-within::before { scale: 1 1; }

/* speaker strip */
.who { display: flex; gap: .9rem; align-items: center; padding: 1.1rem 1.2rem; background: linear-gradient(to left, var(--tint), rgb(232 246 245 / .35)); }
.face { width: 64px; height: 64px; border-radius: 20px; object-fit: cover; flex: none; background: var(--paper); box-shadow: 0 0 0 3px var(--paper), 0 6px 14px -8px rgb(15 61 54 / .5);
  transition: scale .4s var(--ease); }
.card:hover .face { scale: 1.04; }
.face-mark { display: grid; place-items: center; }
.face-mark img { width: 36px; }
.who-text { flex: 1; min-width: 0; }
.name { font-weight: 700; line-height: 1.45; color: var(--deep); }
.role { font-size: .82rem; line-height: 1.55; color: var(--slate); margin-top: .15rem; }

/* number containers: the axis is a filled square, its papers carry the axis number then their place («٢.٣») */
.axis-no, .num { flex: none; display: inline-grid; place-items: center; direction: ltr; unicode-bidi: isolate; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.axis-no { width: 2.4rem; height: 2.4rem; border-radius: 10px; background: var(--primary); color: #fff; font-size: 1.25rem; }
.num { align-self: flex-start; min-width: 2.9rem; height: 2rem; padding: 0 .55rem; border-radius: 999px; background: var(--paper); color: var(--jade-ink); font-size: 1rem;
  box-shadow: 0 0 0 1px rgb(2 178 142 / .3); }

.card-body { flex: 1; padding: 1.25rem 1.3rem 0; }
.card h4 { font-size: 1.2rem; line-height: 1.6; font-weight: 700; color: var(--ink); text-wrap: pretty; }
.extras { display: grid; gap: .45rem; margin-top: 1rem; font-size: .88rem; line-height: 1.5; }
.extras li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .45rem .7rem; border-radius: 12px; background: var(--ground); }
.x-name { color: var(--ink); }
.x-files { display: flex; gap: .35rem; flex: none; }
.x-files a { padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 500; color: var(--jade-ink); background: var(--paper); box-shadow: 0 0 0 1px var(--line); text-decoration: none; transition: background-color .2s, color .2s, box-shadow .2s; }
.x-files a:hover { background: var(--soft); box-shadow: 0 0 0 1px var(--soft); color: var(--deep); }

.acts { display: flex; gap: .6rem; padding: 1.2rem 1.3rem 1.3rem; }
.btn { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .7rem .9rem; border-radius: 999px; text-decoration: none; font-weight: 500; font-size: .92rem;
  color: var(--primary); background: var(--tint); transition: background-color .25s, color .25s, box-shadow .25s; }
.btn:hover { background: var(--soft); color: var(--deep); }
.btn:active { translate: 0 1px; }
.btn-main { background: var(--primary); color: #fff; box-shadow: 0 8px 18px -10px rgb(26 91 94 / .7); }
.btn-main:hover { background: var(--deep); color: #fff; }

.empty { padding: 4.5rem 1rem; text-align: center; color: var(--slate); font-size: 1.1rem; }
.empty span { color: var(--deep); font-weight: 500; }
.empty button { margin-top: 1rem; font: inherit; font-size: 1rem; font-weight: 500; color: var(--primary); background: var(--paper); border: 1.5px solid var(--primary); border-radius: 10px; padding: .5rem 1.2rem; cursor: pointer; transition: background-color .2s; }
.empty button:hover { background: var(--tint); }

/* ── Footer: the back cover, in the masthead's teal ─────── */
.foot { position: relative; background: var(--deep); color: #cfe7e2; }
.foot::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: linear-gradient(to left, var(--leaf), var(--accent) 45%, var(--primary)); }
.foot-in { max-width: 82rem; margin: 0 auto; padding: clamp(2.5rem, 6vw, 4rem) var(--gutter); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2.5rem 4rem; }
.foot-about { display: flex; align-items: center; gap: 1.5rem; flex: 1 1 26rem; }
.foot-logo { width: 5.5rem; height: auto; flex: none; }
.foot-about p { font-size: clamp(1rem, 1.4vw, 1.12rem); line-height: 1.9; max-width: 44ch; padding-inline-start: 1.5rem; border-inline-start: 1px solid rgb(255 255 255 / .18); }
.foot-org { display: flex; flex-direction: column; gap: .85rem; }
.foot-org h2 { font-size: .95rem; font-weight: 500; color: var(--leaf); }
.org-tiles { display: flex; flex-wrap: wrap; gap: .85rem; }
.tile { display: grid; place-items: center; overflow: hidden; width: 9.5rem; height: 5.5rem; padding: .75rem 1rem; border-radius: 14px; background: #fff; box-shadow: 0 10px 24px -14px rgb(0 0 0 / .5); }
.tile img { width: 100%; height: 100%; min-height: 0; min-width: 0; object-fit: contain; }
@media (max-width: 599px) {
  .foot-about { flex-direction: column; align-items: flex-start; }
  .foot-about p { padding: 0; border: 0; }
  .tile { width: 8.5rem; height: 5rem; }
}

/* ── Narrow screens: the rail becomes a sticky bar ─────── */
@media (max-width: 899px) {
  :root { --bar: 4.4rem; }
  .layout { display: block; padding: 0; }
  /* no backdrop-filter here: it would trap the fixed drawer inside the bar */
  .rail { position: sticky; top: 0; z-index: 5; background: var(--ground); border-bottom: 1px solid var(--line); }
  .rail-in { position: static; max-height: none; overflow: visible; padding: .75rem 1rem .6rem; }
  .rail-in { position: relative; }
  .rail-top { display: flex; gap: .5rem; }
  .rail-top .search { flex: 1; }
  .scrim { display: block; }
  .toc-btn { display: inline-flex; align-items: center; gap: .4rem; flex: none; font: inherit; font-weight: 500; font-size: .95rem; color: var(--primary); background: var(--paper);
    border: 1.5px solid var(--primary); border-radius: 12px; padding: 0 .9rem; cursor: pointer; }
  .toc-btn[aria-expanded="true"] { background: var(--primary); color: #fff; }
  /* the contents is a side drawer: it slides in from the start edge over a dimmed page */
  .toc { position: fixed; z-index: 7; top: 0; bottom: 0; inset-inline-start: 0; width: min(86vw, 22rem); margin: 0; padding: 1.25rem .75rem 2rem; overflow-y: auto; overscroll-behavior: contain;
    background: var(--paper); box-shadow: -18px 0 40px -18px rgb(15 61 54 / .45); font-size: 1rem;
    translate: 100% 0; visibility: hidden; transition: translate .35s var(--ease), visibility 0s .35s; }
  .rail.open .toc { translate: 0 0; visibility: visible; transition: translate .35s var(--ease); }
  .toc-p > a { padding: .6rem .75rem; }
  .scrim { position: fixed; inset: 0; z-index: 6; background: rgb(15 61 54 / .45); opacity: 0; pointer-events: none; transition: opacity .3s; }
  .rail.open .scrim { opacity: 1; pointer-events: auto; }
  main { padding: 1.5rem 1rem 4rem; }
  .session-head { --pad: 1rem; padding-top: .75rem; font-size: 1.1rem; }
  .search input { padding: .55rem 0; }
}
@media (max-width: 599px) {
  .mast-in { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
  .mast-text { padding: 0; border: 0; }
  .mast-ring { --rw: 17rem; inset-inline-end: -2.5rem; top: -4.5rem; bottom: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html, html.ready { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.toc .axis-no { width: 1.45rem; height: 1.45rem; border-radius: 6px; font-size: .8rem; margin-top: .05rem; background: var(--tint); color: var(--primary); }
.toc-p.on .axis-no { background: var(--primary); color: #fff; }
@media (max-width: 899px) {
  .toc .axis-no { margin-top: .05rem; }
}
