/* gate fonts: tools/build-gate-fonts.py */
@font-face { font-family: "Josefin Gate"; font-style: normal; font-weight: 100; font-display: block; src: url(data:font/woff2;base64,d09GMgABAAAAAAK0AA8AAAAABUQAAAJaAAIAQgAAAAAAAAAAAAAAAAAAAAAAAAAAGhYbgRIcKgZgP1NUQVREAFQRCAqCMIF2ATYCJAMYCw4ABCAFegcgG/MDYJ6DcUNfIsTQFq1MGJe7/Pi6+nj+a4zfuW/3qyQzomj1RmPIJNFuySR2IiHRPDGERF4DdelJtgNyAIGm/BjCMuLc5j/tbKZy/j89zSIKEw85sFwTTDhLc4vC7yB6ULnbmI7nUTpCO+jDBfOAEtFEMOuIC3o9Ii4NCk+K2xqgoMNYkMflLQ2QQRBdmVZmHSEu4lEWrSPaWGSkbOFxxA7VYGBAlGiiiYhoghLMOsGqEmp1AOj5q4xAfaZZgBsmkttw8Q6SoU8l93Eae7Lr55Cif08YIJAX9CTYU606rbCO4gh9WlnVRsCtzZGIBqJbRiDBHdBERRMQUGhYxwnW8S6DedNKtydQsCjZA3H9+OuC046OrQIAIoMlxCSYxyRugocA+rJfsJjucsxsXqwVq1mNZlWuvPZ8J884OcoEkcpzlRVitlquWEZZJhnedcz22CMy/PAhG79/W89i4dSta6LkwQO83H3aavPh7XDr8zQZnhElU3g5GWjygpr80lA9flbjVJlWpnIuqr6cVMu6mrV+Ui31airPLnVY6//moX80hcOCmusbEh1vPB2pcw71dnFMTHRwtgo10FintujI7zf2zHJzzfQw611zfmK2yy5WGGM/5tiPWdkXs+IL8AxBufp6UmesUNHvv0zjPsO3j1pJAP/sH0iwA/WBvsSkAgFWf8Zg5SA0yGTsoL66VK88rVGcyQU7sQfBpNMoCGQTruKky6IsEhiBeYtEMG2DNMg5uChNzEkpylVqV6dYi0zlqlWq0iZNlWoNorUpVqdaqRSN6hVrwAEjZxEAAAA=) format("woff2"); }
@font-face { font-family: "Mada Gate"; font-style: normal; font-weight: 300; font-display: block; src: url(data:font/woff2;base64,d09GMgABAAAAAASkAA8AAAAACFAAAARJAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGkAbghQcgVgGYD9TVEFUKgBUEQgKhXyEYAE2AiQDOAsgAAQgBU4HIBuRBkAGnv/HLbvvJ1gSGLEzTIUzHaVQMaVbU6O7XjdhVtSq+Z/L6Y2J/87OrjlBAgz8hJt276ita+EWDqM0y48aupb2AhtLMQDNtuUn9FN0cZmWY7DX6EYQFD4AIAuFhuBGMDAQvPjQEDQgHogHUhEEL4LgQwCDLMqh6jWItMHXc1TPXvjQAWwbAeShFsINKEBQOBmCDtnAIjGTRamzo644GYeKLtwYCXDyNuAinnhSSaUQmeQhXLMHIfzCghS1GzCvTg6mj70oD59JCdGHQpm6AQMjJOjcmIfkIfoJkJMPUYZKmVgVn9gn/zK6CpbLCa5AJrL8kuwjPd6KNEG6AOiootDQe/ceOgL/bZQo/7kUci5mNBECBBjXcFlEoWOQQy06oQDBLahvvOBB4cLrLdRAYSg4kZ5KZ6EOX0ENSCTVW6HhQtDn6/K1hHCAmqk6AE1no6UbZSQA/APCz6sdadyA8wScEe3oq42gb5DNgADI52oREEAhCG4ESEaAQqjx/QeMEQ1QCIA4JASAAjQgGQ0BktGpBVi4UegEnEWdYWcTZ8S2wf7O/vHpz09jT889vYiAmCDRhThAGKDIXA/wCPgVyAHyJ7HtHcFZAwBKL6O84UCxQpaVZop4lywTzVTR3ceNtjNP7hWZceieaW49G9x5Mdak6I0nD/J37DhiEl0MVcOYuX03RM/kmuytTtt6MngyVqVV5xTd8qTyiSfRyIkJ6UuWL99stJ159e5BEVPPfiPb3LIqtd3OtftOmSbG0uXpbZdEtx/Par8udvFhTGYUFJiznoTzdsaMmdf3E72A7JNAm5k7XeFdZXgH0e1Y/2nbxUd3+stULL1kS1rTIiv35W47siN9xeqsJlWXLUtdejJr8eIUwrn7bxtp4fiUWkkpLLpW9NnewmMKXykd+GFJVCp+X7ti2f+3RGp4k8r9EPSnOkLDTv1n/pv4dyBxjJ/zf4Qh/DA+M2Hz3YBVp2Gjzo1Tv131bWv/2TkNGv1U29nYr3vqHSzu43Z3/7zEgvxtoW3Z1Xrf/yF+f78R72qN4ouljQxP+vKv+2PmfJoZSqzFtYPN/A3vWoG6eaGsevVyS5d7LXR++9y6gay8omOLZltPz6VHeqadjV+WkrosPuGd1JR3KGIlWN54y4vXEgYl/tPmm95dza7NblxeXDCuSr9xuz9q0Ss2Yf3nb1TKjSS3bTEtH92JgkFjy6M7QXfhAnu0noO1H5xYLYi8CQAyVDoRfPWJXJQQgEqRJgTtJOWglb3Q/pJhFCnrRwCJMna2d2n3uGr/uDXte4CHNQqmA3wXfjLLXvjqE5WidgJOFAACX4+sJviRr/sgIOz1XZ1uMhRkKcjPBOUiQZUMqgaokgSVg6D8DVwHWUhZsL+0F9pPESCOMKobBCCw4q4RREN0T9IHlp1oWPhOd2DgpxV96c9YhtCTUbSnLwPpzwDGEBFFA1KvHlMGAAAA) format("woff2"); }
/* end gate fonts */
/* Fonts are served by the site itself (no render-blocking request to Google). Variable files: every weight in one. */
@font-face { font-family: "Josefin Sans"; font-style: normal; font-weight: 100 700; font-display: swap; src: url(../assets/fonts/josefin-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Josefin Sans"; font-style: normal; font-weight: 100 700; font-display: swap; src: url(../assets/fonts/josefin-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Josefin Sans"; font-style: italic; font-weight: 100 700; font-display: swap; src: url(../assets/fonts/josefin-italic-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Mada"; font-style: normal; font-weight: 200 900; font-display: swap; src: url(../assets/fonts/mada-arabic.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Mada"; font-style: normal; font-weight: 200 900; font-display: swap; src: url(../assets/fonts/mada-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* HAY, one universe with the live set: the living painting on one side of a line, the measured neighbourhood
   (the Medina of Tunis, a survey) on the other. حيّ means alive, and it means neighbourhood.
   Reading rule: body text always sits on calm ground (world pools), the line passes behind it, type is never thinner than 300 below 40px. */
:root {
  --night: #05040A;
  --human: #F2EADB;
  --machine: #B8D0E0;
  --body: rgba(242, 234, 219, .9);
  --muted: rgba(242, 234, 219, .68);
  --red: #C21A2B;
  --rule: rgba(242, 234, 219, .16);
  --font-lat: "Josefin Sans", "Futura", "Avenir Next", system-ui, sans-serif;
  --font-ar: "Mada", "SF Arabic", "Geeza Pro", "Noto Sans Arabic", system-ui, sans-serif;
  --gutter: max(clamp(16px, 4vw, 56px), env(safe-area-inset-left), env(safe-area-inset-right));
  --header-h: 72px;
  --ease-out: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--night); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh; background: var(--night); color: var(--human);
  font-family: var(--font-lat); font-weight: 400; font-size: 18px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden;
  touch-action: pan-y pinch-zoom;
}
img { display: block; max-width: 100%; height: auto; }
figure, blockquote { margin: 0; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--machine); outline-offset: 5px; border-radius: 2px; }
[tabindex="-1"]:focus { outline: none; }
[lang="ar"] { font-family: var(--font-ar); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
html.js:not(.state-entered), html.js:not(.state-entered) body { overflow: hidden; height: 100%; }
html.is-dragging, html.is-dragging * { -webkit-user-select: none; user-select: none; }
/* The page is played with: repeated clicks and long presses never select or call out text.
   Reading text stays selectable so it can be copied. */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.prose, .facts, .teaser-caption, .booking-lede, .booking-detail, .credits-list dd { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
img, canvas { -webkit-user-drag: none; }
.no-transition *, .no-transition *::before, .no-transition *::after,
.motion-off *, .motion-off *::before, .motion-off *::after { animation: none !important; transition-duration: 0s !important; transition-delay: 0s !important; }

.skip {
  position: fixed; left: 16px; top: 16px; z-index: 99; padding: 12px 18px; border-radius: 4px;
  background: var(--human); color: var(--night); font-size: 15px; text-decoration: none; transform: translateY(-160%);
}
.skip:focus { transform: none; }

/* The world (WebGL), its CSS stand-in, and the line layer */
.world, .world-fallback, .line-layer { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; height: 100lvh; }
.world, .world-fallback { z-index: 0; }
.world { display: block; opacity: 0; transition: opacity 1.6s ease; }
.world-ready .world { opacity: 1; }
.world-fallback { display: none; background: url(../assets/hay-painting.webp) 58% 50% / cover no-repeat; filter: saturate(1.4) contrast(1.1) brightness(.18); }
.no-webgl .world { display: none; }
.no-webgl .world-fallback { display: block; }
.no-webgl.state-awake .world-fallback { filter: saturate(1.5) contrast(1.15) brightness(.4); }
.no-webgl.state-entered .world-fallback { filter: saturate(1.3) contrast(1.1) brightness(.3); }
.line-layer { z-index: 35; pointer-events: none; }

/* Loader: the line draws itself, then comes alive */
.loader { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; pointer-events: none; transition: opacity .9s ease, visibility 0s linear .9s; }
.loader span { display: block; width: 1px; height: 0; background: var(--machine); box-shadow: 0 0 14px rgba(184, 208, 224, .8); animation: draw-line 1.4s var(--ease-out) forwards; }
@keyframes draw-line { to { height: 100vh; } }
html:not(.is-loading) .loader { opacity: 0; visibility: hidden; }

/* Header: home, chapters, motion, sound */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: env(safe-area-inset-top) max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }
.site-header::before {
  content: ""; position: absolute; inset: 0 0 -32px 0; z-index: -1; pointer-events: none;
  background: linear-gradient(var(--night) 35%, rgba(5, 4, 10, 0)); opacity: 0; transition: opacity .8s ease;
}
.state-entered .site-header::before { opacity: .94; }
.home { position: relative; display: inline-flex; align-items: center; gap: 14px; min-height: 44px; text-decoration: none; color: var(--human); }
.home::before { content: ""; position: absolute; top: 0; bottom: 0; left: -11px; right: -11px; }
.home img { width: auto; height: 28px; } /* the monogram is 138 x 160: never squared */
.wordmark {
  display: block; width: 104px; height: 24px; background: currentColor;
  -webkit-mask: url(../assets/logo-latin.svg) left center / contain no-repeat;
  mask: url(../assets/logo-latin.svg) left center / contain no-repeat;
  opacity: 0; transform: translateX(-6px); transition: opacity .8s ease .6s, transform .8s var(--ease-out) .6s;
}
.state-entered .wordmark { opacity: 1; transform: none; }
.controls { display: flex; align-items: center; gap: 6px; }
.control {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; min-width: 44px; padding: 0 8px;
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--machine);
}
.motion-icon { width: 24px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.motion-flat, .motion-off .motion-wave { opacity: 0; }
.motion-off .motion-flat { opacity: 1; }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.bars i { display: block; width: 2px; height: 2px; background: currentColor; }
.sound-on .bars i { animation: bar 1.1s ease-in-out infinite alternate; }
.sound-on .bars i:nth-child(2) { animation-duration: .8s; animation-delay: -.4s; }
.sound-on .bars i:nth-child(3) { animation-duration: 1.3s; animation-delay: -.7s; }
.sound-on .bars i:nth-child(4) { animation-duration: .95s; animation-delay: -.2s; }
@keyframes bar { from { height: 2px; } to { height: 12px; } }
.music-on .control-sound .control-label { color: var(--human); letter-spacing: .12em; }
@media (max-width: 640px) {
  .control-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .wordmark { display: none; }
}

/* Chapters: a 3D drum in the header (it rolls as you change chapter) and a menu on demand */
.drum {
  display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 6px; color: var(--human);
  opacity: 0; visibility: hidden; transition: opacity .8s ease .8s, visibility 0s linear 1.6s;
}
.state-entered .drum { opacity: 1; visibility: visible; transition: opacity .8s ease .8s, visibility 0s; }
.drum-window {
  position: relative; display: block; width: clamp(180px, 15vw, 220px); height: 44px;
  -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
}
.drum-ring { position: absolute; inset: 0; }
.drum-face {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; white-space: nowrap;
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase; visibility: hidden;
}
.drum-face:first-child { visibility: visible; } /* until the script turns the drum */
.drum-face b { font-weight: 400; color: var(--machine); }
@media (max-width: 640px) {
  /* the header fits any phone: the drum takes what the logo and the two controls leave */
  .drum-window { width: clamp(96px, calc(100vw - 218px), 172px); }
  .drum-face { gap: 8px; font-size: 12px; letter-spacing: .1em; }
  .drum { gap: 8px; }
}
@media (max-width: 374px) { .drum-face { gap: 6px; font-size: 11px; letter-spacing: .05em; } }
@media (max-width: 340px) { .drum-window { width: 26px; } .drum-name { display: none; } }
.drum-icon { display: grid; gap: 5px; }
.drum-icon i { display: block; width: 18px; height: 1px; background: var(--machine); }
.menu {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: calc(var(--header-h) + 24px) var(--gutter) 48px;
  background: rgba(5, 4, 10, .95); opacity: 0; transition: opacity .45s ease;
}
@supports (height: 100lvh) { .menu { bottom: auto; height: 100lvh; padding-bottom: calc(48px + 100lvh - 100dvh); } }
.menu[hidden] { display: none; }
.menu-open .menu { opacity: 1; }
.menu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(4px, 1.4vh, 14px); perspective: 1200px; }
.menu-list li { transform-origin: 0% 50%; transform: rotateY(72deg) translateZ(-140px); opacity: 0; transition: transform .9s var(--ease-out), opacity .6s ease; transition-delay: calc(var(--i) * 70ms); }
.menu-open .menu-list li { transform: none; opacity: 1; }
.menu-list a { display: flex; align-items: baseline; gap: clamp(16px, 2vw, 32px); min-height: 44px; text-decoration: none; color: var(--human); }
.menu-n { min-width: 2.4em; font-size: 13px; letter-spacing: .16em; color: var(--machine); }
.menu-t { font-weight: 200; font-size: clamp(32px, 6vw, 88px); line-height: 1.08; transition: letter-spacing .6s var(--ease-out), color .3s ease; }
.menu-list a:focus-visible .menu-t { letter-spacing: .05em; }
@media (hover: hover) { .menu-list a:hover .menu-t { letter-spacing: .05em; } }
.menu-list a.is-active .menu-t { color: var(--machine); }
.menu-close {
  position: absolute; top: calc(env(safe-area-inset-top) + 14px); right: var(--gutter); min-height: 44px; padding: 0 18px;
  border: 1px solid rgba(184, 208, 224, .5); border-radius: 999px; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--machine);
}

/* Gate: the question, split by the line */
.gate { position: relative; z-index: 30; min-height: 100svh; display: grid; place-items: center; padding: var(--header-h) var(--gutter) 150px; }
.js .gate { position: fixed; inset: 0; overflow: hidden; transition: opacity 1.1s ease .5s, visibility 0s linear 1.6s; } /* the question spreads as it leaves: never wider than the screen */
.js.state-entered .gate { opacity: 0; visibility: hidden; pointer-events: none; }
.gate-center { display: flex; flex-direction: column; align-items: center; gap: clamp(20px, 4vh, 40px); }
.question { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 2vh 4vw; transition: opacity 1.4s ease .15s; }
.is-loading .question, .is-loading .gate-foot { opacity: 0; }
.q-lat {
  display: block; font-family: "Josefin Gate", var(--font-lat); font-weight: 100; font-size: clamp(64px, 19vw, 230px); line-height: 1; letter-spacing: .2em; margin-right: -.2em;
  transition: letter-spacing 1.8s var(--ease-out), margin 1.8s var(--ease-out), opacity 1.2s ease .3s, filter 1.2s ease;
}
.q-ar { display: block; font-family: "Mada Gate", var(--font-ar); font-weight: 300; font-size: clamp(40px, 10.5vw, 96px); line-height: 1.3; margin-top: .1em; opacity: .7; transition: opacity 1.4s ease; }
.state-awake .q-ar { opacity: 1; }
.question:focus-visible .q-lat { letter-spacing: .26em; margin-right: -.26em; }
@media (hover: hover) { .question:hover .q-lat { letter-spacing: .26em; margin-right: -.26em; } }
.js.state-entered .q-lat { letter-spacing: .9em; margin-right: -.9em; opacity: 0; filter: blur(6px); }
.js.state-entered .q-ar { opacity: 0; }
.gate-foot { position: absolute; left: var(--gutter); right: var(--gutter); bottom: max(64px, calc(env(safe-area-inset-bottom) + 44px)); display: grid; justify-items: center; gap: 8px; text-align: center; transition: opacity 1.4s ease .8s; }
.hint { margin: 0; font-size: 14px; letter-spacing: .1em; color: var(--human); }
.tip { margin: 0; font-size: 13px; letter-spacing: .1em; color: var(--machine); opacity: 0; transition: opacity .8s ease; }
.state-awake .tip { opacity: 1; }
@media (max-height: 520px) and (orientation: landscape) {
  .gate { padding-bottom: 76px; }
  .gate-center { gap: 6px; }
  .question { padding: 0 4vw; }
  .q-lat { font-size: clamp(44px, 24svh, 120px); }
  .q-ar { font-size: clamp(26px, 12svh, 64px); line-height: 1.2; }
  .gate-foot { bottom: max(16px, calc(env(safe-area-inset-bottom) + 8px)); }
}
.has-mixed .tip { opacity: 0; }

/* Mixer readout on the gate; the range is the keyboard control of the line */
.mixer {
  position: fixed; left: 0; right: 0; bottom: max(22px, env(safe-area-inset-bottom)); z-index: 36;
  display: flex; align-items: center; justify-content: space-between; padding: 0 var(--gutter);
  font-size: 12px; letter-spacing: .2em; text-transform: uppercase; pointer-events: none; opacity: 0; transition: opacity .9s ease;
}
.state-awake .mixer, .mix-focus .mixer { opacity: 1; }
.mixer-human { color: var(--human); }
.mixer-machine { color: var(--machine); }
.mixer [data-mix-human], .mixer [data-mix-machine], .pole-value span { display: inline-block; min-width: 2.2ch; font-variant-numeric: tabular-nums; }
.mix-focus .mixer-human, .mix-focus .mixer-machine { text-decoration: underline; text-underline-offset: .5em; }

/* Split text: the human ink, and its machine twin clipped at the line */
[data-split] { position: relative; }
.split-ghost { position: absolute; inset: 0; color: var(--machine); pointer-events: none; clip-path: inset(0 0 0 100%); text-shadow: 0 0 22px rgba(184, 208, 224, .35); }

/* Project */
/* the 3D arrivals (blocks swinging in from the line) never reach past the screen: a phone would zoom the whole page out */
.project { position: relative; z-index: 10; overflow-x: hidden; overflow-x: clip; }
.js .project { visibility: hidden; opacity: 0; transition: opacity 1.2s ease, visibility 0s linear 1.2s; }
.js.state-entered .project { visibility: visible; opacity: 1; transition: opacity 1.4s ease .8s, visibility 0s; }
.chapter { position: relative; max-width: 1360px; margin: 0 auto; padding: 0 var(--gutter); }

/* Reveals: quiet, once */
.js [data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity 1s ease, transform 1.2s var(--ease-out); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js .display[data-reveal] { opacity: 1; transform: none; clip-path: inset(-25% 50% -25% 50%); transition: clip-path 1.8s var(--ease-out); }
.js .display[data-reveal].is-in { clip-path: inset(-25% -5% -25% -5%); }

/* The 3D journey: blocks swing in from the line, arrive from depth or flip up; flat (and still) where you read */
.js [data-3d] { will-change: transform, opacity; }
.js [data-3d].is-flat { transform: none !important; opacity: 1 !important; will-change: auto; }
.js [data-3d="hinge-l"] { transform-origin: 0% 50%; transform: perspective(1400px) rotateY(calc((1 - var(--p, 1)) * 48deg)) translateZ(calc((1 - var(--p, 1)) * -140px)); opacity: calc(.15 + .85 * var(--p, 1)); }
.js [data-3d="hinge-r"] { transform-origin: 100% 50%; transform: perspective(1400px) rotateY(calc((1 - var(--p, 1)) * -48deg)) translateZ(calc((1 - var(--p, 1)) * -140px)); opacity: calc(.15 + .85 * var(--p, 1)); }
.js [data-3d="tilt"] { transform-origin: 50% 100%; transform: perspective(1400px) rotateX(calc((1 - var(--p, 1)) * 34deg)) translateZ(calc((1 - var(--p, 1)) * -180px)); opacity: calc(.2 + .8 * var(--p, 1)); }
.js [data-3d="flip"] { transform-origin: 50% 100%; transform: perspective(900px) rotateX(calc((1 - var(--p, 1)) * -82deg)); opacity: calc(.1 + .9 * var(--p, 1)); }
.js [data-3d="depth"] { transform: perspective(1400px) translateZ(calc((1 - var(--p, 1)) * -520px)); opacity: var(--p, 1); }
.js [data-3d="away"] { transform: perspective(1400px) translateZ(calc(var(--q, 0) * -420px)) rotateX(calc(var(--q, 0) * 10deg)); opacity: calc(1 - var(--q, 0) * .85); }
@media (max-width: 899px) {
  .js .prose[data-3d] { transform-origin: 50% 100%; transform: perspective(1200px) rotateX(calc((1 - var(--p, 1)) * 28deg)) translateZ(calc((1 - var(--p, 1)) * -120px)); }
}

/* Reading guide: the paragraph being read is full, the next ones wait a little dimmer, key words get a red underline */
.js.state-entered .prose p { transition: opacity .7s ease; }
.js.state-entered .prose p:not(.was-reached) { opacity: .6; }
mark.key {
  color: inherit; padding: 0 .04em; -webkit-box-decoration-break: clone; box-decoration-break: clone;
  background: linear-gradient(rgba(194, 26, 43, .7), rgba(194, 26, 43, .7)) no-repeat 0 92% / 0% .14em;
  transition: background-size 1.2s var(--ease-out) .25s;
}
.was-reached mark.key, .motion-off mark.key, .no-js mark.key { background-size: 100% .14em; }
.motion-off .prose p { opacity: 1 !important; }

/* Lens: under the pointer, a photo shows its machine twin and the twin shows the photo */
.duo-lens {
  position: absolute; left: 0; top: 0; z-index: 2; width: 140px; height: 140px; border-radius: 50%; pointer-events: none;
  background-repeat: no-repeat; opacity: 0; transition: opacity .25s ease;
  box-shadow: 0 0 0 1px rgba(228, 239, 246, .85), 0 0 34px rgba(184, 208, 224, .35);
}
.duo-lens.is-on { opacity: 1; }
.cursor.is-lens .cursor-ring { opacity: 0; }
.cursor.is-touch .cursor-ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; border-color: rgba(242, 234, 219, .5); }
.cursor.is-touch .cursor-label { font-size: 10px; }
.interlude-play { margin-top: -18px; color: var(--muted); }

/* Chapter 1: behind HAY */
.opener { position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding: var(--header-h) 0 clamp(110px, 18vh, 190px); }
/* a low shade so the title and its line read on the bright painting, the top stays bright */
.opener::before { content: ""; position: absolute; left: 50%; bottom: 0; width: 100vw; height: 62%; transform: translateX(-50%); z-index: -1; pointer-events: none; background: linear-gradient(to top, rgba(5, 4, 10, .78), rgba(5, 4, 10, 0)); }
.kicker { margin: 0 0 22px; max-width: 34em; font-size: clamp(14px, .3vw + 12px, 16px); letter-spacing: .16em; text-transform: uppercase; color: var(--human); text-shadow: 0 0 18px rgba(5, 4, 10, .9), 0 0 2px rgba(5, 4, 10, .8); }
.display {
  margin: 0; font-weight: 200; font-size: clamp(56px, 12vw, 216px); line-height: .92; letter-spacing: .02em; text-transform: uppercase;
  text-shadow: 0 0 40px rgba(5, 4, 10, .6);
}
.scroll-cue {
  position: absolute; right: 0; bottom: clamp(40px, 7vh, 72px); display: inline-flex; align-items: center; gap: 14px; min-height: 44px;
  font-size: 13px; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; color: var(--machine);
}
.scroll-cue i { position: relative; display: block; width: 1px; height: 40px; overflow: hidden; background: rgba(184, 208, 224, .25); }
.scroll-cue i::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--machine); animation: cue 1.8s var(--ease-out) infinite; }
@keyframes cue { to { top: 100%; } }
.behind-grid { display: grid; gap: clamp(36px, 6vw, 96px); padding: clamp(24px, 6vh, 80px) 0 clamp(80px, 14vh, 160px); }
.duo { position: relative; overflow: hidden; background: #03050B; }
.duo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.duo-machine { position: absolute; inset: 0; width: 100%; height: 100%; clip-path: inset(0 0 0 100%); }
.portrait img { object-position: 50% 26%; }
.cover img { aspect-ratio: 1; }
.prose { max-width: 36em; }
.prose p { margin: 0 0 1.1em; font-size: clamp(17px, .35vw + 15px, 20px); line-height: 1.75; color: var(--body); }
.prose .lede { font-weight: 300; font-size: clamp(22px, 1vw + 15px, 30px); line-height: 1.45; color: var(--human); margin-bottom: .9em; }
.facts { display: grid; gap: 14px; margin: 2em 0 0; padding-top: 1.4em; border-top: 1px solid var(--rule); }
.facts div { display: grid; grid-template-columns: minmax(6.5em, auto) 1fr; gap: 18px; align-items: baseline; }
.facts dt { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--machine); }
.facts dd { margin: 0; font-size: 17px; line-height: 1.5; color: var(--human); }
@media (min-width: 900px) {
  .behind-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 1fr) minmax(0, 6fr); align-items: center; }
  .behind-grid > .duo { grid-column: 1; }
  .behind-grid > .prose { grid-column: 3; }
}

