@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/fonts/ibm-plex-mono-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/fonts/ibm-plex-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/space-grotesk-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/space-grotesk-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/ibm-plex-sans-arabic-400-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-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, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/fonts/ibm-plex-sans-arabic-500-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-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, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/fonts/ibm-plex-sans-arabic-600-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-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, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

/* ==========================================================================
   MSR Construction — the sheet.

   A different architecture from the beige site, not a different skin of it.

   There is no top navigation bar and nothing is centred in a column. The page
   is split: a fixed rail on the left carries the identity, the navigation and
   whatever the current page is *about*, and the whole of the right-hand side
   belongs to the photographs. Nothing is ever printed on top of a photograph —
   the rail says what the picture is, so the picture is left alone.

   Disciplines are an index of ruled rows, not a grid of cards. A work is a
   sequence of full-width plates read downward, like a set of drawing sheets.

   Ink is the ground; a cool paper is available from the toggle and remembered.
   Every foreground/background pair clears WCAG AA in both grounds, and
   `npm run audit` re-checks it against computed styles.
   ========================================================================== */

/* --- grounds ------------------------------------------------------------- */

:root {
  --bg: #0e1013;            /* gallery ink                    */
  --surface: #181c22;       /* raised panels                  */
  --fg: #edf1f5;            /* 16.8:1 on bg                   */
  --fg-2: #a6b0bb;          /*  8.7:1 on bg                   */
  --fg-3: #87919c;          /*  6.0:1 on bg, 5.3:1 on surface */
  --accent: #5aa7dd;        /*  7.3:1 on bg — anodised blue   */
  --accent-strong: #82c0ea; /*  9.7:1 on bg                   */

  --hair: rgb(237 241 245 / 0.13);
  --hair-strong: rgb(237 241 245 / 0.26);
  --wash: rgb(237 241 245 / 0.07);
  --rail-bg: rgb(14 16 19 / 0.94);
  --viewer-bg: rgb(8 9 11 / 0.97);
  --map-filter: grayscale(1) invert(0.92) contrast(0.85);
  --fade: 14 16 19;         /* the row wash, in the ground's own colour */

  color-scheme: dark;
}

/* Paper, chosen from the toggle. There is no system-preference switch: CSS
   reports `prefers-color-scheme: light` for a reader who has expressed no
   preference at all, so honouring it would quietly make paper the real default
   and undo the design. Ink is the ground; paper is opt-in and remembered. */
:root[data-theme='light'] {
  --bg: #f4f5f7;
  --surface: #e6e9ed;
  --fg: #101418;
  --fg-2: #494f57;
  --fg-3: #5e656e;
  --accent: #1f6698;
  --accent-strong: #17527b;

  --hair: rgb(16 20 24 / 0.16);
  --hair-strong: rgb(16 20 24 / 0.30);
  --wash: rgb(16 20 24 / 0.06);
  --rail-bg: rgb(244 245 247 / 0.94);
  --viewer-bg: rgb(244 245 247 / 0.97);
  --map-filter: grayscale(1) contrast(1.02);
  --fade: 244 245 247;

  color-scheme: light;
}

/* --- tokens -------------------------------------------------------------- */

:root {
  --display: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --fs-statement: clamp(2.3rem, 4.4vw, 4.2rem);
  --fs-xl: clamp(1.9rem, 3.4vw, 3.2rem);
  --fs-l: clamp(1.45rem, 2.2vw, 2rem);
  --fs-m: clamp(1.1rem, 1.5vw, 1.35rem);
  --fs-lede: clamp(1.02rem, 1.25vw, 1.2rem);
  --fs-body: 1rem;
  --fs-sm: 0.9375rem;
  --fs-label: 0.6875rem;

  --s1: 0.25rem;  --s2: 0.5rem;   --s3: 0.75rem;  --s4: 1rem;
  --s5: 1.5rem;   --s6: 2rem;     --s7: 3rem;     --s8: 4rem;
  --s9: 6rem;     --s10: 8rem;

  --rail-w: 21rem;
  --bar-h: 3.75rem;                       /* the rail's phone form */
  --pad: clamp(1.25rem, 2.6vw, 3rem);     /* the content column's own margin */
  --measure: 64ch;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- reset --------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar-h) + 1rem);
}

