/* Qatar: Past & Present — "Living Pictures", an exhibition and its catalogue.
   Mobile-first. Logical properties throughout (Arabic mirrors). Only transform/opacity animate. */

/* ------------------------------------------------------------------ fonts: metric-matched fallbacks (no jump when web fonts arrive) */
@font-face { font-family: "Inter Fallback"; src: local("Arial"); size-adjust: 107%; ascent-override: 90%; descent-override: 22.5%; line-gap-override: 0%; }
@font-face { font-family: "Playfair Fallback"; src: local("Georgia"); size-adjust: 104%; ascent-override: 102%; descent-override: 24%; line-gap-override: 0%; }

:root {
  --night-950: #0d0807; --night-900: #160d0b; --night-800: #22140f; --night-700: #2e1c16;
  --ivory: #f3ead9; --ivory-72: rgba(243, 234, 217, .72); --ivory-60: rgba(243, 234, 217, .60); --ivory-48: rgba(243, 234, 217, .48); --ivory-14: rgba(243, 234, 217, .14);
  --gold: #d9b77e; --rose: #e9a6ba;
  --chip-past: rgba(110, 82, 55, .92); --chip-present: rgba(138, 21, 56, .92); --veil: rgba(14, 8, 8, .66);
  --sand-50: #fbf8f3; --sand-100: #f4ede2; --sand-200: #e9dfcf; --sand-300: #d8cab3;
  --ink: #1e1916; --ink-2: #4a403a; --muted: #6f645c; --maroon: #8a1538; --maroon-700: #6d1030; --maroon-900: #3f0a1d; --sepia: #7a5b3d;

  --display-en: "Playfair Display", "Playfair Fallback", Georgia, serif;
  --body-en: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --display-ar: "Noto Kufi Arabic", "Geeza Pro", "Segoe UI", Tahoma, sans-serif;
  --body-ar: "IBM Plex Sans Arabic", "Geeza Pro", "Segoe UI", Tahoma, sans-serif;
  --display: var(--display-en); --body: var(--body-en);

  --gutter: clamp(16px, 4.2vw, 32px);
  --header-h: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --container: 1200px;

  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --ease-sheet: cubic-bezier(.32, .72, 0, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --ease-sweep: cubic-bezier(.37, 0, .63, 1);
  --r-lg: 18px; --r-md: 12px; --r-sm: 10px;
}
@media (min-width: 960px) { :root { --header-h: 68px; } }
html[lang="ar"] { --display: var(--display-ar); --body: var(--body-ar); }

/* zones: every colour is a zone variable, so a section can switch with one attribute */
[data-zone="dark"] {
  --bg: var(--night-950); --panel: var(--night-900); --raised: var(--night-800);
  --fg: var(--ivory); --fg-2: var(--ivory-72); --fg-3: var(--ivory-60); --line: var(--ivory-14); --stroke: var(--ivory-48);
  --past: var(--gold); --present: var(--rose); --ring: var(--ivory); --link: var(--ivory);
  --btn-bg: var(--ivory); --btn-fg: var(--night-950);
  background: var(--bg); color: var(--fg);
}
[data-zone="light"] {
  --bg: var(--sand-50); --panel: #fff; --raised: var(--sand-100);
  --fg: var(--ink); --fg-2: var(--ink-2); --fg-3: var(--muted); --line: rgba(30, 25, 22, .12); --stroke: var(--muted);
  --past: var(--sepia); --present: var(--maroon); --ring: var(--maroon); --link: var(--maroon);
  --btn-bg: var(--maroon); --btn-fg: #fff;
  background: var(--bg); color: var(--fg);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + var(--safe-top) + 12px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; font-family: var(--body); font-size: 16px; line-height: 1.65; background: var(--night-950); color: var(--ivory);
  font-variant-numeric: lining-nums proportional-nums; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.page-archive { background: var(--sand-50); color: var(--ink); }
html[lang="ar"] body { font-size: 17px; line-height: 1.9; }
html.has-theatre, html.has-sheet { overflow: hidden; }
img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
bdi.num, .num { font-variant-numeric: lining-nums tabular-nums; unicode-bidi: isolate; }
/* focus: a 3px ring, ivory on dark and maroon on light (--ring is a zone token; the inline --focus on pictures is their object-position) */
:focus-visible { outline: 3px solid var(--ring, var(--maroon)); outline-offset: 3px; border-radius: 6px; }
/* full-bleed buttons inside overflow:hidden boxes: an inset ring (an outer one would be clipped) */
.frame .open-btn:focus-visible, .film-play:focus-visible, .glance-grid .cell button:focus-visible { outline: 3px solid #fff; outline-offset: -7px; box-shadow: inset 0 0 0 10px rgba(13, 8, 7, .55); }
/* round controls over pictures: white ring on a dark halo, readable on any image */
.cmp-knob:focus-visible, .cmp-pause:focus-visible, .frame .f-pause:focus-visible, .th-playpause:focus-visible, .th-side:focus-visible { outline: 3px solid #fff; outline-offset: 2px; border-radius: 50%; box-shadow: 0 0 0 7px rgba(13, 8, 7, .85); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.fill { fill: currentColor; stroke: none; }
html[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--ivory); color: var(--night-950); padding: 10px 16px; border-radius: 10px; font-weight: 600; --ring: var(--ivory); }
.page-archive .skip-link { --ring: var(--maroon); }
.skip-link:focus { top: calc(12px + var(--safe-top)); }
.noscript { padding: calc(var(--header-h) + 24px) var(--gutter) 24px; background: var(--sand-50); color: var(--ink); }
.noscript p + p { margin-top: 12px; }

/* ------------------------------------------------------------------ type */
.kicker { display: inline-flex; align-items: center; gap: 12px; font: 600 12px/1.2 var(--body-en); letter-spacing: .16em; text-transform: uppercase; color: var(--fg-2); margin: 0 0 14px; }
.kicker::before { content: ""; width: 24px; height: 1px; background: currentColor; opacity: .7; }
html[lang="ar"] .kicker { font: 600 14px/1.4 var(--body-ar); letter-spacing: 0; text-transform: none; }
.h2 { font-family: var(--display); font-size: clamp(2.25rem, 9vw, 4rem); line-height: 1.05; letter-spacing: -.01em; }
html[lang="ar"] .h2 { font-size: clamp(2rem, 8vw, 3.4rem); line-height: 1.35; letter-spacing: 0; }
.lead { font-size: 17px; line-height: 1.65; color: var(--fg-2); max-width: 62ch; }
html[lang="ar"] .lead { font-size: 18px; line-height: 1.9; max-width: 56ch; }

/* ------------------------------------------------------------------ buttons, chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1.5px solid transparent;
  background: var(--btn-bg); color: var(--btn-fg); font: 600 15px/1 var(--body); text-decoration: none; cursor: pointer; transition: transform .12s var(--ease-out), background-color .2s, color .2s, border-color .2s; }
.btn:active { transform: scale(.97); }
.btn .icon { width: 20px; height: 20px; }
.btn-outline { background: transparent; color: var(--fg); border-color: color-mix(in srgb, var(--fg) 45%, transparent); }
.btn-outline:hover { border-color: var(--fg); }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0; transition: background-color .2s, transform .12s var(--ease-out); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .icon { width: 22px; height: 22px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font: 600 12px/1 var(--body-en); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; color: #fff; }
html[lang="ar"] .chip { font-family: var(--body-ar); font-size: 13px; }
.chip-ai, .chip-cat, .chip-living { background: var(--veil); }
.chip-ai { font-variant-numeric: lining-nums proportional-nums; }
.chip-past { background: var(--chip-past); }
.chip-present { background: var(--chip-present); }

/* ------------------------------------------------------------------ header */
.site-header { position: fixed; inset-inline: 0; top: 0; z-index: 40; padding-top: var(--safe-top); color: #fff; transition: color .24s var(--ease-out); --ring: var(--ivory); }
.site-header::before { content: ""; position: absolute; inset: 0; background: rgba(13, 8, 7, .94); border-bottom: 1px solid var(--ivory-14); opacity: 0; transition: opacity .24s var(--ease-out), background-color .24s; pointer-events: none; }
.site-header[data-over="dark"]::before { opacity: 1; }
.site-header[data-over="light"] { color: var(--ink); --ring: var(--maroon); }
.site-header[data-over="light"]::before { opacity: 1; background: rgba(251, 248, 243, .96); border-bottom-color: rgba(30, 25, 22, .1); }
.header-inner { position: relative; display: flex; align-items: center; gap: 8px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; margin-inline-end: auto; min-height: 44px; }
.brand-mark { width: 32px; height: 32px; flex: none; border-radius: 8px; }
.site-header[data-over="light"] .brand-mark { box-shadow: 0 0 0 1px rgba(30, 25, 22, .14); }
.brand-text { font: 600 15px/1.2 var(--body); letter-spacing: .01em; white-space: nowrap; }
/* below 760 the wordmark is hidden visually only, so the logo link keeps its name (a11y#4) */
@media (max-width: 759.98px) { .brand-text { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); } }
@media (min-width: 760px) { .header-inner { gap: 12px; } }
.site-nav { display: none; }
@media (min-width: 1080px) {
  .site-nav { display: flex; gap: 22px; margin-inline-end: 12px; }
  .site-nav a { position: relative; color: inherit; text-decoration: none; font: 500 15px/1 var(--body); padding: 14px 0; opacity: .88; white-space: nowrap; }
  .site-nav a:hover, .site-nav a[aria-current] { opacity: 1; }
  .site-nav a::after { content: ""; position: absolute; inset-inline: 0; bottom: 8px; height: 1.5px; background: currentColor; transform: scaleX(0); transform-origin: left center; transition: transform .24s var(--ease-out); }
  html[dir="rtl"] .site-nav a::after { transform-origin: right center; }
  .site-nav a:hover::after, .site-nav a[aria-current]::after { transform: scaleX(1); }
  .site-nav .nav-archive { display: inline-flex; align-items: center; gap: 6px; }
  .site-nav .nav-archive .icon { width: 16px; height: 16px; }
  .site-nav .nav-archive[aria-current] .icon { opacity: .45; }
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.btn-download { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--maroon); color: #fff; font: 600 14px/1 var(--body); text-decoration: none; white-space: nowrap; box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset; transition: background-color .2s, transform .12s var(--ease-out); }
.btn-download:hover { background: var(--maroon-700); }
.btn-download:active { transform: scale(.97); }
.btn-download .icon { width: 18px; height: 18px; }
@media (max-width: 359px) { .btn-download { width: 40px; padding: 0; justify-content: center; } .btn-download .dl-label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); } }
.lang-toggle { height: 40px; min-width: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid currentColor; background: transparent; cursor: pointer; font: 600 14px/1 var(--body-ar); color: inherit; opacity: .92; }
.lang-toggle[lang="en"] { font-family: var(--body-en); }
.lang-toggle:hover { opacity: 1; }
.motion-toggle { display: none !important; }
@media (min-width: 1080px) { .motion-toggle { display: inline-grid !important; width: 40px; height: 40px; border: 1.5px solid currentColor; opacity: .92; } .menu-btn { display: none !important; } }
.motion-toggle .icon { width: 18px; height: 18px; }

/* ------------------------------------------------------------------ hero */
.hero { position: relative; background: linear-gradient(180deg, var(--maroon-900) 0%, var(--night-950) 100%); padding: calc(var(--header-h) + var(--safe-top) + 20px) var(--gutter) 28px; color: #fff; }
.hero-copy { position: relative; z-index: 4; max-width: 700px; margin-bottom: 20px; }
.eyebrow { font: 600 12px/1.3 var(--body-en); letter-spacing: .2em; text-transform: uppercase; opacity: .9; margin-bottom: 10px; }
html[lang="ar"] .eyebrow { font: 600 14px/1.5 var(--body-ar); letter-spacing: 0; text-transform: none; }
.hero h1 { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.title-en { font: 700 clamp(2rem, 8.6vw, 3.75rem)/1.06 var(--display-en); letter-spacing: -.01em; }
.title-ar { font: 700 clamp(1.45rem, 6.2vw, 2.6rem)/1.5 var(--display-ar); }
html[lang="ar"] .title-ar { order: -1; font-size: clamp(2rem, 8.6vw, 3.5rem); line-height: 1.35; }
html[lang="ar"] .title-en { font-size: clamp(1.3rem, 5.4vw, 2.2rem); opacity: .85; }
html[lang="en"] .title-ar { opacity: .85; }
.hero-sub { margin-top: 12px; font-size: 16px; line-height: 1.5; opacity: .9; max-width: 560px; }
html[lang="ar"] .hero-sub { font-size: 17px; line-height: 1.8; }
.hero-actions { display: flex; justify-content: center; margin-top: 16px; }
.hero-actions .btn { color: #fff; border-color: rgba(255, 255, 255, .55); background: transparent; min-height: 44px; }
.hero-actions .btn:hover { border-color: #fff; }
.hero .reveal-line { opacity: 0; transform: translateY(12px); animation: rise .7s var(--ease-out) forwards; }
.hero .reveal-line:nth-child(2) { animation-delay: 90ms; }
.hero .reveal-line:nth-child(3) { animation-delay: 180ms; }
@keyframes rise { to { opacity: 1; transform: none; } }
/* below 960: the copy box dissolves into the hero's column, so "Watch the film" can follow the picture as a full-width button */
@media (max-width: 959.98px) {
  .hero { display: flex; flex-direction: column; }
  .hero-copy { display: contents; }
  .hero-sub { margin-bottom: 20px; }
  .hero-actions { order: 1; }
  .hero-actions .btn { width: 100%; }
}

/* compare slider (hero + Theatre): transform-only wipe, no clip-path, no `left` */
.compare { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden; background: #241712; isolation: isolate;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; --pos: 50%; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6); }
@media (min-width: 600px) { .compare { aspect-ratio: 3 / 2; } }
.compare .layer { position: absolute; inset: 0; }
.compare .layer img, .compare .layer video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50%) 50%; }
.cmp-past { overflow: hidden; z-index: 1; transform: translateX(calc(var(--pos) - 100%)); will-change: transform; }
.cmp-past-inner { position: absolute; inset: 0; transform: translateX(calc(100% - var(--pos))); will-change: transform; }
html[dir="rtl"] .cmp-past { transform: translateX(calc(100% - var(--pos))); }
html[dir="rtl"] .cmp-past-inner { transform: translateX(calc(var(--pos) - 100%)); }
.cmp-divider { position: absolute; inset: 0; z-index: 3; pointer-events: none; transform: translateX(var(--pos)); will-change: transform; }
html[dir="rtl"] .cmp-divider { transform: translateX(calc(-1 * var(--pos))); }
.cmp-line { position: absolute; top: 0; bottom: 0; inset-inline-start: -1px; width: 2px; background: #fff; box-shadow: 0 0 10px rgba(0, 0, 0, .35); }
.cmp-knob { position: absolute; top: 50%; left: 0; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--maroon); box-shadow: 0 6px 22px rgba(0, 0, 0, .35); pointer-events: auto; cursor: ew-resize; touch-action: none; transition: transform .12s var(--ease-out); }
html[dir="rtl"] .cmp-knob { left: auto; right: 0; margin: -26px -26px 0 0; }
.cmp-knob .icon { width: 26px; height: 26px; }
.compare.dragging .cmp-knob { transform: scale(1.06); }
.cmp-hint { position: absolute; top: calc(50% + 38px); left: 0; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
  border-radius: 999px; background: rgba(18, 10, 8, .72); color: #fff; font: 600 13px/1 var(--body); white-space: nowrap; transition: opacity .45s var(--ease-out); }
html[dir="rtl"] .cmp-hint { left: auto; right: 0; transform: translateX(50%); }
.cmp-hint .icon { width: 16px; height: 16px; }
.compare.touched .cmp-hint { opacity: 0; }
.cmp-tag { position: absolute; bottom: 12px; z-index: 4; }
.cmp-tag.tag-past { inset-inline-start: 12px; }
.cmp-tag.tag-present { inset-inline-end: 12px; }
.cmp-ai { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 4; }
.cmp-pause { position: absolute; top: 8px; inset-inline-start: 8px; z-index: 4; width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; color: #fff; padding: 0; }
.cmp-pause span { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--veil); box-shadow: 0 0 0 1px rgba(255, 255, 255, .2); }
.cmp-pause .icon { width: 18px; height: 18px; }
.compare .vid { opacity: 0; transition: opacity .6s var(--ease-out); }
.compare.alive .vid { opacity: 1; }
.compare:not(.has-video):not(.sweep) .cmp-pause { display: none; }
@media (min-width: 960px) {
  .hero { height: clamp(620px, 100svh, 920px); padding: 0; }
  .hero .compare { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
  .hero .compare::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background: linear-gradient(90deg, rgba(10, 6, 4, .62) 0%, rgba(10, 6, 4, .25) 38%, rgba(10, 6, 4, 0) 60%), linear-gradient(180deg, rgba(10, 6, 4, .5) 0%, rgba(10, 6, 4, 0) 26%); }
  html[dir="rtl"] .hero .compare::after { background: linear-gradient(270deg, rgba(10, 6, 4, .62) 0%, rgba(10, 6, 4, .25) 38%, rgba(10, 6, 4, 0) 60%), linear-gradient(180deg, rgba(10, 6, 4, .5) 0%, rgba(10, 6, 4, 0) 26%); }
  .hero-copy { position: absolute; z-index: 5; top: calc(var(--header-h) + 64px); inset-inline-start: max(var(--gutter), calc((100vw - var(--container)) / 2)); width: min(700px, 52%); pointer-events: none; }
  .hero-copy a, .hero-copy button { pointer-events: auto; }
  .title-en { font-size: clamp(2.8rem, 4.1vw, 3.75rem); }
  .hero-actions { justify-content: flex-start; margin-top: 24px; }
  .hero-actions .btn { min-height: 48px; }
  .hero .cmp-line { top: calc(var(--header-h) + var(--safe-top)); background: linear-gradient(rgba(255, 255, 255, 0), #fff 48px); }
  .cmp-knob { width: 60px; height: 60px; margin: -30px 0 0 -30px; }
  html[dir="rtl"] .cmp-knob { margin: -30px -30px 0 0; }
  .cmp-tag { bottom: 28px; }
  .hero .cmp-tag.tag-past { inset-inline-start: max(var(--gutter), calc((100vw - var(--container)) / 2)); }
  .hero .cmp-tag.tag-present { inset-inline-end: max(var(--gutter), calc((100vw - var(--container)) / 2)); }
  .hero .cmp-ai { top: calc(var(--header-h) + 16px); inset-inline-end: max(var(--gutter), calc((100vw - var(--container)) / 2)); }
  .hero .cmp-pause { top: auto; bottom: 64px; inset-inline-start: auto; inset-inline-end: max(calc(var(--gutter) - 4px), calc((100vw - var(--container)) / 2 - 4px)); }
}


/* hero sweep: three synchronised keyframe animations (50% ±21%, 6.4 s period), mirrored in Arabic */
.compare.sweep .cmp-past { animation: sw-outer 3.2s var(--ease-sweep) -1.6s infinite alternate; }
.compare.sweep .cmp-past-inner { animation: sw-inner 3.2s var(--ease-sweep) -1.6s infinite alternate; }
.compare.sweep .cmp-divider { animation: sw-div 3.2s var(--ease-sweep) -1.6s infinite alternate; }
html[dir="rtl"] .compare.sweep .cmp-past { animation-name: sw-outer-rtl; }
html[dir="rtl"] .compare.sweep .cmp-past-inner { animation-name: sw-inner-rtl; }
html[dir="rtl"] .compare.sweep .cmp-divider { animation-name: sw-div-rtl; }
.compare.sweep-paused .cmp-past, .compare.sweep-paused .cmp-past-inner, .compare.sweep-paused .cmp-divider { animation-play-state: paused; }
html.motion-off .compare.sweep :is(.cmp-past, .cmp-past-inner, .cmp-divider) { animation-play-state: paused; }
@keyframes sw-outer { from { transform: translateX(-71%); } to { transform: translateX(-29%); } }
@keyframes sw-inner { from { transform: translateX(71%); } to { transform: translateX(29%); } }
@keyframes sw-div { from { transform: translateX(29%); } to { transform: translateX(71%); } }
@keyframes sw-outer-rtl { from { transform: translateX(71%); } to { transform: translateX(29%); } }
@keyframes sw-inner-rtl { from { transform: translateX(-71%); } to { transform: translateX(-29%); } }
@keyframes sw-div-rtl { from { transform: translateX(-29%); } to { transform: translateX(-71%); } }

/* ------------------------------------------------------------------ prologue */
.prologue { text-align: center; padding: 72px var(--gutter) 64px; }
.prologue .lines { max-width: 760px; margin: 0 auto; font: 700 24px/1.35 var(--display); font-variant-numeric: lining-nums; }
html[lang="ar"] .prologue .lines { font-size: 21px; line-height: 1.75; }
.prologue .lines p { text-wrap: balance; }
.prologue .lines p + p { margin-top: 6px; }
.prologue .lines p:last-child { color: var(--fg-2); }
.prologue .ai-note { display: inline-flex; align-items: flex-start; gap: 10px; margin: 28px auto 0; max-width: 560px; padding: 12px 16px; border-radius: 14px; background: var(--raised); color: var(--fg-2); font-size: 14px; line-height: 1.5; text-align: start; }
html[lang="ar"] .prologue .ai-note { font-size: 15px; line-height: 1.8; }
.prologue .ai-note .chip { flex: none; }
.room-links { display: grid; max-width: 560px; margin: 28px auto 0; border-top: 1px solid var(--line); text-align: start; }
.room-links a { display: grid; grid-template-columns: 32px minmax(0, 1fr) 18px; gap: 12px; align-items: center; min-height: 48px; padding: 0 4px; border-bottom: 1px solid var(--line); color: var(--fg); text-decoration: none; font: 500 16px/1.3 var(--body); }
.room-links .rl-num { font: 700 18px/1 var(--display-en); font-variant-numeric: lining-nums; color: var(--fg-2); text-align: center; }
html[lang="ar"] .room-links .rl-num { font-family: var(--display-ar); font-size: 17px; line-height: 1.4; }
.room-links a:nth-child(1) .rl-num::before { content: "I"; }
.room-links a:nth-child(2) .rl-num::before { content: "II"; }
.room-links a:nth-child(3) .rl-num::before { content: "III"; }
html[lang="ar"] .room-links a:nth-child(1) .rl-num::before { content: "\661"; }
html[lang="ar"] .room-links a:nth-child(2) .rl-num::before { content: "\662"; }
html[lang="ar"] .room-links a:nth-child(3) .rl-num::before { content: "\663"; }
.room-links .icon { width: 18px; height: 18px; color: var(--fg-3); }
@media (min-width: 600px) {
  .room-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: none; border-top: 0; }
  .room-links a { display: inline-flex; gap: 10px; min-height: 44px; padding: 0 18px 0 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; line-height: 1; }
  .room-links a:hover { border-color: var(--fg-2); }
  .room-links .rl-num { font-size: 15px; }
  .room-links .icon { display: none; }
}
@media (min-width: 1080px) { .prologue { padding: 128px var(--gutter) 96px; } .prologue .lines { font-size: 32px; } html[lang="ar"] .prologue .lines { font-size: 28px; } }

/* ------------------------------------------------------------------ rooms */
.room { padding-bottom: 32px; }
.room-head { position: relative; text-align: center; padding: 72px var(--gutter) 48px; overflow: hidden; }
.room-num { display: block; margin: 0 auto 6px; font: 700 clamp(76px, 22vw, 140px)/1 var(--display-en); font-variant-numeric: lining-nums; letter-spacing: .02em; color: transparent; -webkit-text-stroke: 1.25px rgba(243, 234, 217, .42); opacity: 0; transition: opacity .9s var(--ease-out); pointer-events: none; user-select: none; }
html[lang="ar"] .room-num { font-family: var(--display-ar); font-size: clamp(72px, 20vw, 128px); line-height: 1.25; color: rgba(243, 234, 217, .16); -webkit-text-stroke: 0; }
.room-head.in .room-num { opacity: 1; }
.room-head .kicker { justify-content: center; position: relative; }
.room-head .kicker::before { display: none; }
.room-2 .room-head .kicker { color: var(--gold); }
.room-3 .room-head .kicker { color: var(--rose); }
.room-title { position: relative; }
.room-title .alt { display: block; margin-top: 6px; font-size: .5em; opacity: .7; line-height: 1.4; }
.room-title .alt:lang(ar) { font-family: var(--display-ar); }
.room-title .alt:lang(en) { font-family: var(--display-en); }
.horizon { display: block; position: relative; width: 64%; max-width: 520px; height: 1px; margin: 28px auto 22px; background: var(--stroke); transform: scaleX(0); transform-origin: left center; transition: transform 1.2s var(--ease-out); }
html[dir="rtl"] .horizon { transform-origin: right center; }
.room-head.in .horizon { transform: scaleX(1); }
.room-intro { position: relative; max-width: 56ch; margin: 0 auto; color: var(--fg-2); text-wrap: balance; }
.room-head .rise { opacity: 0; transform: translateY(20px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.room-head .rise.d2 { transition-delay: .24s; }
.room-head.in .rise { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ exhibits */
.exhibit { padding: 0 0 64px; }
.exhibit-head { padding: 0 var(--gutter) 16px; }
.exhibit-kicker { font: 600 12px/1.3 var(--body-en); letter-spacing: .16em; text-transform: uppercase; color: var(--fg-2); margin-bottom: 8px; }
html[lang="ar"] .exhibit-kicker { font: 600 14px/1.5 var(--body-ar); letter-spacing: 0; text-transform: none; }
.exhibit-title { font: 700 26px/1.15 var(--display); font-variant-numeric: lining-nums; }
html[lang="ar"] .exhibit-title { font-size: 23px; line-height: 1.55; }
.t-sub { display: inline-block; }
.exhibit-meta { margin-top: 8px; font: 500 13px/1.4 var(--body); font-variant-numeric: lining-nums tabular-nums; color: var(--fg-2); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
html[lang="ar"] .exhibit-meta { font-size: 14px; }
.exhibit-meta .icon { width: 14px; height: 14px; }
.exhibit-body { padding: 16px var(--gutter) 0; }
.exhibit-num { display: none; }

/* living frame */
.frame { position: relative; overflow: hidden; background: var(--frame-colour, #2a1d17); aspect-ratio: 4 / 3; }
.frame img.poster, .frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50%) 50%; }
.frame video { opacity: 0; transition: opacity .4s var(--ease-out); }
.frame video.is-on { opacity: 1; }
.frame .veil { position: absolute; inset: 0; background: rgba(0, 0, 0, .08); transition: opacity .6s var(--ease-out); pointer-events: none; }
.frame[data-state="playing"] .veil { opacity: 0; }
.frame .open-btn { position: absolute; inset: 0; z-index: 2; border: 0; border-radius: inherit; background: transparent; cursor: zoom-in; padding: 0; }
.frame .f-chip { position: absolute; z-index: 3; pointer-events: none; }
.frame .f-era { bottom: 12px; inset-inline-start: 12px; }
.frame .f-ai { top: 12px; inset-inline-end: 12px; }
.frame .f-pause { position: absolute; z-index: 3; bottom: 8px; inset-inline-end: 8px; width: 44px; height: 44px; border: 0; padding: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: #fff; }
.frame .f-pause span { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--veil); box-shadow: 0 0 0 1px rgba(255, 255, 255, .2); }
.frame .f-pause .icon { width: 18px; height: 18px; }
.frame:not(.has-video) .f-pause { display: none; }
.frame .chip { transition: background-color .24s, opacity .24s; }

/* pair toolbar */
.toolbar { position: relative; display: grid; grid-template-columns: 1fr 1fr 1fr; width: calc(100% - 2 * var(--gutter)); max-width: 420px; height: 44px; margin: 12px var(--gutter) 0; padding: 4px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); }
.toolbar button { position: relative; z-index: 1; border: 0; background: transparent; border-radius: 999px; cursor: pointer; font: 600 13px/1.15 var(--body); color: var(--fg-2); display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 4px; transition: color .24s; white-space: nowrap; }
html[lang="ar"] .toolbar button { font-size: 14px; }
.toolbar button[aria-pressed="true"] { color: var(--night-950); }
.toolbar button .icon { width: 15px; height: 15px; }
.toolbar button .y { opacity: .75; font-weight: 500; }
.toolbar .thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3); border-radius: 999px; background: var(--ivory); transform: translateX(calc(var(--t, 0) * 100%)); transition: transform .24s var(--ease-out); }
html[dir="rtl"] .toolbar .thumb { left: auto; right: 4px; transform: translateX(calc(var(--t, 0) * -100%)); }

/* absent frame */
.absent { display: flex; align-items: center; gap: 14px; min-height: 64px; margin: 12px var(--gutter) 0; padding: 12px 16px; border-radius: var(--r-md); position: relative; color: var(--fg-2); }
.absent svg.dash, .absent-frame svg.dash { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.absent svg.dash rect, .absent-frame svg.dash rect { fill: none; stroke: var(--stroke); stroke-width: 1.5; stroke-dasharray: 6 6; }
.absent .a-icon { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); }
.absent .a-icon .icon { width: 20px; height: 20px; }
.absent .a-text { display: flex; flex-direction: column; line-height: 1.35; }
.absent .a-year { font: 600 13px/1.3 var(--body); color: var(--fg-3); }
.absent .a-label { font: 600 15px/1.35 var(--body); color: var(--fg); }
.draw .dash rect { stroke-dasharray: var(--len, 2000) var(--len, 2000); stroke-dashoffset: var(--len, 2000); transition: stroke-dashoffset .9s var(--ease-out); }
.draw.in .dash rect { stroke-dashoffset: 0; }
.draw.in.done .dash rect { stroke-dasharray: 6 6; transition: none; }
.draw .a-icon, .draw .a-text, .draw .a-body { opacity: 0; transition: opacity .4s var(--ease-out) .3s; }
.draw.in .a-icon, .draw.in .a-text, .draw.in .a-body { opacity: 1; }
.room-3 .absent { margin-top: 0; margin-bottom: 12px; }

/* story */
.story { color: var(--fg-2); }
.story p { font-size: 16px; line-height: 1.65; }
html[lang="ar"] .story p { font-size: 17px; line-height: 1.9; }
.story.clamped p { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 1079.98px) {
  html[lang="ar"] .story.clamped p { display: block; max-height: calc(4 * 1.9em); }
  html[lang="ar"] .story.clamped:has(.more:not([hidden])) p { -webkit-mask-image: linear-gradient(#000 calc(100% - 1.9em), transparent); mask-image: linear-gradient(#000 calc(100% - 1.9em), transparent); }
}
.story .more { margin-top: 2px; border: 0; background: none; padding: 8px 0; min-height: 44px; color: var(--fg); font: 600 14px/1 var(--body); cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.captions-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 2px; color: var(--fg); font: 600 14px/1 var(--body); text-decoration: none; background: none; border: 0; cursor: pointer; padding: 0; }
.captions-link .icon { width: 18px; height: 18px; }
.desk-captions { display: none; }

@media (min-width: 760px) {
  .exhibit .frame-wrap { padding-inline: var(--gutter); max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; }
  .exhibit .frame { aspect-ratio: 16 / 9; border-radius: var(--r-lg); }
  .exhibit .toolbar { margin-inline: 0; width: 100%; }
  .exhibit .absent { margin-inline: 0; }
  .exhibit-head, .exhibit-body { max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; }
}
@media (min-width: 1080px) {
  .exhibit { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter) 128px; align-items: start; }
  .exhibit-num { display: block; grid-column: 1 / 3; grid-row: 1; font: 700 88px/1 var(--display-en); font-variant-numeric: lining-nums; color: var(--present); opacity: .9; }
  .room-1 .exhibit-num { width: fit-content; background: linear-gradient(90deg, var(--past), var(--present)); -webkit-background-clip: text; background-clip: text; color: transparent; }
  html[dir="rtl"] .room-1 .exhibit-num { background-image: linear-gradient(270deg, var(--past), var(--present)); }
  .room-2 .exhibit-num { color: var(--past); }
  .exhibit-head { grid-column: 3 / 11; grid-row: 1; padding: 6px 0 24px; margin: 0; }
  .exhibit-title { font-size: 44px; line-height: 1.1; }
  html[lang="ar"] .exhibit-title { font-size: 38px; line-height: 1.55; }
  .exhibit .frame-wrap { grid-column: 1 / 9; grid-row: 2; padding: 0; margin: 0; position: sticky; top: calc(var(--header-h) + 24px); }
  .exhibit.single .frame-wrap { grid-row: 2 / span 2; }
  .exhibit .toolbar { margin: 14px 0 0; }
  .exhibit-body { grid-column: 9 / 13; grid-row: 2; padding: 0; margin: 0; }
  .desk-captions { display: block; margin-top: 24px; }
  .desk-captions .cap { padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--line); }
  .desk-captions .cap h4 { font: 600 15px/1.4 var(--body); margin: 8px 0 6px; }
  .desk-captions .cap p { font-size: 15px; line-height: 1.6; color: var(--fg-2); }
  html[lang="ar"] .desk-captions .cap p { font-size: 16px; line-height: 1.85; }
  .story.clamped p { -webkit-line-clamp: unset; display: block; }
  .story .more { display: none; }
  .exhibit.single .absent { display: none; }
  .exhibit.single .absent-frame { display: grid; grid-column: 9 / 13; grid-row: 2; }
  .room-3 .exhibit.single .frame-wrap { grid-column: 5 / 13; }
  .room-3 .exhibit.single .absent-frame { grid-column: 1 / 5; }
  .exhibit.single .exhibit-body { grid-row: 3; margin-top: 24px; }
  .room-2 .exhibit.single .exhibit-body { grid-column: 9 / 13; }
  .room-3 .exhibit.single .exhibit-body { grid-column: 1 / 5; }
}
.absent-frame { display: none; place-items: center; aspect-ratio: 16 / 9; position: relative; border-radius: var(--r-lg); color: var(--fg-2); text-align: center; padding: 16px; }
.absent-frame .a-icon { width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); }
.absent-frame .a-icon .icon { width: 22px; height: 22px; }
.absent-frame .a-year { display: block; font: 600 13px/1.3 var(--body); color: var(--fg-3); }
html[lang="ar"] :is(.absent, .absent-frame) .a-year { font-size: 14px; }
.absent-frame .a-label { display: block; font: 600 16px/1.4 var(--body); color: var(--fg); }
.absent-frame svg.dash rect { stroke-dasharray: 8 8; }

/* ------------------------------------------------------------------ film */
.film { padding: 80px 0 64px; background: linear-gradient(180deg, var(--night-950), #1a120f); }
.film-head { padding: 0 var(--gutter) 24px; max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto; }
.film-meta { margin-top: 10px; color: var(--fg-2); font-size: 14px; }
.film-player { position: relative; aspect-ratio: 16 / 9; background: #000; max-width: min(1200px, calc((100svh - var(--header-h) - var(--safe-top) - 56px) * 16 / 9)); margin: 0 auto; overflow: hidden; }
html.lights-down .film-player { z-index: 61; }
.film-player video, .film-player > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.film-player video { object-fit: contain; background: #000; }
.film-play { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; background: radial-gradient(closest-side, rgba(10, 6, 4, .3), rgba(10, 6, 4, 0)); cursor: pointer; }
.fp-circle { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--sand-50); color: var(--maroon); box-shadow: 0 12px 40px rgba(0, 0, 0, .45); transition: transform .18s var(--ease-out); }
.fp-circle .icon { width: 30px; height: 30px; transform: translateX(6%); }
.fp-label { position: absolute; top: calc(50% + 48px); height: 36px; padding: 0 16px; border-radius: 999px; background: rgba(18, 10, 8, .72); color: #fff; font: 600 15px/36px var(--body); white-space: nowrap; }
.film-play:hover .fp-circle { transform: scale(1.05); }
/* under the player; while the lights are down it stays above the overlay, dimmed, and comes up on hover or focus (decision 7, a11y#11) */
.film-under { max-width: calc(1200px + 2 * var(--gutter)); margin: 0 auto; padding: 20px var(--gutter) 0; display: grid; gap: 20px; transition: opacity .4s var(--ease-out); }
html.lights-down .film-under { position: relative; z-index: 61; opacity: .45; }
html.lights-down .film-under:is(:hover, :focus-within) { opacity: 1; }
.film-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
/* Save: a quiet text link, not a second download button (phone-en#15, C7) */
.film-save-link { display: inline-block; padding: 12px 0; color: var(--fg-2); font: 500 14px/20px var(--body); text-decoration: underline; text-underline-offset: .2em; }
.film-save-link:hover { color: var(--fg); }
.scenes-title { font: 600 13px/1.3 var(--body-en); letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 6px; }
html[lang="ar"] .scenes-title { font: 600 14px/1.4 var(--body-ar); letter-spacing: 0; text-transform: none; }
.scenes { list-style: none; margin: 0 -8px; padding: 0; display: grid; gap: 2px; }
.scenes button { width: 100%; display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; min-height: 52px; padding: 6px 8px; border: 0; border-radius: 10px; background: transparent; color: var(--fg); cursor: pointer; text-align: start; font-size: 14px; line-height: 1.35; }
.scenes button:hover { background: var(--raised); }
.scenes button[aria-current="true"] { background: var(--raised); box-shadow: inset 3px 0 0 var(--rose); }
html[dir="rtl"] .scenes button[aria-current="true"] { box-shadow: inset -3px 0 0 var(--rose); }
.scenes img { width: 56px; height: 32px; object-fit: cover; border-radius: 4px; background: var(--raised); }
.scenes .t { font-size: 13px; color: var(--fg-3); font-variant-numeric: lining-nums tabular-nums; }
@media (min-width: 1080px) {
  .film { padding-top: 48px; }
  .scenes { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(var(--rows, 5), auto); grid-auto-flow: column; column-gap: 24px; }
}
.lights { position: fixed; inset: 0; z-index: 60; background: rgba(5, 3, 2, .85); opacity: 0; pointer-events: none; transition: opacity .4s var(--ease-out); }
html.lights-down .lights { opacity: 1; transition-duration: .6s; }

/* lights up */
.lights-up { height: 120px; background: linear-gradient(180deg, #1a120f 0%, #5b3f2b 38%, #d9c2a0 72%, var(--sand-50) 100%); background: linear-gradient(180deg in oklab, #1a120f 0%, #5b3f2b 38%, #d9c2a0 72%, var(--sand-50) 100%); }
.lights-up + .section { padding-top: 32px; }
@media (min-width: 1080px) { .lights-up { height: 160px; } }

/* ------------------------------------------------------------------ light zone: sections */
.section { padding: 56px 0 72px; }
.section-head { max-width: 760px; margin-bottom: 28px; }
.section-head .h2 { font-size: clamp(2rem, 7vw, 3rem); }
html[lang="ar"] .section-head .h2 { font-size: clamp(1.8rem, 6.4vw, 2.6rem); }
.section-head .lead { margin-top: 12px; }

/* at a glance: rows below 1180, grid from 1180 */
.glance-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.glance-rows a { display: grid; grid-template-columns: 26px 118px minmax(0, 1fr) 20px; gap: 12px; align-items: center; min-height: 76px; padding: 10px 2px; border-bottom: 1px solid var(--line); color: var(--fg); text-decoration: none; }
.glance-rows .n { font: 600 13px/1 var(--body-en); font-variant-numeric: lining-nums tabular-nums; color: var(--fg-3); }
.glance-rows .thumbs { display: flex; gap: 6px; }
.glance-rows .thumbs > * { width: 56px; height: 32px; border-radius: 6px; object-fit: cover; background: var(--raised); flex: none; }
.glance-rows .empty { display: grid; place-items: center; border: 1.5px dashed var(--sand-300); background: transparent !important; color: var(--muted); }
.glance-rows .empty .icon { width: 15px; height: 15px; }
.glance-rows .t { display: flex; flex-direction: column; min-width: 0; }
.glance-rows .t strong { font: 600 15px/1.35 var(--body); }
html[lang="ar"] .glance-rows .t strong { line-height: 1.6; }
.glance-rows .t span { font-size: 13px; color: var(--fg-3); line-height: 1.4; }
html[lang="ar"] .glance-rows .t span { font-size: 14px; }
.glance-rows .chev { width: 18px; height: 18px; color: var(--fg-3); }
.glance-grid { display: none; }
@media (min-width: 1180px) {
  .glance-rows { display: none; }
  .glance-grid { display: grid; grid-template-columns: 88px repeat(7, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
  .glance-grid .gh { display: flex; flex-direction: column; gap: 8px; justify-content: flex-end; padding-bottom: 6px; }
  .glance-grid .gh strong { font: 600 14px/1.3 var(--body); }
  .glance-grid .gh a { font: 600 13px/1 var(--body); display: inline-flex; gap: 4px; align-items: center; min-height: 32px; }
  .glance-grid .gh a .icon { width: 14px; height: 14px; }
  .glance-grid .rh { display: flex; align-items: center; font: 600 13px/1.2 var(--body-en); letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }
  html[lang="ar"] .glance-grid .rh { font: 600 14px/1.4 var(--body-ar); letter-spacing: 0; text-transform: none; }
  .glance-grid .rh.past { color: var(--sepia); } .glance-grid .rh.present { color: var(--maroon); }
  .glance-grid .cell { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-sm); overflow: hidden; background: var(--sand-100); }
  .glance-grid .cell button { position: absolute; inset: 0; border: 0; border-radius: inherit; padding: 0; background: none; cursor: zoom-in; }
  .glance-grid .cell img { width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50%) 50%; }
  .glance-grid .cell video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50%) 50%; opacity: 0; transition: opacity .3s; pointer-events: none; }
  .glance-grid .cell video.is-on { opacity: 1; }
  .glance-grid .cell .y { position: absolute; bottom: 6px; inset-inline-start: 6px; font: 600 11px/1 var(--body-en); font-variant-numeric: lining-nums tabular-nums; color: #fff; background: rgba(14, 8, 8, .7); padding: 4px 7px; border-radius: 999px; pointer-events: none; }
  html[lang="ar"] .glance-grid .cell .y { font-family: var(--body-ar); font-size: 12px; }
  .glance-grid .cell.empty { display: grid; place-items: center; text-align: center; border: 1.5px dashed var(--sand-300); background: transparent; color: var(--muted); font-size: 12px; line-height: 1.35; padding: 8px; }
  .glance-grid .cell.empty .icon { width: 20px; height: 20px; margin: 0 auto 6px; }
}

/* teaser */
.teaser-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tcard { display: block; border-radius: var(--r-md); color: var(--fg); text-decoration: none; }
.tcard .ph { display: block; position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-md); overflow: hidden; background: var(--frame-colour, var(--sand-100)); }
.tcard img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-out); }
.tcard:hover img { transform: scale(1.03); }
.tcard .chip { position: absolute; bottom: 8px; inset-inline-start: 8px; height: 22px; font-size: 11px; }
.tcard strong { display: block; margin-top: 8px; font: 600 14px/1.35 var(--body); }
html[lang="ar"] .tcard strong { line-height: 1.6; }
.teaser-cta { margin-top: 20px; }
.teaser-cta .btn { width: 100%; min-height: 52px; background: transparent; color: var(--fg); border-color: rgba(30, 25, 22, .3); }
.teaser-grid .tcard:nth-child(n+5) { display: none; }
@media (max-width: 1079.98px) {
  .teaser-wrap { display: flex; flex-direction: column; }
  .teaser-wrap > .section-head { display: contents; }
  .teaser-grid { margin-top: 28px; }
  .teaser-cta { order: 1; }
}
@media (min-width: 1080px) {
  .teaser-wrap { display: grid; grid-template-columns: 4fr 8fr; gap: 48px; align-items: start; }
  .teaser-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .teaser-grid .tcard:nth-child(n+5) { display: block; }
  .teaser-cta .btn { width: auto; }
}

/* about */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 22px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 32px 1fr; gap: 14px; }
.steps li::before { content: counter(step); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--maroon); color: #fff; font: 600 14px/1 var(--body-en); }
.steps h3 { font: 600 16px/1.4 var(--body); margin-bottom: 4px; }
.steps p { color: var(--fg-2); font-size: 15px; line-height: 1.6; }
html[lang="ar"] .steps p { font-size: 16px; line-height: 1.85; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 28px 32px; } }
.disclosure { margin-top: 36px; padding: 18px 20px; border-radius: var(--r-md); border-start-start-radius: 0; border-end-start-radius: 0; background: #fff; border-inline-start: 4px solid var(--maroon); color: var(--fg-2); font-size: 15px; line-height: 1.6; }
html[lang="ar"] .disclosure { font-size: 16px; line-height: 1.85; }
.disclosure p + p { margin-top: 6px; }
.sources { margin-top: 28px; border-top: 1px solid var(--line); }
.sources summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; font: 600 15px/1.4 var(--body); }
.sources summary::-webkit-details-marker { display: none; }
.sources .sources-h { font: inherit; }
.sources summary .icon { width: 20px; height: 20px; transition: transform .2s; }
.sources[open] summary .icon { transform: rotate(90deg); }
html[dir="rtl"] .sources summary .icon { transform: scaleX(-1); }
html[dir="rtl"] .sources[open] summary .icon { transform: rotate(90deg); }
.sources .group { margin: 4px 0 18px; }
.sources .group h4 { font: 600 13px/1.4 var(--body); color: var(--fg-3); margin-bottom: 6px; }
.sources ul { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; font-size: 14px; }
.sources a { color: var(--maroon); overflow-wrap: anywhere; }
@media (min-width: 900px) { .sources .groups { columns: 2; column-gap: 40px; } .sources .group { break-inside: avoid; } }

/* footer */
.site-footer { padding: 40px 0 calc(40px + var(--safe-bottom)); border-top: 1px solid var(--line); }
.footer-inner { display: grid; gap: 16px; }
.footer-title { font: 700 18px/1.5 var(--display); font-variant-numeric: lining-nums; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.footer-title .sep { opacity: .4; }
html[lang="en"] .footer-title .sep { order: 1; }
html[lang="en"] .footer-title [lang="ar"] { order: 2; }
@media (max-width: 599.98px) { .footer-title { flex-direction: column; gap: 2px; } .footer-title .sep { display: none; } }
.footer-title [lang="ar"] { font-family: var(--display-ar); }
.footer-title [lang="en"] { font-family: var(--display-en); }
.footer-note { color: var(--fg-2); font-size: 14px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-block: 0; margin-inline: -10px 0; padding: 0; list-style: none; }
.footer-links a, .footer-links button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border: 0; background: none; color: var(--fg); font: 500 14px/1 var(--body); text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }

/* reveal (text only) */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }

/* notice (autoplay blocked) */
.notice { position: fixed; z-index: 70; inset-inline: 12px; bottom: calc(12px + var(--safe-bottom)); max-width: 460px; margin-inline: auto; padding: 12px 16px; border-radius: 14px; background: var(--night-800); color: var(--ivory); font-size: 14px; line-height: 1.45; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); display: flex; align-items: center; gap: 10px; }
.notice button { margin-inline-start: auto; }

/* ------------------------------------------------------------------ sheets (bottom sheet on phones, popover from 1080) */
dialog.sheet { padding: 0; border: 0; margin: 0; max-width: none; max-height: none; width: 100%; height: 100%; background: transparent; color: var(--ink); overflow: hidden; }
dialog.sheet::backdrop { background: rgba(10, 6, 4, .5); }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 86dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--sand-50); border-radius: 22px 22px 0 0; padding: 8px 20px calc(20px + var(--safe-bottom)); box-shadow: 0 -20px 50px rgba(0, 0, 0, .25); animation: sheet-up .36s var(--ease-sheet); --fg: var(--ink); --fg-2: var(--ink-2); --fg-3: var(--muted); --line: rgba(30, 25, 22, .12); --ring: var(--maroon); transition: transform .3s var(--ease-sheet); }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.sheet-grip { display: block; position: relative; width: 64px; height: 24px; margin: -4px auto 3px; touch-action: none; }
.sheet-grip::before { content: ""; position: absolute; inset-inline: 12px; top: 10px; height: 5px; border-radius: 3px; background: var(--sand-300); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; touch-action: none; }
.sheet-head h2 { font: 700 20px/1.3 var(--display); font-variant-numeric: lining-nums; }
.sheet-panel .icon-btn { color: var(--ink); }
.sheet-panel .icon-btn:hover { background: var(--sand-100); }
@media (min-width: 1080px) {
  .sheet-panel { left: auto; right: auto; bottom: auto; top: calc(var(--header-h) + var(--safe-top) + 8px); inset-inline-end: max(var(--gutter), calc((100vw - var(--container)) / 2)); width: 420px; border-radius: 18px; animation: pop .2s var(--ease-out); padding: 14px 18px 18px; }
  .sheet-grip { display: none; }
  dialog.sheet::backdrop { background: rgba(10, 6, 4, .18); }
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.dl-row { position: relative; display: grid; grid-template-columns: 40px 1fr 24px; gap: 14px; align-items: center; min-height: 64px; margin-inline: -6px; padding: 10px 6px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.dl-row:hover { background: var(--sand-100); }
.dl-row + .dl-row::before { content: ""; position: absolute; inset-inline: 6px; top: 0; height: 1px; background: rgba(30, 25, 22, .08); }
.dl-tile { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--maroon); color: #fff; }
.dl-tile .icon { width: 20px; height: 20px; }
.dl-text { display: flex; flex-direction: column; min-width: 0; }
.dl-label { font: 600 15px/1.35 var(--body); }
.dl-meta { font-size: 13px; font-variant-numeric: lining-nums tabular-nums; color: var(--muted); line-height: 1.4; }
html[lang="ar"] .dl-meta { font-size: 14px; }
.dl-go { width: 20px; height: 20px; color: var(--muted); }
.dl-note { font-size: 13px; color: var(--muted); margin-top: 12px; line-height: 1.5; }
html[lang="ar"] .dl-note { font-size: 14px; line-height: 1.8; }
.menu-list { list-style: none; margin: 0 -6px; padding: 0; display: grid; }
.menu-list a { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 6px; color: var(--ink); text-decoration: none; font: 600 16px/1.3 var(--body); border-bottom: 1px solid rgba(30, 25, 22, .08); }
.menu-list a .icon { width: 18px; height: 18px; color: var(--muted); }
.menu-row { display: flex; gap: 10px; margin-top: 16px; }
.menu-row .btn { flex: 1; min-height: 48px; background: transparent; color: var(--ink); border-color: rgba(30, 25, 22, .25); }

/* ------------------------------------------------------------------ Theatre */
dialog.theatre { padding: 0; border: 0; margin: 0; width: 100%; height: 100%; max-width: none; max-height: none; background: #0c0807; color: var(--ivory); overflow: hidden; }
dialog.theatre::backdrop { background: #0c0807; }
dialog.theatre[open] { animation: fade-in .2s var(--ease-out); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.th-shell { height: 100%; display: flex; flex-direction: column; --fg: var(--ivory); --fg-2: var(--ivory-72); --fg-3: var(--ivory-60); --line: var(--ivory-14); --raised: var(--night-800); --ring: var(--ivory); --link: var(--ivory); }
/* top bar: previous · counter · next at the start (phones), close at the end; logical padding mirrors in Arabic (code#25, phone-ar#8, C3) */
.th-top { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-block: calc(4px + var(--safe-top)) 4px; padding-inline: 8px; }
.th-pager { display: flex; align-items: center; }
.th-count { min-width: 4.5em; font: 600 14px/1 var(--body); font-variant-numeric: lining-nums tabular-nums; color: var(--ivory-72); text-align: center; }
/* the ends are ends (no wrap-around): a disabled previous/next looks disabled, phone and desktop alike */
.th-nav:disabled, .th-side:disabled { opacity: .3; cursor: default; }
/* the text scrolls under the pinned picture, so a focused control stops below it (C5, a11y#8) */
.th-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scroll-padding-top: calc(var(--stage-h, 56vw) + 12px); }
/* pinch-zoom only: the Theatre's own code takes sideways and downward swipes (decision 15, code#1) */
.th-stage { position: sticky; top: 0; z-index: 2; background: #0c0807; touch-action: pinch-zoom; }
.th-stage .th-media, .th-stage .th-photo, .th-stage .compare { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 0; }
.th-stage .th-photo { aspect-ratio: 3 / 2; background: #000; }
.th-stage .th-photo img { width: 100%; height: 100%; object-fit: contain; }
.th-stage .compare { border-radius: 0; box-shadow: none; aspect-ratio: 16 / 9; }
.th-stage .cmp-hint { top: auto; bottom: calc(50% + 38px); }
.th-media video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.th-playpause { position: absolute; bottom: 8px; inset-inline-end: 8px; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--veil); color: #fff; cursor: pointer; padding: 0; }
.th-playpause .icon { width: 18px; height: 18px; }
.th-side { display: none; }
.th-tabs { display: flex; gap: 6px; padding: 10px 12px 0; overflow-x: auto; scrollbar-width: none; }
.th-tabs::-webkit-scrollbar { display: none; }
.th-tab { flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--ivory-14); background: transparent; color: var(--ivory-72); font: 600 13px/1 var(--body); cursor: pointer; }
html[lang="ar"] .th-tab { font-size: 14px; }
.th-tab[aria-pressed="true"] { background: var(--ivory); color: var(--night-950); border-color: var(--ivory); }
.th-body { padding: 16px 16px calc(32px + var(--safe-bottom)); max-width: 780px; }
.th-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
/* the veil disappears on the Theatre's near-black, so these chips get a raised fill (phone-en#23, phone-ar#19, desktop#24) */
.th-chips .chip-ai, .th-chips .chip-cat { background: var(--night-800); box-shadow: inset 0 0 0 1px var(--ivory-14); }
.th-title { font: 700 26px/1.2 var(--display); font-variant-numeric: lining-nums; margin-bottom: 10px; }
html[lang="ar"] .th-title { font-size: 23px; line-height: 1.55; }
.th-caption { font-size: 16px; line-height: 1.65; color: var(--ivory); }
html[lang="ar"] .th-caption { font-size: 17px; line-height: 1.9; }
.th-block { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--ivory-14); }
.th-block h3, .th-block .th-k { font: 600 13px/1.3 var(--body-en); letter-spacing: .14em; text-transform: uppercase; color: var(--ivory-60); margin-bottom: 8px; }
html[lang="ar"] .th-block h3, html[lang="ar"] .th-block .th-k { font: 600 14px/1.4 var(--body-ar); letter-spacing: 0; text-transform: none; }
/* the story: a kicker, then the subject's title as a sentence-case heading (C4) */
.th-block .th-story-title { font: 600 16px/1.4 var(--body); letter-spacing: 0; text-transform: none; color: var(--ivory); }
html[lang="ar"] .th-block .th-story-title { font-size: 17px; line-height: 1.6; }
.th-block p { color: var(--ivory-72); font-size: 15px; line-height: 1.65; }
html[lang="ar"] .th-block p { font-size: 16px; line-height: 1.9; }
.th-block ul { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; font-size: 14px; }
.th-block a { color: var(--ivory); overflow-wrap: anywhere; }
.save-row { display: grid; grid-template-columns: 24px 1fr auto; gap: 12px; align-items: center; min-height: 48px; color: var(--ivory); text-decoration: none; border-bottom: 1px solid var(--ivory-14); }
.save-row .icon { width: 20px; height: 20px; }
.save-row .meta { font-size: 13px; font-variant-numeric: lining-nums tabular-nums; color: var(--ivory-60); }
html[lang="ar"] .save-row .meta { font-size: 14px; }
.th-pairlink { display: grid; grid-template-columns: 72px 1fr 20px; gap: 12px; align-items: center; width: 100%; margin-top: 20px; padding: 8px; border-radius: 12px; border: 1px solid var(--ivory-14); background: transparent; color: var(--ivory); text-align: start; cursor: pointer; }
.th-pairlink img { width: 72px; height: 40px; object-fit: cover; border-radius: 6px; }
.th-pairlink .k { display: block; font-size: 12px; color: var(--ivory-60); }
html[lang="ar"] .th-pairlink .k { font-size: 13px; line-height: 1.8; }
.th-pairlink .icon { width: 18px; height: 18px; }
.th-disclosure { margin-top: 20px; font-size: 12px; color: var(--ivory-60); }
html[lang="ar"] .th-disclosure { font-size: 13px; line-height: 1.8; }
.th-after { margin-top: 24px; }
/* phone landscape: the picture fills the height, so it scrolls away instead of covering the text (and a vertical drag on it scrolls) */
@media (orientation: landscape) and (max-height: 560px) {
  .th-scroll { scroll-padding-top: 0; }
  .th-stage { position: relative; touch-action: pan-y pinch-zoom; }
  .th-stage .th-media, .th-stage .compare, .th-stage .th-photo { aspect-ratio: auto; height: calc(100dvh - 56px); }
}
@media (min-width: 1080px) {
  .th-nav { display: none; }
  /* the counter lines up with the picture's start edge */
  .th-top { padding-inline-start: max(16px, calc((100% - min(1280px, (100dvh - 200px) * 16 / 9, 100% - 168px)) / 2)); }
  .th-count { min-width: 0; text-align: start; }
  .th-side { display: grid; position: absolute; top: 50%; z-index: 3; margin-top: -26px; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--veil); color: #fff; place-items: center; cursor: pointer; padding: 0; }
  .th-prev { inset-inline-start: 16px; } .th-next { inset-inline-end: 16px; }
  /* pinning is a phone pattern: on desktop the picture scrolls with the text (desktop#3); on touch screens a vertical drag on it scrolls too */
  .th-scroll { scroll-padding-top: 0; }
  .th-stage { position: relative; padding: 0 84px; touch-action: pan-y pinch-zoom; }
  .th-stage .th-media, .th-stage .compare, .th-stage .th-photo { max-width: min(1280px, calc((100dvh - 200px) * 16 / 9)); margin: 0 auto; }
  .th-body { margin: 0 auto; padding: 20px 24px 48px; }
  .th-tabs { justify-content: center; }
}
/* from 1440 the text sits in a 400px side panel and scrolls on its own; the picture and views stay centred beside it (desktop#3) */
@media (min-width: 1440px) {
  .th-top { padding-inline-start: max(16px, calc((100% - 400px - min(1280px, (100dvh - 140px) * 16 / 9, 100% - 568px)) / 2)); }
  .th-scroll { display: grid; grid-template-columns: minmax(0, 1fr) 400px; grid-template-rows: 1fr auto auto 1fr; }
  .th-stage { grid-column: 1; grid-row: 2; }
  .th-tabs { grid-column: 1; grid-row: 3; }
  .th-stage .th-media, .th-stage .compare { max-width: min(1280px, calc((100dvh - 140px) * 16 / 9)); }
  .th-stage .th-photo { max-width: min(1280px, calc((100dvh - 140px) * 3 / 2)); }
  .th-body { grid-column: 2; grid-row: 1 / -1; min-height: 0; max-width: none; margin: 0; padding: 12px 28px 48px; overflow-y: auto; overscroll-behavior: contain; border-inline-start: 1px solid var(--ivory-14); }
}

/* ------------------------------------------------------------------ archive page */
.page-archive .site-footer { --fg: var(--ink); --fg-2: var(--ink-2); --line: rgba(30, 25, 22, .12); }
.archive-intro { padding: calc(var(--header-h) + var(--safe-top) + 32px) 0 24px; }
.back-link { display: flex; width: fit-content; align-items: center; gap: 8px; min-height: 44px; color: var(--ink); font: 600 14px/1 var(--body); text-decoration: none; margin-bottom: 12px; }
.back-link .icon { width: 18px; height: 18px; }
.archive-intro h1 { font: 700 clamp(2.4rem, 11vw, 4.5rem)/1.05 var(--display); font-variant-numeric: lining-nums; letter-spacing: -.01em; }
html[lang="ar"] .archive-intro h1 { font-size: clamp(2.1rem, 9.5vw, 4rem); line-height: 1.4; letter-spacing: 0; }
.archive-intro .lead { margin-top: 14px; }
.colophon { margin-top: 14px; font: 500 13px/1.5 var(--body); color: var(--muted); }
html[lang="ar"] .colophon { font-size: 14px; }
.disclosure-line { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
html[lang="ar"] .disclosure-line { font-size: 14px; line-height: 1.8; }
.disclosure-line .chip { background: rgba(30, 25, 22, .78); flex: none; }
@media (min-width: 1080px) {
  .archive-intro .container { display: grid; grid-template-columns: 6fr 6fr; gap: 48px; align-items: end; }
  .archive-intro .side { padding-bottom: 8px; }
}
.controls { display: grid; gap: 12px; padding: 8px 0 18px; border-bottom: 1px solid var(--line); }
.control-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.control-row .lbl { font: 600 12px/1 var(--body-en); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); min-width: 64px; }
html[lang="ar"] .control-row .lbl { font: 600 14px/1.4 var(--body-ar); letter-spacing: 0; text-transform: none; min-width: 84px; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: #fff; border: 1px solid var(--line); gap: 2px; margin: 0; }
.seg label { position: relative; display: block; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.seg span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; font: 600 14px/1 var(--body); color: var(--ink-2); white-space: nowrap; }
.seg input:checked + span { background: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--maroon); outline-offset: 2px; }
.seg .past-l input:checked + span { background: var(--sepia); }
.seg .present-l input:checked + span { background: var(--maroon); }
.theme-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: 600 14px/1 var(--body); cursor: pointer; }
.theme-chip .icon { width: 18px; height: 18px; color: var(--muted); }
.theme-chip .c { font: 500 12px/1 var(--body-en); font-variant-numeric: lining-nums tabular-nums; color: var(--muted); }
.theme-chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.theme-chip[aria-pressed="true"] .icon, .theme-chip[aria-pressed="true"] .c { color: rgba(255, 255, 255, .75); }
.filter-panel { display: grid; gap: 12px; }
.filters-toggle { justify-self: start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: 600 14px/1 var(--body); cursor: pointer; }
.filters-toggle .icon { width: 18px; height: 18px; color: var(--muted); }
.filters-toggle[aria-expanded="true"] { border-color: var(--ink); }
.ft-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--maroon); color: #fff; font: 600 12px/20px var(--body-en); font-variant-numeric: lining-nums tabular-nums; text-align: center; }
.ft-count:empty { display: none; }
@media (max-width: 759.98px) { .filter-panel:not([data-open]) { display: none; } }
@media (min-width: 760px) { .filters-toggle { display: none; } }
.results { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 14px 0 6px; font-size: 14px; font-variant-numeric: lining-nums tabular-nums; color: var(--ink-2); min-height: 44px; }
.results button { border: 0; background: none; padding: 8px 0; color: var(--maroon); font: 600 14px/1 var(--body); text-decoration: underline; cursor: pointer; }
.kind-group { margin-top: 28px; }
.kind-group > h2 { font: 700 22px/1.3 var(--display); font-variant-numeric: lining-nums; margin-bottom: 14px; }
html[lang="ar"] .kind-group > h2 { font-size: 20px; line-height: 1.6; }
.cards { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1080px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { position: relative; background: #fff; border-radius: var(--r-lg); padding: 12px; border: 1px solid rgba(30, 25, 22, .06); box-shadow: 0 1px 2px rgba(30, 25, 22, .04); display: flex; flex-direction: column; }
.card .cells { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.card .cells.one { grid-template-columns: 1fr; }
.card .cell-btn { z-index: 1; }
.cell-btn { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-sm); overflow: hidden; background: var(--frame-colour, var(--sand-100)); border: 0; padding: 0; cursor: zoom-in; display: block; width: 100%; }
.cell-btn img, .cell-btn video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50%) 50%; }
.cell-btn video { opacity: 0; transition: opacity .3s var(--ease-out); }
.cell-btn video.is-on { opacity: 1; }
.cell-btn .chips { position: absolute; inset-inline: 6px; bottom: 6px; display: flex; flex-wrap: nowrap; gap: 4px; pointer-events: none; }
.cell-btn .chip { height: 22px; padding: 0 8px; font-size: 11px; }
html[lang="ar"] .cell-btn .chip { font-size: 12px; }
.cell-btn .cell-living { position: absolute; top: 8px; inset-inline-end: 8px; width: 24px; height: 24px; padding: 0; justify-content: center; pointer-events: none; }
.cell-living .icon { width: 14px; height: 14px; }
/* the hover preview is appended last: the chip and the living badge stay above it */
.cell-btn :is(.chips, .cell-living) { z-index: 1; }
.cell-empty { aspect-ratio: 16 / 9; border-radius: var(--r-sm); border: 1.5px dashed var(--sand-300); display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.35; padding: 8px; }
html[lang="ar"] .cell-empty { font-size: 13px; line-height: 1.8; }
.cell-empty .icon { width: 20px; height: 20px; margin: 0 auto 4px; }
.card .c-body { padding: 12px 0 4px; }
.card h3 { font: 700 19px/1.3 var(--display); font-variant-numeric: lining-nums; margin: 4px 0 6px; }
html[lang="ar"] .card h3 { font-size: 18px; line-height: 1.6; }
.card-open { padding: 0; border: 0; background: none; text-align: start; cursor: pointer; }
.card-open::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-lg); }
.card-open:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
/* the brief is one sentence; the clamp is only a safety net (decision 8). Arabic hides whole lines, never an ellipsis */
/* 7 lines: the longest one-sentence briefs (41–45 words) need 7 at 320px and 6 in the two-column layout */
.card p { font-size: 14px; line-height: 1.6; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
html[lang="ar"] .card p { font-size: 15px; line-height: 1.85; display: block; max-height: calc(6 * 1.85em); }
[hidden] { display: none !important; }
.empty-state { text-align: center; padding: 48px 16px; color: var(--ink-2); }
.empty-state .icon { width: 28px; height: 28px; margin: 0 auto 10px; color: var(--muted); }
/* timeline */
.timeline { position: relative; margin-top: 24px; padding-inline-start: 28px; }
.timeline::before { content: ""; position: absolute; top: 0; bottom: 0; inset-inline-start: 8px; width: 2px; background: var(--sand-300); }
.tl-decade { position: relative; margin: 26px 0 12px; font: 700 26px/1.2 var(--display-en); font-variant-numeric: lining-nums; }
html[lang="ar"] .tl-decade { font-family: var(--display-ar); line-height: 1.5; }
.tl-decade::before { content: ""; position: absolute; top: 50%; inset-inline-start: -26px; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--sand-50); border: 2px solid var(--ink); }
.tl-row { position: relative; display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 14px; align-items: center; padding: 10px 0; }
.tl-row::before { content: ""; position: absolute; top: 50%; inset-inline-start: -24px; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--maroon); }
.tl-row.past::before { background: var(--sepia); }
.tl-row .cell-btn .chips { display: none; }
.tl-row .yr { font: 600 13px/1.3 var(--body); color: var(--muted); }
html[lang="ar"] .tl-row .yr { font-size: 14px; }
.tl-row h3 { font: 600 16px/1.35 var(--body); margin: 2px 0 4px; }
html[lang="ar"] .tl-row h3 { line-height: 1.6; }
.tl-row p { font-size: 14px; line-height: 1.55; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
html[lang="ar"] .tl-row p:not(.yr) { font-size: 15px; line-height: 1.8; display: block; max-height: calc(3 * 1.8em); }
/* Arabic: the last kept line fades, only when text is really cut (the scroll timeline is inactive when it fits) */
@supports (animation-timeline: scroll()) {
  html[lang="ar"] :is(.card p, .tl-row p:not(.yr)) { animation: clamp-fade linear both; animation-timeline: scroll(self); }
}
@keyframes clamp-fade { from, to { -webkit-mask-image: linear-gradient(#000 calc(100% - 1lh), transparent); mask-image: linear-gradient(#000 calc(100% - 1lh), transparent); } }
.tl-gap { position: relative; margin: 20px 0; padding: 12px 0; }
.tl-gap::before { content: ""; position: absolute; top: 0; bottom: 0; inset-inline-start: -20px; width: 2px; background: repeating-linear-gradient(to bottom, var(--ink-2) 0 6px, transparent 6px 12px); }
.tl-gap h3 { font: 600 13px/1.4 var(--body-en); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
html[lang="ar"] .tl-gap h3 { font: 600 14px/1.5 var(--body-ar); letter-spacing: 0; text-transform: none; }
.tl-milestone { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 8px 0; font-size: 14px; line-height: 1.55; }
html[lang="ar"] .tl-milestone { font-size: 15px; line-height: 1.8; }
.tl-milestone .yr { font: 700 14px/1.5 var(--body-en); font-variant-numeric: lining-nums tabular-nums; color: var(--ink); white-space: nowrap; }
/* Arabic ranges are written in full («1938–1940», «1978–1981»): a wider year column so they stay on one line */
html[lang="ar"] .tl-milestone { grid-template-columns: 88px minmax(0, 1fr); }
/* milestones inside a decade (up to the last past picture) get a small marker on the timeline line */
.timeline > .tl-milestone { position: relative; }
.timeline > .tl-milestone::before { content: ""; position: absolute; top: 14.5px; inset-inline-start: -23px; width: 8px; height: 8px; border-radius: 50%; background: var(--sand-50); border: 2px solid var(--muted); }
/* the source link: a 16px icon in a 44px target that does not grow the line (phone-en#17, phone-ar#15, a11y#20) */
.tl-milestone a { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-block: -14px; margin-inline: -10px -14px; vertical-align: middle; border-radius: 50%; color: var(--muted); text-decoration: none; }
.tl-milestone a:hover { color: var(--maroon); }
.tl-milestone a .icon { width: 16px; height: 16px; }
.tl-milestone .ms-end { white-space: nowrap; }
/* readable measure (desktop#16) */
.tl-row h3, .tl-row p:not(.yr), .tl-milestone > span:last-child { max-width: 62ch; }
html[lang="ar"] :is(.tl-row h3, .tl-row p:not(.yr), .tl-milestone > span:last-child) { max-width: 56ch; }
@media (min-width: 760px) { .tl-row { grid-template-columns: 220px minmax(0, 1fr); gap: 20px; } .timeline { padding-inline-start: 40px; } .tl-decade::before { inset-inline-start: -38px; } .tl-row::before { inset-inline-start: -36px; } .tl-gap::before { inset-inline-start: -32px; } .timeline > .tl-milestone::before { inset-inline-start: -35px; } }
.archive-end { display: flex; flex-wrap: wrap; gap: 10px; padding: 48px 0 24px; }
.archive-end .btn { background: transparent; color: var(--ink); border-color: rgba(30, 25, 22, .3); }


/* ------------------------------------------------------------------ smooth page-to-page navigation (where supported; not under reduced motion, code#23) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .32s; animation-timing-function: var(--ease-out); }
.site-header { view-transition-name: site-header; }

/* ------------------------------------------------------------------ reduced motion, and Motion switched off (html.motion-off): everything in its final state at once */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal, .hero .reveal-line, .room-head .rise { opacity: 1 !important; transform: none !important; }
  .room-num { opacity: 1; }
  .horizon { transform: none; }
  .draw .dash rect { stroke-dashoffset: 0; }
  .draw .a-icon, .draw .a-text, .draw .a-body { opacity: 1; }
}
/* the same block for the visitor's Motion switch (decision 19, code#23) */
html.motion-off { scroll-behavior: auto; }
html.motion-off *, html.motion-off *::before, html.motion-off *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
html.motion-off :is(.reveal, .hero .reveal-line, .room-head .rise) { opacity: 1 !important; transform: none !important; }
html.motion-off .room-num { opacity: 1; }
html.motion-off .horizon { transform: none; }
html.motion-off .draw .dash rect { stroke-dashoffset: 0; }
html.motion-off :is(.draw .a-icon, .draw .a-text, .draw .a-body) { opacity: 1; }