/* Between: the two poles of HAY, live */
.interlude {
  position: relative; max-width: 1360px; min-height: 92svh; margin: 0 auto; padding: clamp(96px, 16vh, 180px) var(--gutter);
  display: grid; align-content: center; justify-items: center; gap: clamp(32px, 6vh, 64px);
}
.poles { width: 100%; display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(48px, 12vw, 200px); align-items: end; }
.pole { margin: 0; display: grid; gap: 14px; }
.pole-human { justify-items: end; text-align: right; }
.pole-machine { justify-items: start; text-align: left; }
.pole-word { font-weight: 200; font-size: clamp(34px, 6.6vw, 112px); line-height: 1.02; text-shadow: 0 0 30px rgba(5, 4, 10, .7); }
.pole-value { font-size: 14px; letter-spacing: .18em; color: var(--human); }
.pole-machine .pole-value { color: var(--machine); }
.interlude-tip { margin: 0; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--machine); }

/* Chapter 2: HAY | حيٌ, the two words meet at the line */
.chapter-hay { padding-top: clamp(64px, 10vh, 140px); }
.split-title {
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(36px, 12vw, 240px) minmax(0, 1fr); align-items: center;
  margin: 0 0 clamp(56px, 10vh, 120px); font-weight: 200; font-size: clamp(48px, 16.5vw, 260px); line-height: 1;
}
.st-lat { justify-self: end; letter-spacing: .1em; margin-right: -.1em; }
.st-gap { display: block; height: 1em; }
.st-ar { justify-self: start; font-weight: 300; line-height: 1.2; }
.hay-grid { display: grid; gap: clamp(36px, 6vw, 96px); }
@media (min-width: 900px) {
  .hay-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 1fr) minmax(0, 5fr); align-items: center; }
  .hay-grid > .prose { grid-column: 1; grid-row: 1; }
  .hay-grid > .duo { grid-column: 3; grid-row: 1; }
}
@media (max-width: 899px) { .hay-grid > .duo { order: -1; } }
@media (max-width: 640px) { .behind-grid > .duo, .hay-grid > .duo { margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); } }