body {
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--fs-body)/1.6 var(--body);
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; background: var(--surface); }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--bg); }

.skip {
  position: fixed; inset-inline-start: var(--s4); top: var(--s4);
  z-index: 300; padding: var(--s3) var(--s5);
  background: var(--accent); color: var(--bg);
  font: 600 var(--fs-sm)/1 var(--display);
  translate: 0 -150%;
  transition: translate 0.2s var(--ease);
}
.skip:focus { translate: 0; }

.vh {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* --- type ---------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.statement { font-size: var(--fs-statement); letter-spacing: -0.032em; }
.h-xl { font-size: var(--fs-xl); letter-spacing: -0.026em; }
.h-l { font-size: var(--fs-l); }
.h-m { font-size: var(--fs-m); letter-spacing: -0.012em; }

.label {
  font: 500 var(--fs-label)/1.3 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.label--accent { color: var(--accent); }

.lede { font-size: var(--fs-lede); line-height: 1.55; color: var(--fg-2); text-wrap: pretty; }
.prose { max-width: var(--measure); color: var(--fg-2); text-wrap: pretty; }
.prose p + p { margin-top: 1.1em; }
.prose strong { color: var(--fg); font-weight: 600; }
.prose a { color: var(--accent); text-underline-offset: 3px; }

.tabnum { font-variant-numeric: tabular-nums; }

/* --- chrome -------------------------------------------------------------- */

/* A slim opaque register at the top, and nothing else. The photographs get the
   whole viewport width; the navigation gets out of the way into an overlay
   index that covers the page when it is asked for. Chrome is never laid over a
   photograph — the bar carries its own ground. */
.topbar {
  position: sticky; top: 0; z-index: 200;
  height: var(--bar-h);
  display: flex; align-items: center; gap: var(--s4);
  padding-inline: var(--pad);
  background: var(--bg);
  border-bottom: 1px solid var(--hair);
}

.brand { display: inline-flex; align-items: center; gap: var(--s3); text-decoration: none; }
.brand__mark { width: 1.75rem; height: 1.6rem; flex: none; }
.brand__name {
  font: 600 0.875rem/1 var(--display);
  letter-spacing: 0.12em; text-transform: uppercase;
}
.brand__name span { color: var(--fg-3); font-weight: 500; }

.topbar__acts { display: flex; align-items: center; gap: var(--s2); margin-inline-start: auto; }

/* The three links are in the bar at every width, not folded into the overlay:
   the overlay needs JavaScript, and with it blocked a phone would otherwise have
   no navigation at all. On a narrow bar the wordmark and the button's label give
   up their space instead. */
.topbar__links {
  display: flex; align-items: center;
  gap: clamp(0.75rem, 2.5vw, 2rem);
  margin-inline-start: auto;
}
@media (min-width: 48rem) { .topbar__acts { margin-inline-start: var(--s5); } }
@media (max-width: 30rem) {
  .brand__name { display: none; }
  .topbar { gap: var(--s2); padding-inline: var(--s4); }
  .topbar__links { gap: var(--s3); }
  .topbar__link { font-size: 0.8125rem; }
  .theme, .topbar__open { width: 2.25rem; min-width: 2.25rem; height: 2.25rem; }
  .topbar__open { padding-inline: 0; }
  .topbar__open .txt { display: none; }
}
.topbar__link {
  position: relative;
  font: 500 var(--fs-sm)/1 var(--display);
  color: var(--fg-2); text-decoration: none;
  padding-block: var(--s3);
  transition: color 0.2s var(--ease);
}
.topbar__link:hover { color: var(--fg); }
.topbar__link[aria-current] { color: var(--accent); }

.theme, .topbar__open {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: 2.5rem; min-width: 2.5rem;
  background: none; border: 1px solid var(--hair-strong);
  color: inherit; cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.topbar__open { padding-inline: var(--s3); font: 500 var(--fs-label)/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; }
.theme:hover, .topbar__open:hover { background: var(--wash); border-color: var(--fg-3); }
.theme svg, .topbar__open svg { width: 1.0625rem; height: 1.0625rem; }

/* show the ground you would switch *to* — this design starts on ink */
.theme .i-light { display: block; }
.theme .i-dark { display: none; }
:root[data-theme='light'] .theme .i-light { display: none; }
:root[data-theme='light'] .theme .i-dark { display: block; }

/* --- the index overlay --------------------------------------------------- */

.overlay {
  position: fixed; inset: 0; z-index: 250;
  background: var(--bg);
  overflow-y: auto; overscroll-behavior: contain;
  padding: var(--bar-h) 0 var(--s8);
}
.overlay[hidden] { display: none; }
.overlay__close {
  position: absolute; inset-block-start: calc((var(--bar-h) - 2.5rem) / 2); inset-inline-end: var(--pad);
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem;
  background: none; border: 1px solid var(--hair-strong); color: inherit; cursor: pointer;
}
.overlay__close:hover { background: var(--wash); border-color: var(--fg-3); }
.overlay__close svg { width: 1.0625rem; height: 1.0625rem; }

.overlay__head { padding: var(--s6) var(--pad) var(--s4); }
.overlay__nav { display: grid; border-top: 1px solid var(--hair); }
.overlay__link {
  display: flex; align-items: baseline; gap: var(--s4);
  padding: var(--s4) var(--pad);
  border-bottom: 1px solid var(--hair);
  text-decoration: none; color: var(--fg);
  font: 600 var(--fs-l)/1.15 var(--display); letter-spacing: -0.02em;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.overlay__link:hover { background: var(--wash); color: var(--accent); }
.overlay__link[aria-current] { color: var(--accent); }
.overlay__link .n { font: 500 var(--fs-label)/1 var(--mono); letter-spacing: 0.16em; color: var(--fg-3); margin-inline-start: auto; }

/* --- the context strip --------------------------------------------------- */

/* What the page is about, as a band under the bar rather than a column beside
   it: the label, a short line, and any way back. Never over a photograph. */
.strip {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: var(--s3) var(--s6);
  padding: var(--s4) var(--pad);
  border-bottom: 1px solid var(--hair);
}
.strip .prose { font-size: var(--fs-sm); max-width: 62ch; }
.strip__end { margin-inline-start: auto; }

/* --- footer -------------------------------------------------------------- */

.foot {
  display: grid; gap: var(--s5);
  padding: var(--s7) var(--pad) var(--s8);
  border-top: 1px solid var(--hair);
  font-size: var(--fs-sm); color: var(--fg-3);
}
@media (min-width: 48rem) {
  .foot { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s6); }
}
.foot a { color: var(--fg-2); text-decoration: none; display: inline-block; padding-block: var(--s1); }
.foot a:hover { color: var(--accent); }
.foot__links { display: flex; flex-direction: column; align-items: flex-start; }
.foot p + p { margin-top: var(--s2); }

/* --- the content column -------------------------------------------------- */

main { min-width: 0; }

.band { padding: var(--s8) var(--pad); }
.band--tight { padding-block: var(--s6); }
.band--flush { padding-inline: 0; }
.band + .band { border-top: 1px solid var(--hair); }

.band__head {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: var(--s3) var(--s5);
  margin-bottom: var(--s6);
}
.band__head h2 { margin-inline-end: auto; }

/* --- plate: a photograph given the whole column -------------------------- */

.plate { position: relative; overflow: clip; background: var(--surface); }
.plate .ph { height: 100%; }
.plate img { width: 100%; height: 100%; object-fit: cover; }
.plate--tall { aspect-ratio: 4 / 3; }
@media (min-width: 64rem) { .plate--tall { aspect-ratio: 16 / 9; } }

.plate__cap {
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5);
  padding: var(--s3) var(--pad) 0;
  font: 500 var(--fs-label)/1.5 var(--mono);
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-3);
}

/* --- index: the disciplines as ruled rows -------------------------------- */

.index { border-top: 1px solid var(--hair); }

.row {
  position: relative;
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s4);
  padding: var(--s5) var(--pad);
  border-bottom: 1px solid var(--hair);
  text-decoration: none;
  isolation: isolate;
  overflow: clip;
  transition: background 0.3s var(--ease);
}
.row:hover, .row:focus-visible { background: var(--wash); }

