/* Page-only styles for /gallery (Photos). Loaded after style.css.
   Everything new is prefixed .ph-; shared .gallery* / .lightbox* / .nextnight rules from style.css
   are overridden here. Tiles crop the tall phone stills with object-fit, so nothing reads "long";
   the lightbox still shows the whole file. Motion uses transform / opacity / clip-path; JS
   (assets/gallery.js) only writes classes and custom properties. */

.ph-hero, .ph-sec, .ph-next {
  --ph-hand: "Caveat", "Bricolage Grotesque", cursive;
  --ph-g: clamp(10px, 1.35vw, 18px);
  --ph-r: var(--r-lg);
}
html[data-lang="ar"] .ph-hero, html[data-lang="ar"] .ph-sec, html[data-lang="ar"] .ph-next { --ph-hand: "Aref Ruqaa", "Alexandria", serif; }

/* =========================================================================
   Hero: a camera lens whose iris opens on load and closes as you scroll on
   ========================================================================= */
.ph-hero { position: relative; isolation: isolate; overflow: clip; padding: clamp(112px, 12vw, 150px) 0 clamp(40px, 6vw, 84px); }
.ph-hero__glow { position: absolute; inset: 0; z-index: -1; pointer-events: none; -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent); mask-image: linear-gradient(to bottom, #000 55%, transparent); }
.ph-hero__glow span { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .2; animation: ph-drift 24s ease-in-out infinite alternate; }
.ph-hero__glow span:nth-child(1) { width: 38vmax; aspect-ratio: 1; background: var(--ember); inset-inline-end: -10vmax; top: -14vmax; }
.ph-hero__glow span:nth-child(2) { width: 26vmax; aspect-ratio: 1; background: var(--trunk); inset-inline-end: 22%; bottom: -16vmax; opacity: .12; animation-duration: 29s; animation-delay: -9s; }
.ph-hero__glow span:nth-child(3) { width: 22vmax; aspect-ratio: 1; background: var(--leaf); inset-inline-start: -8vmax; top: 30%; opacity: .1; animation-duration: 33s; animation-delay: -15s; }
@keyframes ph-drift { 50% { transform: translate3d(3vmax, 2vmax, 0) scale(1.08); } 100% { transform: translate3d(-2vmax, 4vmax, 0) scale(.94); } }

.ph-hero__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 80px); align-items: center; }