/* HAY live: his live visuals (FMRXR Studio) as a stage and a wall of tiles */
.chapter-live { padding-top: clamp(110px, 18vh, 200px); }
.live-head, .live-stage, .live-wall, .live-credit { max-width: 1040px; margin-left: auto; }
.live-lede { margin: 0 0 clamp(28px, 5vh, 48px); max-width: 34ch; font-weight: 300; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.4; color: var(--human); }
.live-lede [lang="ar"] { font-family: var(--font-ar); font-weight: 300; }
.live-stage { margin-top: 0; margin-bottom: 0; }
.live-screen { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.live-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.1s ease; }
.live-img.is-shown { opacity: 1; }
.live-img.is-shown { animation: live-breathe 14s ease-in-out infinite alternate; }
@keyframes live-breathe { from { transform: scale(1); } to { transform: scale(1.06); } }
.live-caption { display: flex; gap: 14px; align-items: baseline; padding: 12px 0 2px; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--human); }
.live-n { color: var(--machine); }
.live-wall { list-style: none; padding: 0; margin-top: 10px; margin-bottom: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.live-tile {
  position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; overflow: hidden; background: #000; cursor: pointer;
  transform-style: preserve-3d; transition: transform .6s var(--ease-out);
}
.live-tile img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.55) brightness(.6); transform: scale(1.7); transition: filter .5s ease, transform .9s var(--ease-out); }
.live-tile:focus-visible img { filter: none; transform: scale(1.9); }
@media (hover: hover) { .live-tile:hover img { filter: none; transform: scale(1.9); } }
.live-tile[aria-pressed="true"] img { filter: none; }
.live-tile[aria-pressed="true"]::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 2px var(--red); }
.live-tile.is-hit { animation: live-flip .7s var(--ease-out); }
@keyframes live-flip { from { transform: perspective(500px) rotateY(180deg); } to { transform: perspective(500px) rotateY(0); } }
.live-credit { margin-top: 14px; margin-bottom: 0; font-size: 14px; color: var(--muted); }
@media (max-width: 640px) {
  .live-wall { gap: 4px; }
  .live-caption { font-size: 12px; letter-spacing: .16em; }
}
@media (prefers-reduced-motion: reduce) {
  .live-img { transition: none; }
  .live-tile.is-hit { animation: none; }
}