/* the photograph arrives as a band behind the rule, cropped to it */
.row__bg {
  position: absolute; inset: 0; z-index: -1;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}
.row__bg .ph { height: 100%; }
.row__bg img { width: 100%; height: 100%; object-fit: cover; }
.row__bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg,
    rgb(var(--fade) / 0.94) 0%, rgb(var(--fade) / 0.86) 45%, rgb(var(--fade) / 0.62) 100%);
}
@media (hover: hover) {
  .row:hover .row__bg, .row:focus-visible .row__bg { opacity: 1; }
}

.row__no { font: 500 var(--fs-label)/1 var(--mono); letter-spacing: 0.16em; color: var(--accent); }
.row__name { font-size: var(--fs-l); font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; }
.row__lede { display: none; color: var(--fg-2); font-size: var(--fs-sm); }
.row__meta {
  display: flex; align-items: center; gap: var(--s4);
  font: 500 var(--fs-label)/1 var(--mono);
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-3);
  white-space: nowrap;
}
.row__meta svg { width: 1rem; height: 1rem; transition: translate 0.3s var(--ease-out); }
.row:hover .row__meta svg { translate: 5px 0; }

@media (min-width: 56rem) {
  .row { grid-template-columns: 4.5rem minmax(0, 1fr) minmax(0, 20rem) auto; }
  .row__lede { display: block; }
}