.ph-roll {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 24px; padding: 8px 16px 8px 12px; border-radius: 6px;
  font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--bg); background: var(--ink); position: relative;
}
html[dir="rtl"] .ph-roll { padding: 8px 12px 8px 16px; letter-spacing: 0; font-size: .88rem; }
.ph-roll::before, .ph-roll::after { /* sprocket holes along the top and bottom edge */
  content: ""; position: absolute; inset-inline: 8px; height: 3px; opacity: .45;
  background: repeating-linear-gradient(90deg, var(--bg) 0 5px, transparent 5px 11px);
}
.ph-roll::before { top: 2px; } .ph-roll::after { bottom: 2px; }
.ph-roll__dot { width: 8px; height: 8px; border-radius: 50%; background: #ff5a4e; animation: ph-rec 1.6s steps(2, jump-none) infinite; }
@keyframes ph-rec { 50% { opacity: .25; } }

.ph-title { max-width: 15ch; }
.ph-title .ph-w { display: inline-block; }
.ph-title .ph-w > span { display: inline-block; opacity: 0; animation: ph-develop 1.25s var(--ease) forwards; animation-delay: calc(.12s + var(--i, 0) * .11s); }
.ph-title .ph-w:last-child > span { color: var(--ember-ink); }
@keyframes ph-develop {
  0% { opacity: 0; filter: blur(14px) sepia(1) brightness(1.6); transform: translateY(.18em) scale(1.04); }
  55% { opacity: 1; filter: blur(2px) sepia(.5) brightness(1.15); }
  100% { opacity: 1; filter: none; transform: none; }
}
.ph-sparkle { display: inline-block; width: .42em; height: .42em; margin-inline-start: .12em; vertical-align: .55em; color: var(--ember); animation: ph-twinkle 2.6s 1.6s var(--ease) infinite both; }
@keyframes ph-twinkle { 0%, 100% { transform: scale(.6) rotate(0); opacity: .5; } 12% { transform: scale(1.15) rotate(45deg); opacity: 1; } 30% { transform: scale(.85) rotate(90deg); opacity: .8; } }

.ph-in { animation: ph-rise .9s var(--ease) both; }
.ph-roll.ph-in { animation-delay: .05s; }
.hero-gallery__lede.ph-in { animation-delay: .65s; }
.ph-jump.ph-in { animation-delay: .8s; }
.ph-lens-wrap.ph-in { animation: ph-lens-in 1.2s .2s var(--ease) both; }
@keyframes ph-rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes ph-lens-in { from { opacity: 0; transform: scale(.82) rotate(-25deg); } }
html[dir="rtl"] .ph-lens-wrap.ph-in { animation-name: ph-lens-in-rtl; }
@keyframes ph-lens-in-rtl { from { opacity: 0; transform: scale(.82) rotate(25deg); } }

/* Jump chips: four little film frames with counts */
.ph-jump { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 36px; max-width: 560px; }
.ph-jump a {
  --a: var(--ember); --a-ink: var(--ember-ink);
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px; text-decoration: none; font-weight: 600; line-height: 1.25; color: var(--ink);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), 0 10px 26px -18px rgba(16, 27, 46, .55);
  transition: transform .45s var(--ease), box-shadow .3s;
}
html[dir="rtl"] .ph-jump a { padding: 12px 14px; }
.ph-jump a::before { /* accent edge that grows on hover */
  content: ""; position: absolute; inset-block: 10px; inset-inline-start: 0; width: 4px; border-radius: 0 4px 4px 0; background: var(--a);
  transform-origin: center; transform: scaleY(.55); transition: transform .4s var(--ease);
}
html[dir="rtl"] .ph-jump a::before { border-radius: 4px 0 0 4px; }
.ph-jump__no { font-size: .78rem; font-weight: 700; color: var(--a-ink); font-variant-numeric: tabular-nums; }
.ph-jump a small {
  min-width: 34px; padding: 3px 9px; border-radius: 999px; text-align: center; font-size: .82rem; font-weight: 700; font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--a) 16%, transparent); color: var(--a-ink); transition: background .3s, color .3s, transform .4s var(--ease);
}
.ph-jump a:hover, .ph-jump a:focus-visible { transform: translateY(-3px) rotate(-.6deg); box-shadow: inset 0 0 0 1.5px var(--a), 0 16px 30px -18px rgba(16, 27, 46, .6); }
html[dir="rtl"] .ph-jump a:hover, html[dir="rtl"] .ph-jump a:focus-visible { transform: translateY(-3px) rotate(.6deg); }
.ph-jump a:hover::before, .ph-jump a:focus-visible::before { transform: scaleY(1); }
.ph-jump a:hover small, .ph-jump a:focus-visible small { background: var(--a); color: #fff; transform: scale(1.08); }
.ph-jump a:active { transform: translateY(0) scale(.98); }
.ph-jump a.ph-jump--hc { --a: var(--leaf); --a-ink: var(--leaf); }
.ph-jump a.ph-jump--y5 { --a: var(--root); --a-ink: var(--root); }
.ph-jump a.ph-jump--nc { --a: var(--trunk); --a-ink: var(--trunk); }

/* The lens */
.ph-lens-wrap { display: grid; justify-items: center; gap: 14px; }
.ph-lens {
  --open: 1; --gx: 0px; --gy: 0px;
  position: relative; width: min(100%, 430px); aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: none; color: #fff; cursor: pointer;
  filter: drop-shadow(0 30px 40px rgba(16, 27, 46, .32)) drop-shadow(0 6px 10px rgba(16, 27, 46, .2));
  transition: transform .5s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.ph-lens:hover { transform: scale(1.02) rotate(-2deg); }
html[dir="rtl"] .ph-lens:hover { transform: scale(1.02) rotate(2deg); }
.ph-lens:active { transform: scale(.97); }
.ph-lens:focus-visible { outline: 3px solid var(--focus); outline-offset: 6px; }
.ph-lens__svg { width: 100%; height: 100%; overflow: hidden; border-radius: 50%; }
.ph-lens__barrel { fill: #121827; stroke: rgba(255, 255, 255, .08); stroke-width: 1; }
.ph-lens__dial { transform-box: view-box; transform-origin: 100px 100px; }
.ph-lens__ticks { stroke: rgba(255, 255, 255, .4); stroke-width: .8; stroke-linecap: round; fill: none; }
.ph-lens__mark { fill: var(--ember); }
.ph-lens__rim { fill: none; stroke: #2c3446; stroke-width: 5; }
.ph-lens__bokeh circle { transform-box: fill-box; transform-origin: center; animation: ph-bokeh 9s ease-in-out infinite alternate; filter: blur(2.5px); opacity: .75; }
.ph-lens__bokeh circle:nth-child(1) { fill: #f0b066; }
.ph-lens__bokeh circle:nth-child(2) { fill: #5fb3bd; animation-delay: -3s; animation-duration: 11s; }
.ph-lens__bokeh circle:nth-child(3) { fill: #e39a3b; animation-delay: -6s; }
.ph-lens__bokeh circle:nth-child(4) { fill: #8cc06f; animation-delay: -2s; animation-duration: 12s; }
.ph-lens__bokeh circle:nth-child(5) { fill: #ffe2b0; animation-delay: -5s; }
.ph-lens__bokeh circle:nth-child(6) { fill: #6f9ed6; animation-delay: -8s; animation-duration: 10s; }
@keyframes ph-bokeh { 0% { transform: translate(-4px, 3px) scale(.9); opacity: .55; } 100% { transform: translate(5px, -4px) scale(1.1); opacity: .9; } }
.ph-lens__blades path { fill: url(#phBlade); stroke: rgba(255, 255, 255, .16); stroke-width: .7; stroke-linejoin: round; }
.ph-lens__inner { fill: none; stroke: rgba(0, 0, 0, .55); stroke-width: 2; }
.ph-lens__glint { transform: translate(var(--gx), var(--gy)); mix-blend-mode: screen; }
.ph-lens__count {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; pointer-events: none;
  opacity: clamp(0, calc(var(--open) * 1.6 - .5), 1); transform: scale(calc(.82 + var(--open) * .18));
}
.ph-lens__count b { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 700; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; text-shadow: 0 2px 18px rgba(240, 176, 102, .55); }
.ph-lens__count span { margin-top: 4px; font-size: clamp(.68rem, 1vw, .8rem); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #f3d3a6; }
html[data-lang="ar"] .ph-lens__count span { letter-spacing: 0; font-size: clamp(.8rem, 1.1vw, .95rem); }
.ph-lens__tip { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 500; color: var(--muted); transition: opacity .6s; }
.ph-lens__tipdot { width: 8px; height: 8px; border-radius: 50%; background: var(--ember); animation: ph-ping 2s var(--ease) infinite; }
@keyframes ph-ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ember) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 9px transparent; } }
.ph-lens-wrap.is-shot .ph-lens__tip { opacity: 0; }

.ph-flash { position: fixed; inset: 0; z-index: 90; pointer-events: none; background: #fff; opacity: 0; }
.ph-flash.is-on { animation: ph-flash .55s ease-out; }
@keyframes ph-flash { 0% { opacity: 0; } 8% { opacity: .72; } 100% { opacity: 0; } }

/* =========================================================================
   Sections: one system, four moods
   ========================================================================= */
.ph-sec { --a: var(--ember); --a-ink: var(--ember-ink); scroll-margin-top: 72px; overflow-x: clip; }
.ph-sec--hc { --a: var(--leaf); --a-ink: var(--leaf); }
.ph-sec--y5 { --a: var(--root); --a-ink: var(--root); }
.ph-sec--nc { --a: var(--trunk); --a-ink: #7fd0d9; }

.ph-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: 8px clamp(16px, 2.6vw, 32px); margin-bottom: clamp(22px, 3vw, 34px); }
.ph-head__no {
  font-size: clamp(3.6rem, 8vw, 6.6rem); font-weight: 700; line-height: .78; letter-spacing: -.05em; font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--a) 24%, transparent); user-select: none;
}
.ph-head__kicker { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 600; color: var(--a-ink); }
.ph-head__kicker::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
.ph-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); line-height: 1.08; letter-spacing: -.02em; margin-top: 4px; }
html[data-lang="ar"] .ph-head h2 { line-height: 1.35; letter-spacing: 0; }
.ph-head__line { margin-top: 8px; color: var(--muted); max-width: 44ch; }
.ph-head__count {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 16px; border-radius: 999px; white-space: nowrap; color: var(--a-ink); font-weight: 600;
  background: color-mix(in srgb, var(--a) 13%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--a) 30%, transparent);
}
.ph-head__count b { font-size: 1.35rem; line-height: 1; font-variant-numeric: tabular-nums; }

/* ---------- Bento grids ---------- */
.ph-bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--ph-g); }
.ph-bento + .ph-bento, .ph-shelf + .ph-bento { margin-top: var(--ph-g); }
.ph-t { position: relative; min-width: 0; min-height: 0; grid-column: span 3; }
.ph-t > figure { position: absolute; inset: 0; margin: 0; }
.ph-bento--a .ph-t--feat { grid-column: 1 / span 6; grid-row: span 2; aspect-ratio: 4 / 5; }
.ph-bento--a.ph-bento--rev .ph-t--feat { grid-column: 7 / span 6; grid-row: 1 / span 2; }
.ph-bento--c .ph-t--wide { grid-column: span 6; aspect-ratio: 3 / 2; }
.ph-bento--b .ph-t { aspect-ratio: 1; }

.ph-t .gallery__item { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: var(--ph-r); overflow: hidden; isolation: isolate; background: var(--night-2); }
.ph-t .gallery__item img,
.ph-t .gallery__item:hover img {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover;
  transform: none; scale: 1.035; transition: scale 1s var(--ease), transform 1.3s var(--ease), filter .6s;
}
.ph-t--feat .gallery__item img, .ph-t--feat .gallery__item:hover img { scale: 1.14; }
.ph-t .gallery__item:hover img, .ph-t .gallery__item:focus-visible img { scale: 1.09; }
.ph-t--feat .gallery__item:hover img, .ph-t--feat .gallery__item:focus-visible img { scale: 1.19; }
.ph-t .gallery__item:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.ph-t .gallery__item::after { /* expand badge */
  content: ""; position: absolute; z-index: 2; top: 12px; inset-inline-end: 12px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255, 255, 255, .9) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314284b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6M10 20H4v-6M20 4l-7 7M4 20l7-7'/%3E%3C/svg%3E") center / 16px no-repeat;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .45); opacity: 0; transform: scale(.6) rotate(-45deg); transition: opacity .3s, transform .45s var(--ease);
}
.ph-t .gallery__item:hover::after, .ph-t .gallery__item:focus-visible::after { opacity: 1; transform: none; }

.ph-t figcaption {
  position: absolute; z-index: 3; inset-inline: 0; bottom: 0; padding: 48px 18px 15px; pointer-events: none;
  color: #fff; font-size: .95rem; font-weight: 500; line-height: 1.35; text-shadow: 0 1px 10px rgba(0, 0, 0, .35);
  border-radius: 0 0 var(--ph-r) var(--ph-r); background: linear-gradient(to top, rgba(8, 13, 24, .78), rgba(8, 13, 24, .32) 55%, transparent);
  opacity: 0; transform: translateY(10px); transition: opacity .35s, transform .5s var(--ease);
}
.ph-t--feat figcaption, .ph-t--wide figcaption { font-size: 1.08rem; padding: 64px 22px 18px; }
.ph-t:hover figcaption, .ph-t:focus-within figcaption { opacity: 1; transform: none; }
@media (hover: none) { .ph-t figcaption { opacity: 1; transform: none; } }

/* Two frames of the same rally, shown as a tiny sequence */
.ph-seq {
  position: absolute; z-index: 3; top: 12px; inset-inline-start: 12px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  font-size: .82rem; font-weight: 700; color: var(--ink); background: #fff; box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .5); pointer-events: none;
}

/* ---------- 01 World Cup: clean editorial bento, ember ---------- */
/* (base styles above) */

/* ---------- 02 Childhood: prints dealt on a table ---------- */
.ph-sec--hc .ph-bento { gap: clamp(14px, 1.9vw, 26px); }
.ph-sec--hc .ph-bento + .ph-bento { margin-top: clamp(14px, 1.9vw, 26px); }
.ph-sec--hc .ph-t > figure {
  --rot: -1.2deg;
  padding: 9px 9px 46px; border-radius: 6px; background: var(--surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 18px 32px -20px rgba(16, 27, 46, .55), 0 2px 6px rgba(16, 27, 46, .12);
  transform: rotate(var(--rot)); transition: transform .6s var(--ease), box-shadow .4s, opacity .6s;
}
.ph-sec--hc .ph-t:nth-child(even) > figure { --rot: 1.1deg; }
.ph-sec--hc .ph-t:nth-child(3n) > figure { --rot: -.5deg; }
.ph-sec--hc .ph-t--feat > figure { --rot: .7deg; padding: 12px 12px 58px; }
.ph-sec--hc .ph-t:hover > figure, .ph-sec--hc .ph-t:focus-within > figure { transform: rotate(0) translateY(-6px) scale(1.015); box-shadow: 0 30px 44px -22px rgba(16, 27, 46, .55), 0 2px 6px rgba(16, 27, 46, .12); z-index: 2; }
.ph-sec--hc .ph-t .gallery__item { inset: 9px 9px 46px; width: auto; height: auto; border-radius: 3px; }
.ph-sec--hc .ph-t--feat .gallery__item { inset: 12px 12px 58px; }
.ph-sec--hc .ph-t .gallery__item::after { top: 8px; inset-inline-end: 8px; }
.ph-sec--hc .ph-t figcaption {
  inset-inline: 12px; bottom: 6px; height: 38px; padding: 0; display: flex; align-items: center; justify-content: center; text-align: center;
  background: none; color: var(--ink); text-shadow: none; opacity: 1; transform: none; border-radius: 0;
  font-family: var(--ph-hand); font-size: clamp(1.05rem, 1.5vw, 1.3rem); font-weight: 700; line-height: .95; text-wrap: balance;
  overflow: hidden;
}
html[data-lang="ar"] .ph-sec--hc .ph-t figcaption { font-size: clamp(.95rem, 1.25vw, 1.12rem); }
.ph-sec--hc .ph-t--feat figcaption { height: 50px; font-size: clamp(1.3rem, 2vw, 1.7rem); }
.ph-sec--hc .ph-t > figure::before { /* a strip of washi tape on some prints */
  content: ""; position: absolute; z-index: 4; top: -9px; left: 50%; width: 74px; height: 20px; margin-left: -37px; transform: rotate(-4deg);
  background: color-mix(in srgb, var(--leaf) 34%, rgba(255, 255, 255, .55)); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); opacity: 0;
}
.ph-sec--hc .ph-t--feat > figure::before, .ph-sec--hc .ph-t:nth-child(4) > figure::before { opacity: .9; }

/* ---------- 03 Back to 2005: XP-era tooltips and a shelf of windows ---------- */
.ph-sec--y5 .ph-bento .ph-t figcaption {
  inset-inline: auto; inset-inline-start: 12px; bottom: 12px; max-width: calc(100% - 24px); padding: 5px 9px; border-radius: 3px;
  color: #1b1b1b; background: #ffffe1; text-shadow: none; font-size: .86rem; box-shadow: 0 0 0 1px #767676, 3px 3px 0 rgba(0, 0, 0, .18);
  transform: translateY(6px) scale(.96); transform-origin: 0 100%;
}
html[dir="rtl"] .ph-sec--y5 .ph-bento .ph-t figcaption { transform-origin: 100% 100%; }
.ph-sec--y5 .ph-bento .ph-t--feat figcaption, .ph-sec--y5 .ph-bento .ph-t--wide figcaption { padding: 6px 11px; font-size: .95rem; }
.ph-sec--y5 .ph-bento .ph-t:hover figcaption, .ph-sec--y5 .ph-bento .ph-t:focus-within figcaption { transform: none; }
@media (hover: none) { .ph-sec--y5 .ph-bento .ph-t figcaption { transform: none; } }
.ph-bento--c.ph-bento--rev .ph-t--wide { grid-column: 7 / span 6; grid-row: 1; }

.ph-shelf { margin-block: clamp(36px, 5vw, 60px) clamp(28px, 4vw, 44px); }
.ph-shelf__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 14px; }
.ph-shelf__title { font-size: clamp(1.25rem, 2vw, 1.55rem); letter-spacing: -.01em; }
.ph-shelf__hint { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); margin-inline-end: auto; }
.ph-shelf__hand {
  width: 18px; height: 18px; background: currentColor; animation: ph-nudge 2.4s var(--ease) infinite;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 13V5.5a1.5 1.5 0 0 1 3 0V12M11 11.5v-2a1.5 1.5 0 0 1 3 0V12M14 10.5a1.5 1.5 0 0 1 3 0V12M17 11.5a1.5 1.5 0 0 1 3 0V16a6 6 0 0 1-6 6h-2a6 6 0 0 1-5-2.7L4.3 15a1.6 1.6 0 0 1 2.6-1.8L8 15'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 13V5.5a1.5 1.5 0 0 1 3 0V12M11 11.5v-2a1.5 1.5 0 0 1 3 0V12M14 10.5a1.5 1.5 0 0 1 3 0V12M17 11.5a1.5 1.5 0 0 1 3 0V16a6 6 0 0 1-6 6h-2a6 6 0 0 1-5-2.7L4.3 15a1.6 1.6 0 0 1 2.6-1.8L8 15'/%3E%3C/svg%3E") center / contain no-repeat;
}
@keyframes ph-nudge { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-7px) rotate(-8deg); } 60% { transform: translateX(5px) rotate(4deg); } }
.ph-shelf__nav { display: flex; gap: 8px; }
.ph-strip {
  --tilt: 0deg;
  display: flex; gap: clamp(14px, 1.6vw, 22px); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  --edge: max(var(--gutter), calc((100vw - var(--wrap)) / 2));
  margin-inline: calc(50% - 50vw); padding: 14px var(--edge) 26px; scroll-padding-inline: var(--edge);
  scrollbar-width: none; cursor: grab; user-select: none; -webkit-user-select: none;
}
.ph-strip::-webkit-scrollbar { display: none; }
.ph-strip.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.ph-strip img { -webkit-user-drag: none; }
.ph-t--strip { flex: 0 0 clamp(210px, 22vw, 268px); scroll-snap-align: start; }
.ph-t--strip > figure {
  position: relative; inset: auto; display: flex; flex-direction: column; border-radius: 9px; overflow: hidden;
  background: var(--surface); box-shadow: 0 0 0 1px color-mix(in srgb, var(--root) 45%, transparent), 0 22px 34px -22px rgba(16, 27, 46, .6);
  transform: rotate(var(--tilt)); transform-origin: 50% 0; transition: box-shadow .3s, translate .45s var(--ease);
}
.ph-t--strip:hover > figure { translate: 0 -6px; box-shadow: 0 0 0 1.5px var(--root), 0 28px 40px -22px rgba(16, 27, 46, .65); }
.ph-t--strip figcaption {
  position: relative; inset: auto; order: -1; display: block; padding: 7px 64px 7px 12px; border-radius: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 1; transform: none; text-shadow: 0 1px 0 rgba(0, 0, 0, .25); font-size: .82rem; font-weight: 600; line-height: 1.3;
  color: #fff; background: linear-gradient(180deg, color-mix(in srgb, var(--root) 62%, #fff), var(--root) 45%, color-mix(in srgb, var(--root) 82%, #000));
}
html[dir="rtl"] .ph-t--strip figcaption { padding: 7px 12px 7px 64px; }
.ph-t--strip figure::after { /* minimise / maximise / close */
  content: ""; position: absolute; top: 7px; inset-inline-end: 9px; width: 50px; height: 16px; pointer-events: none;
  background:
    linear-gradient(#fff, #fff) 4px 11px / 7px 2px no-repeat,
    linear-gradient(rgba(255, 255, 255, .25), rgba(255, 255, 255, .25)) 0 0 / 16px 16px no-repeat,
    linear-gradient(rgba(255, 255, 255, .25), rgba(255, 255, 255, .25)) 17px 0 / 16px 16px no-repeat,
    linear-gradient(#e0533d, #c23a24) 34px 0 / 16px 16px no-repeat;
  border-radius: 3px;
}
.ph-t--strip .gallery__item { position: relative; inset: auto; height: auto; aspect-ratio: 4 / 5; border-radius: 0; }
.ph-t--strip .ph-seq { display: none; }

.ph-shelf__track { position: relative; height: 3px; margin-top: 2px; border-radius: 3px; background: var(--line); overflow: hidden; }
.ph-shelf__bar { position: absolute; inset: 0; background: linear-gradient(90deg, var(--root), var(--trunk)); transform-origin: left; transform: scaleX(.1); }
html[dir="rtl"] .ph-shelf__bar { transform-origin: right; }

/* ---------- 04 NCAS: floodlit pitch ---------- */
.gallery.ph-sec--nc {
  position: relative; isolation: isolate; overflow: clip; color: #eef3f7; padding-top: var(--sec);
  background: linear-gradient(180deg, #0d1626 0%, #0f2133 55%, #0f2a2c 100%);
}
/* Light from floodlights just above the frame: wide, very soft warm-white bloom with a long
   vertical falloff. No shapes with edges; it simply fades up once. */
.ph-sec--nc::before {
  content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 55% at 18% -14%, rgba(255, 244, 222, .16), rgba(255, 244, 222, .05) 45%, transparent 75%),
    radial-gradient(60% 55% at 82% -14%, rgba(255, 244, 222, .16), rgba(255, 244, 222, .05) 45%, transparent 75%),
    radial-gradient(90% 70% at 50% -20%, rgba(220, 236, 240, .07), transparent 70%);
  opacity: 0; transition: opacity 2.2s cubic-bezier(.25, .1, .25, 1);
}
.ph-sec--nc.is-lit::before, html:not(.ph-js) .ph-sec--nc::before { opacity: 1; }
.ph-sec--nc::after { /* haze near the turf + soft vignette */
  content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background:
    radial-gradient(70% 40% at 50% 78%, rgba(150, 200, 190, .05), transparent 70%),
    radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(4, 8, 16, .45) 100%);
}
.ph-sec--nc .wrap { position: relative; }
.ph-sec--nc .ph-head h2 { color: #fff; }
.ph-sec--nc .ph-head__line { color: #b9c7d6; }
.ph-sec--nc .ph-head__count { color: #bfeef3; background: rgba(95, 179, 189, .16); box-shadow: inset 0 0 0 1px rgba(95, 179, 189, .4); }
.ph-sec--nc .ph-head__no { color: rgba(95, 179, 189, .35); }
.ph-sec--nc .ph-head__kicker { color: #7fd0d9; }
.ph-pitch {
  position: absolute; z-index: -1; left: 50%; top: 52%; width: min(1500px, 118%); height: auto; aspect-ratio: 1200 / 520; translate: -50% -50%; pointer-events: none;
  fill: none; stroke: rgba(235, 245, 240, .055); stroke-width: 1; vector-effect: non-scaling-stroke;
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent); mask-image: radial-gradient(closest-side, #000 55%, transparent);
}
.ph-pitch * { vector-effect: non-scaling-stroke; }
.ph-bento--tri { grid-template-columns: minmax(0, 1fr) minmax(0, 1.28fr) minmax(0, 1fr); align-items: center; gap: clamp(14px, 2.4vw, 34px); }
.ph-bento--tri .ph-t { grid-column: auto; aspect-ratio: 3 / 4; }
.ph-bento--tri .ph-t--mid { aspect-ratio: 4 / 5; }
.ph-bento--tri .ph-t--side:first-child { translate: 0 -22px; }
.ph-bento--tri .ph-t--side:last-child { translate: 0 22px; }
.ph-sec--nc .ph-t .gallery__item { box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .08); }
.ph-sec--nc .ph-t--mid .gallery__item { box-shadow: 0 40px 70px -30px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .16); }
.ph-sec--nc + .ph-next { margin-top: 0; }

/* =========================================================================
   Scroll-in choreography (only when gallery.js runs and motion is welcome)
   ========================================================================= */
.ph-js .ph-head > * { transition: opacity .8s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.ph-js .ph-head:not(.is-in) > * { opacity: 0; transform: translateY(22px); }
.ph-js .ph-head:not(.is-in) .ph-head__no { transform: translateY(40%) rotate(-8deg); }
.ph-js .ph-head .ph-head__text { --d: .08s; }
.ph-js .ph-head .ph-head__count { --d: .2s; }

/* 01 + 03: a wipe that opens upward while the photo settles */
.ph-js .ph-t .gallery__item { transition: clip-path 1s var(--ease), opacity .6s; transition-delay: var(--d, 0s); }
.ph-js .ph-t:not(.is-in) .gallery__item { clip-path: inset(18% 6% 0 6% round var(--ph-r)); opacity: 0; }
.ph-js .ph-t:not(.is-in) .gallery__item img { transform: scale(1.22) translateY(4%); }
.ph-js .ph-t .gallery__item img { transition-delay: 0s, var(--d, 0s), 0s; }
.ph-js .ph-t:not(.is-in) figcaption, .ph-js .ph-t:not(.is-in) .ph-seq { opacity: 0; }
/* 02: prints are dealt onto the table */
.ph-js .ph-sec--hc .ph-t .gallery__item, .ph-js .ph-sec--hc .ph-t:not(.is-in) .gallery__item { clip-path: none; opacity: 1; }
.ph-js .ph-sec--hc .ph-t > figure { transition-delay: var(--d, 0s); }
.ph-js .ph-sec--hc .ph-t:not(.is-in) > figure { opacity: 0; transform: translate(-30px, 60px) rotate(-9deg) scale(.92); }
.ph-js .ph-sec--hc .ph-t:nth-child(even):not(.is-in) > figure { transform: translate(30px, 60px) rotate(8deg) scale(.92); }
.ph-js .ph-sec--hc .ph-t:not(.is-in) figcaption { opacity: 1; }
/* 03 shelf: windows pop open one after another */
.ph-js .ph-t--strip .gallery__item, .ph-js .ph-t--strip:not(.is-in) .gallery__item { clip-path: none; opacity: 1; }
.ph-js .ph-t--strip { transition: opacity .5s, transform .7s cubic-bezier(.34, 1.56, .64, 1); transition-delay: var(--d, 0s); }
.ph-js .ph-t--strip:not(.is-in) { opacity: 0; transform: translateY(24px) scale(.88); }
.ph-js .ph-t--strip:not(.is-in) figcaption { opacity: 1; }
/* 04: the photos rise into the floodlights */
.ph-js .ph-sec--nc .ph-t .gallery__item, .ph-js .ph-sec--nc .ph-t:not(.is-in) .gallery__item { clip-path: none; }
.ph-js .ph-sec--nc .ph-t .gallery__item { transition: opacity 1s var(--ease), transform 1.1s var(--ease), box-shadow .4s; transition-delay: var(--d, 0s); }
.ph-js .ph-sec--nc .ph-t:not(.is-in) .gallery__item { opacity: 0; transform: translateY(60px) scale(.94); }

/* =========================================================================
   Lightbox (markup + keyboard in script.js; extras from gallery.js)
   ========================================================================= */
.ph-js .lightbox[open] { animation: none; }
.lightbox[open]::backdrop { animation: ph-fade .35s ease-out; }
.lightbox::backdrop { transition: opacity .32s ease-in; }
.lightbox.is-closing::backdrop { opacity: 0; }
@keyframes ph-fade { from { opacity: 0; } }
.lightbox__img { max-width: none; max-height: none; object-fit: contain; background: #0b1220 center / cover no-repeat; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8); will-change: transform; touch-action: none; }
.lightbox__cap { font-size: 1.02rem; max-width: 40rem; }
.lightbox__btn { transition: background .2s, opacity .3s, transform .3s var(--ease); }
.lightbox__btn:hover { transform: scale(1.06); }
.lightbox__prev:hover, .lightbox__next:hover { transform: translateY(-50%) scale(1.06); }
.lightbox__btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.ph-lb-meta {
  position: absolute; top: 18px; inset-inline-start: 22px; display: flex; align-items: center; gap: 10px; margin: 0;
  font-size: .9rem; font-weight: 600; color: #d7e0ea; pointer-events: none; transition: opacity .3s;
}
.ph-lb-meta b { direction: ltr; unicode-bidi: isolate; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #fff; font-variant-numeric: tabular-nums; }
.ph-lb-meta i { font-style: normal; display: inline-flex; align-items: center; gap: 8px; }
.ph-lb-meta i::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--lb-a, var(--ember)); }
.lightbox.is-closing .lightbox__btn, .lightbox.is-closing .lightbox__cap, .lightbox.is-closing .ph-lb-meta,
.lightbox.is-opening .lightbox__btn, .lightbox.is-opening .lightbox__cap, .lightbox.is-opening .ph-lb-meta { opacity: 0; }
.lightbox.is-opening .lightbox__btn, .lightbox.is-opening .lightbox__cap, .lightbox.is-opening .ph-lb-meta { transition: none; }
@media (max-width: 760px) {
  .lightbox__prev:hover, .lightbox__next:hover { transform: scale(1.06); }
  .ph-lb-meta { top: 22px; inset-inline-start: 16px; font-size: .82rem; max-width: calc(100% - 90px); }
}

/* =========================================================================
   Closing band: frame 39 is still empty
   ========================================================================= */
.nextnight.ph-next {
  color: var(--ink); overflow: clip; padding-top: calc(var(--sec) + 20px);
  background: radial-gradient(700px 420px at 85% 100%, color-mix(in srgb, var(--ember) 22%, transparent), transparent 70%), color-mix(in srgb, var(--ember) 7%, var(--bg));
}
.nextnight.ph-next::after { opacity: .05; }
.ph-next__sprockets {
  position: absolute; inset: 0 0 auto; height: 30px; background-color: var(--ink);
  background-image: linear-gradient(90deg, color-mix(in srgb, var(--bg) 92%, transparent) 0 12px, transparent 12px);
  background-size: 26px 12px; background-position: 0 50%; background-repeat: repeat-x;
  -webkit-mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  animation: ph-advance 2.4s linear infinite; opacity: .9;
}
@keyframes ph-advance { to { background-position: 26px 50%; } }
html[dir="rtl"] .ph-next__sprockets { animation-direction: reverse; }
.ph-next__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.ph-next__text { display: grid; justify-items: start; gap: 18px; }
.ph-next .ph-next__kicker { font-family: var(--ph-hand); font-size: clamp(1.4rem, 2.2vw, 1.8rem); font-weight: 700; color: var(--ember-ink); transform: rotate(-2deg); line-height: 1.1; }
.ph-next h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.04; letter-spacing: -.025em; max-width: 16ch; }
html[data-lang="ar"] .ph-next h2 { line-height: 1.35; letter-spacing: 0; }
.nextnight.ph-next p:not(.ph-next__kicker) { color: var(--muted); font-size: 1.12rem; max-width: 36rem; }
.ph-next .btn--ember { margin-top: 6px; }
.ph-next__print {
  --rx: 0deg; --ry: 0deg;
  justify-self: center; width: min(100%, 300px); padding: 14px 14px 0; border-radius: 6px; background: var(--surface);
  box-shadow: 0 34px 50px -28px rgba(16, 27, 46, .55), 0 2px 8px rgba(16, 27, 46, .1);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) rotate(4deg); transition: transform .6s var(--ease);
}
html[dir="rtl"] .ph-next__print { transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) rotate(-4deg); }
.ph-next__photo {
  position: relative; display: grid; place-content: center; justify-items: center; gap: 14px; aspect-ratio: 4 / 5; border-radius: 3px; overflow: hidden;
  background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--ink) 4%, transparent) 0 10px, transparent 10px 20px), color-mix(in srgb, var(--ember) 8%, var(--bg));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ink) 18%, transparent);
  outline: 2px dashed color-mix(in srgb, var(--ember-ink) 55%, transparent); outline-offset: -14px;
}
.ph-next__photo::after { /* the picture slowly "develops" in */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 50% at 50% 45%, color-mix(in srgb, var(--ember) 30%, transparent), transparent 70%);
  animation: ph-breathe 4.5s ease-in-out infinite alternate;
}
@keyframes ph-breathe { from { opacity: .25; } to { opacity: .9; } }
.ph-next__plus {
  position: relative; z-index: 1; width: 58px; height: 58px; border-radius: 50%; background: var(--ember); box-shadow: 0 10px 24px -8px rgba(227, 154, 59, .8);
  animation: ph-ping 2.4s var(--ease) infinite; transition: transform .6s var(--ease);
}
.ph-next__plus::before, .ph-next__plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 3px; margin: -1.5px 0 0 -11px; border-radius: 3px; background: #1a1206; }
.ph-next__plus::after { transform: rotate(90deg); }
.ph-next__print:hover .ph-next__plus { transform: rotate(90deg) scale(1.08); }
.ph-next__here { position: relative; z-index: 1; font-family: var(--ph-hand); font-size: 1.6rem; font-weight: 700; color: var(--ember-ink); }
.ph-next__cap { display: block; padding: 12px 4px 16px; text-align: center; font-family: var(--ph-hand); font-size: 1.35rem; font-weight: 700; color: var(--muted); }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 960px) {
  .ph-hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 300px); }
}
@media (max-width: 760px) {
  .ph-hero { padding-top: 104px; }
  .ph-hero__grid { grid-template-columns: minmax(0, 1fr); gap: 0; position: relative; }
  .ph-lens-wrap { position: absolute; top: -6px; inset-inline-end: 0; }
  .ph-lens { width: 124px; filter: drop-shadow(0 14px 18px rgba(16, 27, 46, .3)); }
  .ph-lens__tip { display: none; }
  .ph-lens__count b { font-size: 1.5rem; }
  .ph-lens__count span { font-size: .5rem; letter-spacing: .1em; margin-top: 1px; }
  html[data-lang="ar"] .ph-lens__count span { font-size: .62rem; }
  .ph-roll { margin-bottom: 18px; max-width: calc(100% - 136px); font-size: .7rem; letter-spacing: .03em; padding-inline: 10px; }
  .ph-jump { gap: 9px; margin-top: 28px; }
  .ph-jump a { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; padding: 11px 12px; font-size: .92rem; }
  .ph-jump__no { grid-column: 1 / -1; font-size: .72rem; }

  .ph-head { grid-template-columns: minmax(0, 1fr); position: relative; }
  .ph-head__no { position: absolute; top: -8px; inset-inline-end: 0; font-size: 4.6rem; }
  .ph-head__text { position: relative; }
  .ph-head__count { justify-self: start; padding: 6px 14px; }
  .ph-head__count b { font-size: 1.15rem; }

  .ph-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ph-t, .ph-bento--b .ph-t { grid-column: span 1; aspect-ratio: 4 / 5; }
  .ph-bento--a .ph-t--feat, .ph-bento--a.ph-bento--rev .ph-t--feat { grid-column: 1 / -1; grid-row: auto; aspect-ratio: 1; }
  .ph-bento--c .ph-t--wide, .ph-bento--c.ph-bento--rev .ph-t--wide { grid-column: 1 / -1; grid-row: auto; aspect-ratio: 3 / 2; }
  .ph-bento--b .ph-t { aspect-ratio: 1; }
  .ph-t .gallery__item::after { display: none; }
  .ph-t figcaption { font-size: .82rem; padding: 34px 12px 10px; }
  .ph-t--feat figcaption, .ph-t--wide figcaption { font-size: .95rem; padding: 44px 14px 13px; }
  .ph-sec--hc .ph-t > figure { padding: 7px 7px 36px; }
  .ph-sec--hc .ph-t .gallery__item { inset: 7px 7px 36px; }
  .ph-sec--hc .ph-t--feat > figure { padding: 9px 9px 44px; }
  .ph-sec--hc .ph-t--feat .gallery__item { inset: 9px 9px 44px; }
  .ph-sec--hc .ph-t figcaption { height: 30px; bottom: 4px; inset-inline: 8px; font-size: 1.02rem; padding: 0; }
  html[data-lang="ar"] .ph-sec--hc .ph-t figcaption { font-size: .86rem; }
  .ph-sec--hc .ph-t--feat figcaption { height: 38px; font-size: 1.3rem; }
  .ph-sec--y5 .ph-bento .ph-t figcaption { inset-inline-start: 8px; bottom: 8px; max-width: calc(100% - 16px); font-size: .76rem; padding: 3px 7px; }
  .ph-shelf__nav { display: none; }
  .ph-t--strip { flex-basis: 62vw; }
  .ph-bento--tri { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ph-pitch { display: none; }
  .ph-bento--tri .ph-t--mid { grid-column: 1 / -1; order: -1; aspect-ratio: 1; }
  .ph-bento--tri .ph-t--side:first-child, .ph-bento--tri .ph-t--side:last-child { translate: none; aspect-ratio: 4 / 5; }

  .ph-next__grid { grid-template-columns: minmax(0, 1fr); }
  .ph-next__print { width: min(72vw, 250px); }
}

/* =========================================================================
   Reduced motion: everything in place, no drift, no flash
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  .ph-hero__glow span, .ph-lens__bokeh circle, .ph-roll__dot, .ph-sparkle, .ph-shelf__hand, .ph-next__sprockets, .ph-next__photo::after, .ph-next__plus, .ph-lens__tipdot { animation: none !important; }
  .ph-title .ph-w > span { opacity: 1; animation: none; }
  .ph-flash { display: none; }
  .ph-t--strip > figure { transform: none; }
}