/* Teaser */
.chapter-teaser { padding-top: clamp(110px, 18vh, 200px); }
.label-title { margin: 0 0 22px; font-weight: 400; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--machine); }
.chapter-teaser .label-title { max-width: 1040px; margin-left: auto; }
.teaser { max-width: 1040px; margin-left: auto; }
.teaser-play, .teaser-frame { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; overflow: hidden; background: #000; }
.teaser-play img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.2) brightness(.5); transform: scale(1.02); transition: filter .8s ease, transform 1.2s var(--ease-out);
}
.teaser-play:focus-visible img { filter: grayscale(0) contrast(1.05) brightness(.72); transform: scale(1.05); }
@media (hover: hover) { .teaser-play:hover img { filter: grayscale(0) contrast(1.05) brightness(.72); transform: scale(1.05); } }
.teaser-play::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(to top, rgba(5, 4, 10, .92), rgba(5, 4, 10, .35) 34%, rgba(5, 4, 10, 0) 60%); }
.teaser-frame { transition: opacity .6s ease; }
.teaser-frame.is-ending { opacity: 0; }
.teaser-label {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--human);
}
.teaser-icon { position: relative; width: 68px; height: 68px; border: 1px solid currentColor; border-radius: 50%; }
.teaser-icon::after {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-35%, -50%);
  border-style: solid; border-width: 10px 0 10px 16px; border-color: transparent transparent transparent currentColor;
}
.teaser-caption { margin: 14px 0 0; font-size: 14px; color: var(--muted); }

