/* The inscription (Brand, approved by iShatat on 2026-10-31): Arabic cut into the page like sunken relief on a temple
   wall. No colour: a face in the page's own tone, a dark edge where the light can't reach and a lit edge opposite
   (text-shadows paint behind the letters, which is exactly the cut). Reem Kufi 600, Fatimid Kufic, only here.
   Two pieces, on the first screens: the Arabic word cut into the empty side opposite the title, whole, its top
   cropped by the header's rule, and the band under the first screen. Decorative: aria-hidden, never behind words
   you read. On English pages the word moves to the right and is the piece on show, so it gets a museum label (real
   text), and the band runs in both scripts. Linked only on the pages that carry it. */
@font-face { font-family: "Reem Kufi"; font-style: normal; font-weight: 600; font-display: block; src: url("/assets/cartouche/fonts/reem-kufi-600-arabic.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }

:root { --cut-face: #E9E6DE; --cut-shade: rgba(74, 60, 34, .34); --cut-lit: #FFFFFF; }
@media (prefers-color-scheme: dark) { :root:not([data-mode="light"]) { --cut-face: #0A0B0D; --cut-shade: #000; --cut-lit: rgba(255, 255, 255, .2); } }
:root[data-mode="dark"] { --cut-face: #0A0B0D; --cut-shade: #000; --cut-lit: rgba(255, 255, 255, .2); }

/* the word and the band reach the screen's edges, so the page stops clipping and the window does */
body { overflow-x: clip; }
.page { overflow-x: visible; }
/* the header's rule is the edge that crops the word from above */
.top { position: relative; z-index: 2; background: var(--paper); box-shadow: 0 0 0 100vmax var(--paper); clip-path: inset(-100vmax -100vmax 0 -100vmax); }

.cut-host { position: relative; }
.cut-host > :not(.cut) { position: relative; z-index: 1; }
/* phones: the word above the title, in a strip of its own */
.cut { position: relative; height: var(--cut-strip, 132px); pointer-events: none; user-select: none; -webkit-user-select: none; }
/* its window runs from the room beside the title out to the screen's edge, and up under the header */
.cut-win {
  position: absolute; top: -100vh; bottom: 12px; inset-inline-end: calc((100% - 100vw) / 2);
  --cut-room: var(--cut-room-m, 55%); width: calc(var(--cut-room) + (100vw - 100%) / 2); overflow: clip;
}
.cut-win span {
  position: absolute; inset-inline-start: 0; white-space: nowrap;
  font: 600 var(--cut-size-m, 180px)/1 "Reem Kufi", sans-serif;
  /* the lowest stroke sits on the window's floor: the line box's baseline is .15em up (ascent 1.1, descent .4) */
  bottom: calc((var(--cut-desc) - .15) * 1em);
  color: var(--cut-face); text-shadow: -1.5px -1.5px 0 var(--cut-shade), 1.5px 1.5px 0 var(--cut-lit);
}

/* A wide word (the stories, a piece, the hall) hangs from the header's rule instead: sized so the whole word fits
   the room beside the title, only its top cut by the rule. A word is never cut mid-word. On phones it takes a strip of
   its own between the header and the breadcrumbs. */
.cut.hang {
  --cw: calc(min(100vw, 720px) - var(--gut-l) - var(--gut-r));
  --s: min(var(--cut-size-m), calc(var(--cw) * var(--cut-room-m) / var(--cut-w)));
  height: calc(var(--s) * (var(--cut-asc) + var(--cut-desc) - .12) + 14px);
}
.cut.hang .cut-win { top: 0; bottom: auto; height: 100vh; inset-inline-end: 0; width: 100%; }
.cut.hang .cut-win span {
  inset-inline-start: auto; inset-inline-end: 0; bottom: auto; font-size: var(--s);
  /* the line box's baseline is .85em down; the ink's top goes .12em above the rule */
  top: calc((var(--cut-asc) - .85 - .12) * 1em);
}

/* English pages: the word on the right, the empty side of a left-to-right page, with its label under it */
.page[dir="ltr"] .cut:not(.hang) .cut-win { inset-inline-end: 0; width: 100%; }
.page[dir="ltr"] .cut:not(.hang) .cut-win span { inset-inline-start: auto; inset-inline-end: 0; }
.cut-label {
  position: absolute; inset-inline-end: 0; margin: 0; white-space: nowrap;
  font: 300 12px/1.4 var(--la); color: var(--ink-2); pointer-events: auto; user-select: text; -webkit-user-select: text;
}
.cut-label i { font-size: 14px; color: var(--ink); }
.cut.labelled:not(.hang) { height: calc(var(--cut-strip, 132px) + 44px); }
.cut.labelled:not(.hang) .cut-win { bottom: 52px; }
.cut.labelled:not(.hang) .cut-label { bottom: 22px; }
.cut-room { display: none; }
.cut.hang.labelled { height: calc(var(--s) * (var(--cut-asc) + var(--cut-desc) - .12) + 40px); }
.cut.hang .cut-label { top: calc(var(--s) * (var(--cut-asc) + var(--cut-desc) - .12) + 8px); }

/* the band: the project's sentence, repeated, our point between, centred and cut evenly by both screen edges */
.band {
  display: flex; justify-content: center; align-items: center; height: 50px; overflow: hidden;
  margin-inline: calc((100% - 100vw) / 2); border-block: 1px solid var(--hair);
  pointer-events: none; user-select: none; -webkit-user-select: none;
}
.band > div { flex: none; display: flex; align-items: center; gap: 22px; }
.band span {
  font: 600 21px/1 "Reem Kufi", sans-serif; white-space: nowrap;
  color: var(--cut-face); text-shadow: -1px -1px 0 var(--cut-shade), 1px 1px 0 var(--cut-lit);
}
/* on English pages the sentence alternates with its English, in capitals at the height of the Arabic letters' body */
.band span.en { font: 500 15px/1 var(--la); font-stretch: 125%; letter-spacing: .16em; }
.cut-win span::before, .band span::before { content: attr(data-w); }
.band i { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--cut-face); box-shadow: -1px -1px 0 var(--cut-shade), 1px 1px 0 var(--cut-lit); }

/* the host's foot is the band's top line, so the word's foot sits on it; the band takes over the rule that was there */
.masthead .cut-host { padding-bottom: 34px; }
.band + .trustline { border-top: 0; margin-top: 0; }
.p-head .cut-host { padding-bottom: 22px; }
.band + .facts-row { border-top: 0; margin-top: 0; }
.lib-intro .cut-host { padding-bottom: 26px; }
.lib-intro .band { margin-bottom: 22px; }
.hall-intro .cut-host { padding-bottom: 30px; }

/* wide screens: the word stands beside the title, at the size of a wall, its foot on the band */
@media (min-width: 1000px) {
  .cut { position: absolute; inset: 0; height: auto; }
  .cut-win { --cut-room: var(--cut-room-d, 46%); }
  .cut-win span { font-size: var(--cut-size-d, 420px); text-shadow: -2.5px -2.5px 0 var(--cut-shade), 2.5px 2.5px 0 var(--cut-lit); }
  .cut-win { bottom: 10px; }
  .cut.labelled:not(.hang) { height: auto; }
  .cut.labelled:not(.hang) .cut-win { bottom: 42px; }
  .cut.labelled:not(.hang) .cut-label { bottom: 12px; }
  .cut.hang.labelled { height: 0; }
  /* an English title runs wider, so the home's أثر stands a little smaller there */
  .page[dir="ltr"] .cut:not(.hang) .cut-win span { font-size: 380px; }
  .page[dir="ltr"] .cut-room { float: right; }
  .page[dir="rtl"] .cut-room { float: left; }
  /* the word's room on a first screen: it runs from the header's rule, so it is as tall as the word and its
     label (a little more than it needs below the rule, which only wraps a line early) */
  .cut-room {
    --cw: calc(min(100vw, 1240px) - var(--gut-l) - var(--gut-r)); --s: min(var(--cut-size-d), calc(var(--cw) * var(--cut-room-d) / var(--cut-w)));
    display: block; width: calc(var(--s) * var(--cut-w) + 32px); height: calc(var(--s) * (var(--cut-asc) + var(--cut-desc) - .12) + 34px);
  }
  .cut.hang { --cw: calc(min(100vw, 1240px) - var(--gut-l) - var(--gut-r)); --s: min(var(--cut-size-d), calc(var(--cw) * var(--cut-room-d) / var(--cut-w))); position: relative; inset: auto; height: 0; }
  .cut.hang .cut-win { bottom: auto; }
  .cut.hang .cut-win span { font-size: var(--s); }
  .masthead .cut-host { padding-bottom: 48px; }
  .p-head .cut-host { padding-bottom: 30px; }
  .lib-intro .cut-host { padding-bottom: 36px; }
  .lib-intro .band { margin-bottom: 28px; }
  .hall-intro .cut-host { padding-bottom: 40px; }
}