/* --- mosaic: every work, as photographs ---------------------------------- */

.mosaic {
  display: grid;
  gap: 1px;
  background: var(--hair);
  border-block: 1px solid var(--hair);
}
@media (min-width: 34rem) { .mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 62rem) { .mosaic { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 92rem) { .mosaic { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.tile {
  position: relative;
  display: block;
  background: var(--bg);
  text-decoration: none;
  min-width: 0;
}
.tile__pic { aspect-ratio: 4 / 3; overflow: clip; background: var(--surface); }
.tile__pic .ph { height: 100%; }
.tile__pic img { width: 100%; height: 100%; object-fit: cover; transition: scale 0.7s var(--ease-out); }
.tile:hover .tile__pic img, .tile:focus-visible .tile__pic img { scale: 1.04; }
.tile__text { padding: var(--s4) var(--s5) var(--s6); min-width: 0; }
.tile__name { margin-top: var(--s2); font-size: var(--fs-m); }
.tile:hover .tile__name { color: var(--accent); }

/* --- essay: one work, read downward -------------------------------------- */

.essay { display: grid; gap: 1px; background: var(--hair); border-block: 1px solid var(--hair); }
.essay__item { background: var(--bg); margin: 0; position: relative; cursor: zoom-in; min-width: 0; }
.essay__item img { width: 100%; height: auto; }
.essay__cap {
  padding: var(--s3) var(--s5) var(--s5);
  font-size: var(--fs-sm); color: var(--fg-3);
  max-width: 70ch;
}
/* pairs on wide screens so a long set does not become an endless scroll */
@media (min-width: 62rem) { .essay { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* --- filters ------------------------------------------------------------- */

/* A ruled register rather than a row of pills, in the same language as the
   discipline index: text, a count, a hairline under the lot. */
.filters {
  display: flex; flex-wrap: wrap; align-items: stretch;
  gap: var(--s2) var(--s5);
  padding: var(--s3) var(--pad);
  border-bottom: 1px solid var(--hair);
}
.filters a, .filters button {
  display: inline-flex; align-items: center; gap: var(--s2);
  min-height: 2.25rem;
  padding: 0; background: none; border: 0;
  border-bottom: 2px solid transparent;
  color: var(--fg-2);
  font: 500 var(--fs-sm)/1.2 var(--display);
  text-decoration: none; cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.filters a:hover, .filters button:hover { color: var(--fg); }
.filters [aria-pressed='true'] { color: var(--accent); border-bottom-color: var(--accent); }
.filters .n { font: 500 var(--fs-label)/1 var(--mono); color: var(--fg-3); }

/* --- buttons and links --------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: var(--s3);
  min-height: 2.875rem;
  padding: var(--s3) var(--s5);
  background: var(--accent); color: var(--bg);
  border: 1px solid var(--accent);
  font: 600 var(--fs-sm)/1 var(--display);
  text-decoration: none; cursor: pointer;
  transition: background 0.22s var(--ease), border-color 0.22s var(--ease), color 0.22s var(--ease);
}
.btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn--ghost { background: transparent; color: var(--fg); border-color: var(--hair-strong); }
.btn--ghost:hover { background: var(--wash); border-color: var(--fg-3); }
.btn svg { width: 1rem; height: 1rem; transition: translate 0.25s var(--ease-out); }
.btn:hover svg { translate: 3px 0; }

.link {
  color: var(--accent);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size 0.32s var(--ease-out);
  padding-bottom: 1px;
}
.link:hover, .link:focus-visible { background-size: 100% 1px; }

.back {
  display: inline-flex; align-items: center; gap: var(--s2);
  min-height: 1.75rem;
  font: 500 var(--fs-label)/1.6 var(--mono);
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-3); text-decoration: none;
}
.back:hover { color: var(--accent); }
.back svg { width: 0.9rem; height: 0.9rem; }

/* --- counts -------------------------------------------------------------- */

.counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.counts__n { font: 600 var(--fs-l)/1 var(--display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.counts__k { margin-top: var(--s1); }

/* --- sheet: the prose pages ---------------------------------------------- */

.sheet { display: grid; gap: var(--s7); align-items: start; }
@media (min-width: 62rem) { .sheet { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--s8); } }
.sheet__facts { border-top: 1px solid var(--hair); }
.sheet__fact { display: grid; gap: var(--s1); padding-block: var(--s4); border-bottom: 1px solid var(--hair); }
.sheet__fact dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 40rem) {
  .sheet__fact { grid-template-columns: 11rem minmax(0, 1fr); gap: var(--s4); align-items: baseline; }
}

.map { width: 100%; aspect-ratio: 16 / 10; border: 1px solid var(--hair); filter: var(--map-filter); }

/* --- blur-up ------------------------------------------------------------- */

.ph { position: relative; overflow: clip; background-color: var(--surface); }
.ph::before {
  content: ''; position: absolute; inset: 0;
  background-image: var(--lqip); background-size: cover; background-position: center;
  filter: blur(12px); scale: 1.08;
  transition: opacity 0.5s var(--ease);
}
.ph img { position: relative; }
.ph[data-loaded='true']::before { opacity: 0; }

/* --- reveal -------------------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  translate: 0 0.75rem;
  transition: opacity 0.6s var(--ease-out), translate 0.7s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal][data-shown] { opacity: 1; translate: 0 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1; translate: none; }
  .ph::before { display: none; }
}

/* --- lightbox ------------------------------------------------------------ */

.lb {
  width: 100%; max-width: none; height: 100%; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: var(--viewer-bg); color: var(--fg);
  display: none;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.lb[open] { display: grid; }
.lb::backdrop { background: var(--viewer-bg); }

.lb__bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  padding: var(--s4) var(--pad);
  border-bottom: 1px solid var(--hair);
}
.lb__count { font: 500 var(--fs-label)/1 var(--mono); letter-spacing: 0.16em; color: var(--fg-3); }
.lb__nav { display: flex; align-items: center; gap: var(--s2); }
.lb__btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem;
  background: none; border: 1px solid var(--hair-strong);
  color: inherit; cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.lb__btn:hover:not(:disabled) { background: var(--wash); border-color: var(--fg-3); }
.lb__btn:disabled { opacity: 0.35; cursor: default; }
.lb__btn svg { width: 1.25rem; height: 1.25rem; }

.lb__stage { position: relative; display: grid; place-items: center; padding: var(--s4); min-height: 0; }
.lb__stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; background: none; }
.lb__prev, .lb__next { position: absolute; top: 50%; translate: 0 -50%; display: none; }
.lb__prev { inset-inline-start: var(--s4); }
.lb__next { inset-inline-end: var(--s4); }
.lb__cap { padding: var(--s4) var(--pad) var(--s6); font-size: var(--fs-sm); color: var(--fg-2); max-width: 80ch; }
@media (min-width: 62rem) {
  .lb__prev, .lb__next { display: inline-flex; }
  .lb__nav--bar { display: none; }
}

/* --- utilities ----------------------------------------------------------- */

.stack > * + * { margin-top: var(--s5); }
.stack-lg > * + * { margin-top: var(--s7); }
.tight > * + * { margin-top: var(--s3); }
.mt-4 { margin-top: var(--s4); }
.mt-6 { margin-top: var(--s6); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s3); }
.no-js-hide { display: none; }

/* --- language switch ----------------------------------------------------- */

.lang {
  display: inline-flex; align-items: center; justify-content: center;
  height: 2.5rem; min-width: 2.5rem; padding-inline: var(--s3);
  border: 1px solid var(--hair-strong);
  font: 500 var(--fs-sm)/1 var(--display);
  color: inherit; text-decoration: none;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.lang:hover { background: var(--wash); border-color: var(--fg-3); }
/* The English edition shows an Arabic word. It is set in the system's Arabic
   face on purpose: naming IBM Plex Sans Arabic here would make every English
   page download a 40 kB font just to draw one link. */
.lang[lang='ar'] { font-family: system-ui, 'Segoe UI', Tahoma, Arial, sans-serif; font-weight: 600; }
.lang__short { display: none; }
@media (max-width: 30rem) {
  .lang { width: 2.25rem; min-width: 2.25rem; height: 2.25rem; padding-inline: 0; }
  .lang__long { display: none; }
  .lang__short { display: inline; }
}

/* Narrowest phones: with the language switch the bar has six things to fit in
   320px, so the buttons and gaps tighten rather than anything being dropped. */
@media (max-width: 23rem) {
  .topbar { gap: var(--s1); padding-inline: var(--s3); }
  .topbar__links { gap: var(--s2); }
  .topbar__link { font-size: 0.75rem; }
  .topbar__acts { gap: var(--s1); }
  .theme, .topbar__open, .lang { width: 2rem; min-width: 2rem; height: 2rem; }
  .brand { gap: 0; }
}

/* --- Arabic edition ------------------------------------------------------ */

/* Right-to-left layout is carried by logical properties throughout this file,
   so what is left here is the part logic can't do: a different face and rhythm
   (Arabic needs air, and tracking breaks the joins between letters), and the
   few things that point somewhere. */
:root[lang='ar'] {
  --display: 'IBM Plex Sans Arabic', 'Space Grotesk', 'Segoe UI', Tahoma, Arial, sans-serif;
  --body: 'IBM Plex Sans Arabic', 'Inter', 'Segoe UI', Tahoma, Arial, sans-serif;
  --mono: 'IBM Plex Sans Arabic', 'IBM Plex Mono', 'Segoe UI', Tahoma, Arial, sans-serif;
  --fs-statement: clamp(2rem, 3.8vw, 3.5rem);
  --fs-xl: clamp(1.7rem, 3vw, 2.8rem);
  --fs-label: 0.8125rem;
  --fs-body: 1.0625rem;
  --fs-sm: 1rem;
}
:root[lang='ar'] * { letter-spacing: 0 !important; text-transform: none !important; }
:root[lang='ar'] body { line-height: 1.85; }
:root[lang='ar'] h1, :root[lang='ar'] h2, :root[lang='ar'] h3, :root[lang='ar'] h4 { line-height: 1.4; }
:root[lang='ar'] .statement { line-height: 1.3; }
:root[lang='ar'] .lede { line-height: 1.85; }
:root[lang='ar'] .label { line-height: 1.7; }
:root[lang='ar'] .tile__name { line-height: 1.5; }
:root[lang='ar'] .brand__name { font-weight: 600; }

/* arrows that mean "onward" / "back" mirror with the reading direction */
[dir='rtl'] .flip { transform: scaleX(-1); }
[dir='rtl'] .row:hover .row__meta svg { translate: -5px 0; }
[dir='rtl'] .btn:hover svg { translate: -3px 0; }
/* the photograph wash on an index row is held back on the side the text is on */
[dir='rtl'] .row__bg::after {
  background: linear-gradient(270deg,
    rgb(var(--fade) / 0.94) 0%, rgb(var(--fade) / 0.86) 45%, rgb(var(--fade) / 0.62) 100%);
}
/* in the viewer, "previous" sits on the reading-start side and points that way */
[dir='rtl'] .lb__prev svg, [dir='rtl'] .lb__next svg, [dir='rtl'] .lb__nav--bar svg { transform: scaleX(-1); }