/* Footer: listen, follow, ask again */
.site-footer { position: relative; max-width: 1360px; margin: 0 auto; padding: clamp(140px, 24vh, 260px) var(--gutter) max(48px, calc(env(safe-area-inset-bottom) + 32px)); }
.socials { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.socials a { display: inline-flex; align-items: center; gap: .26em; font-weight: 200; font-size: clamp(48px, 9vw, 150px); line-height: 1.1; letter-spacing: .03em; text-decoration: none; transition: letter-spacing .7s var(--ease-out); }
.socials a:focus-visible { letter-spacing: .1em; }
@media (hover: hover) { .socials a:hover { letter-spacing: .1em; } }
.social-icon { flex: none; width: .5em; height: .5em; fill: currentColor; opacity: .9; transition: transform .7s var(--ease-out), opacity .3s ease; }
.socials a:focus-visible .social-icon { transform: rotate(-8deg) scale(1.08); opacity: 1; }
@media (hover: hover) { .socials a:hover .social-icon { transform: rotate(-8deg) scale(1.08); opacity: 1; } }
.again { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 6px 24px; margin-top: clamp(72px, 12vh, 140px); text-decoration: none; }
.again-q { font-weight: 100; font-size: clamp(44px, 6vw, 96px); line-height: 1; letter-spacing: .2em; }
.again-note { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--machine); }
/* Booking and press: straight to him (WhatsApp, email), nothing in between to maintain */
.booking { margin-top: clamp(80px, 13vh, 150px); }
.booking-lede { margin: 0 0 clamp(18px, 3vh, 30px); max-width: 32ch; font-weight: 300; font-size: clamp(20px, 1.4vw + 13px, 28px); line-height: 1.45; color: var(--human); }
.booking-ways { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.booking-ways li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; }
.booking-ways li[hidden] { display: none; }
.booking-way { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 22px; text-decoration: none; }
.booking-name { font-weight: 200; font-size: clamp(42px, 6.6vw, 108px); line-height: 1.1; letter-spacing: .03em; transition: letter-spacing .7s var(--ease-out); }
.booking-way:focus-visible .booking-name { letter-spacing: .08em; }
@media (hover: hover) { .booking-way:hover .booking-name { letter-spacing: .08em; } }
.booking-detail { font-size: 15px; letter-spacing: .12em; color: var(--machine); font-variant-numeric: tabular-nums; }
.booking-copy {
  min-height: 44px; padding: 0 16px; border: 1px solid rgba(184, 208, 224, .35); border-radius: 999px;
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--machine); transition: border-color .3s ease, color .3s ease;
}
.booking-copy:focus-visible { border-color: var(--machine); color: var(--human); }
@media (hover: hover) { .booking-copy:hover { border-color: var(--machine); color: var(--human); } }
.booking-copy.is-done { border-color: var(--red); color: var(--human); }

/* Credits: who made what */
.credits { margin-top: clamp(64px, 10vh, 110px); }
.credits-list { display: grid; gap: 10px 40px; margin: 0; }
.credits-list div { display: grid; grid-template-columns: minmax(120px, 11em) 1fr; gap: 16px; padding: 10px 0; border-top: 1px solid var(--rule); }
.credits-list dt { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--machine); padding-top: 2px; }
.credits-list dd { margin: 0; font-size: 16px; line-height: 1.5; color: var(--body); }
.credits-list a { display: inline-block; padding: 12px 0; margin: -12px 0; color: inherit; text-underline-offset: .25em; text-decoration-color: rgba(242, 234, 219, .35); }
.credits-list a:focus-visible { text-decoration-color: currentColor; }
@media (hover: hover) { .credits-list a:hover { text-decoration-color: currentColor; } }
@media (min-width: 900px) { .credits-list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .credits-list div { grid-template-columns: 1fr; gap: 4px; } }
.footer-base {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px;
  margin-top: clamp(56px, 9vh, 100px); padding-top: 24px; border-top: 1px solid var(--rule);
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.logo-ar {
  display: block; width: 92px; height: 30px; background: currentColor;
  -webkit-mask: url(../assets/logo-arabic.svg) left center / contain no-repeat;
  mask: url(../assets/logo-arabic.svg) left center / contain no-repeat;
}

/* Cursor (mouse only) */
.has-cursor, .has-cursor * { cursor: none !important; }
.cursor { position: fixed; left: 0; top: 0; z-index: 95; pointer-events: none; transition: opacity .3s ease; }
.cursor.is-out { opacity: 0; }
.cursor-dot, .cursor-ring { position: fixed; left: 0; top: 0; pointer-events: none; }
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--human); mix-blend-mode: difference; }
.cursor-ring {
  display: grid; place-items: center; width: 38px; height: 38px; margin: -19px 0 0 -19px;
  border: 1px solid rgba(242, 234, 219, .45); border-radius: 999px;
  transition: width .35s var(--ease-out), height .35s var(--ease-out), margin .35s var(--ease-out), border-color .3s ease, background-color .3s ease;
}
.cursor-label { font-size: 11px; letter-spacing: .2em; padding-left: .2em; text-transform: uppercase; white-space: nowrap; color: var(--human); opacity: 0; transition: opacity .25s ease; }
.cursor.has-label .cursor-ring { width: 84px; height: 84px; margin: -42px 0 0 -42px; background: rgba(5, 4, 10, .45); }
.cursor.has-label .cursor-label { opacity: 1; }
.cursor.is-drag .cursor-ring { width: 116px; height: 42px; margin: -21px 0 0 -58px; border-color: var(--machine); }
.cursor.is-drag .cursor-label { color: var(--machine); }
.cursor.is-link .cursor-ring { width: 56px; height: 56px; margin: -28px 0 0 -28px; border-color: var(--human); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .loader { display: none; }
}
