/* Foundations (creative direction §2, §3, §9, §11.1, §12). Mobile first: base rules are the phone layout;
   min-width queries add to it. */
@font-face { font-family: "Reem Kufi"; src: url("/fonts/ReemKufi.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("/fonts/IBMPlexSansArabic-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("/fonts/IBMPlexSansArabic-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Michroma"; src: url("/fonts/Michroma-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/fonts/SpaceGrotesk.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }

/* ---------- tokens ---------- */
:root {
  /* colour: approved values and the D-24 tones only */
  --core-900: #0A0A0A; --core: #111111; --core-800: #1B1B1B; --core-700: #252525; --core-600: #353535;
  --grey: #767676; --white-300: #C1C1C1; --white: #F3F3F3;
  --lime: #B7FF35; --lime-600: #5C7C21; --lime-800: #2C3717;
  --line: rgba(243,243,243,.14);
  /* motion */
  --t-micro: .2s; --t-ui: .45s; --t-page: .6s; --t-scene: .85s;
  --ease: cubic-bezier(.25,1,.5,1);
  --slant: 26.565deg;   /* skew that gives the 1:2 angle */
  /* layout */
  --bar: 64px; --wrap: min(1320px, 90vw); --space: 68px;
  /* type, Arabic */
  --fs-display: clamp(56px, min(13vw, 17svh), 168px);
  --fs-page: clamp(44px, 8vw, 112px);
  --fs-section: clamp(32px, 5vw, 64px);
  --fs-item: clamp(23px, 2.4vw, 32px);
  --fs-lead: clamp(18px, 1.6vw, 22px);
  --fs-body: 16px;
  --lh-title: 1.3;
}
html:lang(en) {
  --fs-display: clamp(28px, min(7.4vw, 11svh), 108px);
  --fs-page: clamp(26px, 5.2vw, 72px);
  --fs-section: clamp(22px, 3.2vw, 44px);
  --fs-item: clamp(16px, 1.6vw, 22px);
  --lh-title: 1.35;
}

/* ---------- base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; color-scheme: dark; }
body { background: var(--core); color: var(--white); font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; font-size: var(--fs-body); line-height: 1.8; -webkit-font-smoothing: antialiased; }
html:lang(en) body { font-family: "Space Grotesk", system-ui, sans-serif; line-height: 1.7; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: "Reem Kufi", "IBM Plex Sans Arabic", sans-serif; font-weight: 700; line-height: var(--lh-title); text-wrap: balance; }
html:lang(en) :is(h1, h2, h3, h4, .menu li a) { font-family: "Michroma", "Space Grotesk", sans-serif; font-weight: 400; letter-spacing: .02em; overflow-wrap: break-word; }
img { display: block; max-width: 100%; }
[id] { scroll-margin-top: var(--bar); }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
.wrap { width: var(--wrap); margin-inline: auto; }
.skip { position: absolute; top: -100px; inset-inline-start: 12px; background: var(--lime); color: var(--core); padding: 8px 16px; z-index: 30; }
.skip:focus { top: 12px; }

/* ---------- buttons and links ---------- */
.btn { display: inline-block; min-height: 48px; padding: 9px 26px; border: 1px solid var(--white); background: transparent; color: var(--white); font: inherit; line-height: 28px; text-decoration: none; cursor: pointer; transition: background var(--t-micro), color var(--t-micro), border-color var(--t-micro), clip-path .3s, translate var(--t-micro); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
.btn:hover { background: var(--white); color: var(--core); clip-path: polygon(0 0, 100% 0, 100% 100%, 10px 100%, 0 calc(100% - 20px)); }
.btn.primary { background: var(--lime); border-color: var(--lime); color: var(--core); font-weight: 700; }
.btn.primary:hover { background: var(--white); border-color: var(--white); }
.btn:active { translate: 1px -2px; }
.btn:disabled { opacity: .6; cursor: wait; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }
.more { display: inline-block; margin-top: 30px; padding-block: 8px; border-bottom: 2px solid var(--lime); text-decoration: none; }

/* ---------- bar ---------- */
.bar { position: sticky; top: 0; z-index: 20; background: var(--core); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--bar); border-bottom: 1px solid var(--line); }
.brand { position: relative; z-index: 2; }
.brand img { width: clamp(130px, 38vw, 160px); height: auto; }
.tools { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; }
.lang { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; font-size: 14px; text-decoration: none; }
.lang::after { content: ""; }
.lang:hover { color: var(--lime); }
.lang:lang(en) { font-family: "Space Grotesk", sans-serif; }
.lang:lang(ar) { font-family: "IBM Plex Sans Arabic", sans-serif; }
.cta { display: none; }
.bar .cta[aria-current], .bar .cta[aria-current]:hover { background: transparent; border-color: var(--lime); color: var(--white); }
.menu-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; background: none; color: var(--white); border: 1px solid var(--core-600); font: inherit; font-size: 14px; cursor: pointer; transition: border-color var(--t-micro); }
.menu-btn:hover { border-color: var(--lime); }
.burger { display: block; width: 22px; height: 12px; position: relative; }
.burger::before, .burger::after { content: ""; position: absolute; inset-inline: 0; height: 2px; background: currentColor; }
.burger::before { top: 1px; } .burger::after { bottom: 1px; }
.menu-btn[aria-expanded="true"] { border-color: var(--lime); }
.menu-btn[aria-expanded="true"] .burger::before { top: 5px; rotate: 30deg; }
.menu-btn[aria-expanded="true"] .burger::after { bottom: 5px; rotate: -30deg; }

/* ---------- full-screen menu ---------- */
.js .menu { position: fixed; inset: var(--bar) 0 0 0; z-index: 1; overflow: hidden; visibility: hidden; transition: visibility 0s var(--t-ui); }
.js .menu.open { visibility: visible; transition-delay: 0s; }
/* two slanted panels at the 1:2 angle slide in from the reading start */
.js .menu::before, .js .menu::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60svh; right: -60svh; transition: transform var(--t-ui) var(--ease); transform: translateX(calc(var(--from, -1) * 101%)) skewX(calc(var(--lean, -1) * var(--slant))); }
.js .menu::before { background: var(--core-800); }
.js .menu::after { background: var(--core-900); transition-delay: .06s; }
[dir="rtl"] .menu { --from: 1; --lean: 1; }
.js .menu.open::before, .js .menu.open::after { transform: translateX(0) skewX(calc(var(--lean, -1) * var(--slant))); }
.menu nav { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; height: 100%; overflow: auto; width: var(--wrap); margin-inline: auto; padding-block: 24px; }
.menu ul { list-style: none; padding-inline-start: 20px; }   /* the slanted marker leans past its link */
.menu .lang { margin-inline-start: 20px; }
.menu li a { display: flex; align-items: center; gap: .35em; width: fit-content; min-height: 48px; font-family: "Reem Kufi", sans-serif; font-weight: 700; font-size: clamp(30px, min(10vw, 10svh), 96px); line-height: 1.45; text-decoration: none; transition: color var(--t-micro), clip-path var(--t-ui) var(--ease); }
html:lang(en) .menu li a { font-size: clamp(22px, min(6.4vw, 7svh), 64px); line-height: 1.9; }
.menu li a::before { content: ""; width: .12em; height: .6em; background: var(--lime); transform: skewX(calc(var(--lean, -1) * var(--slant))); opacity: 0; transition: opacity var(--t-micro); }
.menu li a:hover::before, .menu li a:focus-visible::before, .menu li a[aria-current]::before { opacity: 1; }
.menu li a:hover { color: var(--white-300); }
.menu .lang { justify-content: flex-start; margin-top: 24px; width: fit-content; font-size: 18px; }
.js .menu li a, .js .menu .lang { clip-path: inset(-15% -.4em 115% -.4em); }   /* room for the slanted marker */
.js .menu.open li a, .js .menu.open .lang { clip-path: inset(-15% -.4em -15% -.4em); }
.js .menu.open li:nth-child(1) a { transition-delay: .12s; }
.js .menu.open li:nth-child(2) a { transition-delay: .18s; }
.js .menu.open li:nth-child(3) a { transition-delay: .24s; }
.js .menu.open li:nth-child(4) a { transition-delay: .30s; }
.js .menu.open .lang { transition-delay: .36s; }
.menu-open { overflow: hidden; }
/* without JavaScript the links simply show under the bar */
html:not(.js) .bar { position: static; }
html:not(.js) .menu-btn, html:not(.js) .menu .lang { display: none; }
html:not(.js) .menu nav { height: auto; justify-content: flex-start; padding-block: 10px; }
html:not(.js) .menu ul { display: flex; flex-wrap: wrap; gap: 4px 22px; }
html:not(.js) .menu li a { font-size: 17px; }

/* ---------- shared text ---------- */
.kicker { display: block; font-size: 14px; }
.kicker::before { content: ""; display: inline-block; width: 28px; height: 2px; background: var(--lime); vertical-align: middle; margin-inline-end: 12px; }
.lead { font-size: var(--fs-lead); max-width: 640px; }
.sec-title { font-size: var(--fs-section); margin: 14px 0 20px; }

/* ---------- drawing tones and the shared entrance keyframes ---------- */
.c800 { fill: var(--core-800); }
.c700 { fill: var(--core-700); }
.c600 { fill: var(--core-600); }
.cgrey { fill: var(--grey); }
.cwhite { fill: var(--white-300); }
.clime { fill: var(--lime); }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes unmask { from { clip-path: inset(-15% -2% 115% -2%); } to { clip-path: inset(-15% -2% -15% -2%); } }
@keyframes settle { from { opacity: 0; transform: translate(calc(var(--from) * 110px), calc(var(--from) * -220px)); } }

/* ---------- page structure ---------- */
section { padding: var(--space) 0; border-top: 1px solid var(--line); }
section.alt { background: var(--core-800); }
.page-hero { padding: 64px 0 52px; }
.page-hero h1 { font-size: var(--fs-page); margin: 18px 0; }
.lost { min-height: 60vh; }
.lost .btn { margin-top: 20px; }
.closing { text-align: center; }
.closing .actions { justify-content: center; margin-top: 24px; }

/* ---------- event formats: one geometric behaviour per format (D-27). The natural state is the finished
   composition; .pre (added by script) is the entrance start. Pieces move, the 1:2 angle never changes. ---------- */
.formats { display: grid; grid-template-columns: 1fr; gap: 2px; margin-top: 36px; }
.format { display: grid; grid-template-columns: 104px 1fr; gap: 18px; align-items: center; background: var(--core-800); padding: 18px; }
.format-art { display: block; width: 100%; height: auto; }
[dir="rtl"] .format-art { transform: scaleX(-1); }
.format h3 { font-size: var(--fs-item); margin-bottom: 8px; }
.format p { font-size: 15px; }
.piece { transition: transform .8s var(--ease), opacity .5s ease-out; }
.i0 { --n: 0; } .i1 { --n: 1; transition-delay: .06s; } .i2 { --n: 2; transition-delay: .12s; } .i3 { --n: 3; transition-delay: .18s; }
.i4 { --n: 4; transition-delay: .24s; } .i5 { --n: 5; transition-delay: .30s; } .i6 { --n: 6; transition-delay: .36s; }
/* live experiences: bars follow the pointer along the angle (--k set by script) */
.format-live .piece { transform: translate(calc(var(--k, 0px) * .5), calc(var(--k, 0px) * -1)); }
.format-live:not(.pre) .piece.tracking { transition-duration: .25s; transition-delay: 0s; }
/* entrance start */
.format.pre .piece { opacity: 0; }
.format-ex.pre .piece { transform: translateX(calc((var(--n) - 3) * 16px)); }
.format-co.pre .i0 { transform: translateX(-34px); }
.format-co.pre .i1 { transform: translateX(34px); }
.format-ev.pre .i0 { transform: translate(-30px, 60px); }
.format-ev.pre .i1 { transform: translate(30px, -60px); }
.format-ev.pre .i2 { transform: translate(-20px, 40px); }
.format-live.pre .piece { transform: translate(-30px, 60px); }
@media (hover: hover) {
  .format-ex:not(.pre):hover .piece { transform: translateX(calc((3 - var(--n)) * 8px)); }   /* gather around one theme */
  .format-co:not(.pre):hover .i0 { transform: translateX(18px); }                            /* draw closer in conversation */
  .format-co:not(.pre):hover .i1 { transform: translateX(-18px); }
  .format-ev:not(.pre):hover .i0 { transform: translate(15px, -30px); }                      /* every event takes its own shape */
  .format-ev:not(.pre):hover .i1 { transform: translate(-6px, 12px); }
  .format-ev:not(.pre):hover .i2 { transform: translate(11px, -22px); }
}

/* ---------- what we do ---------- */
.num { display: block; font-size: 15px; color: var(--lime); margin-bottom: 8px; }

/* form and privacy text: built only after legal review */
form { display: grid; grid-template-columns: 1fr; gap: 22px; }
.full { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 6px; font-size: 15px; }
.field small { color: var(--white-300); }
input:not([type="checkbox"]), select, textarea { width: 100%; background: var(--core-800); color: var(--white); border: 1px solid var(--grey); border-radius: 0; padding: 12px 14px; font: inherit; font-size: 16px; min-height: 52px; }
input::placeholder, textarea::placeholder { color: var(--white-300); text-align: right; }
[dir="ltr"] input::placeholder, [dir="ltr"] textarea::placeholder { text-align: left; }
input:focus, select:focus, textarea:focus { border-color: var(--lime); }
[aria-invalid="true"] { border-color: var(--white) !important; border-width: 2px !important; }
.err { font-size: 13px; font-weight: 700; }
.err:not(:empty)::before { content: ""; display: inline-block; width: 4px; height: 12px; background: var(--white); transform: skewX(calc(-1 * var(--slant))); margin-inline-end: 8px; }  /* C-03: no red */
.check input { width: 18px; height: 18px; accent-color: var(--lime); vertical-align: middle; margin-inline-end: 8px; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#form-status { margin-top: 16px; }
#form-status.ok { color: var(--lime); }
#form-status.bad { font-weight: 700; }
.prose { max-width: 760px; }
.prose h2 { font-size: var(--fs-item); margin: 28px 0 6px; }
.prose h2:first-child { margin-top: 0; }

/* ---------- footer ---------- */
footer { background: var(--core); border-top: 1px solid var(--line); padding: 50px 0; font-size: 14px; }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px; }
.foot img { width: 240px; height: auto; }  /* approved minimum for the bilingual lockup */
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot nav a { display: inline-block; padding-block: 12px; }

/* ---------- wider screens ---------- */
@media (max-width: 359px) { .menu-btn { min-width: 48px; justify-content: center; } .menu-btn .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } }
@media (min-width: 641px) {
  :root { --space: 96px; }
  .formats { grid-template-columns: 1fr 1fr; }
  .format { display: block; padding: 24px 20px 28px; }
  .format-art { margin-bottom: 18px; }
  form { grid-template-columns: 1fr 1fr; }
  .page-hero { padding: 100px 0 70px; }
}
@media (min-width: 761px) {
  :root { --bar: 80px; }
  .brand img { width: 240px; }   /* approved minimum for the bilingual lockup */
  .tools { gap: 20px; }
  .cta { display: inline-block; }
  .menu-btn { padding: 0 18px; }
}
@media (min-width: 961px) {
  .formats { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .formats .format .piece { opacity: 1 !important; transform: none !important; }  /* also on hover */
}

/* ---------- smooth scrolling (script; wide screens with a mouse): the bar leaves the flow ---------- */
html.smooth { scroll-behavior: auto; }
html.smooth .bar { position: fixed; left: 0; right: 0; }
html.smooth #smooth-content { padding-top: var(--bar); }

/* ---------- page and language transitions (creative direction §10): CSS only, instant where unsupported ---------- */
@view-transition { navigation: auto; }
.wipe-edge { position: fixed; top: 0; left: 0; z-index: 25; width: 3px; height: 100vh; background: var(--lime); transform: translateX(-200vw); pointer-events: none; view-transition-name: edge; }
.bar { view-transition-name: bar; }
.menu-open .bar { view-transition-name: none; }   /* an open menu leaves with the page */
::view-transition { background: #0A0A0A; }
/* a panel edge at 1:2 crosses in the reading direction: the old page leaves behind it, the new one follows */
::view-transition-old(root) { animation: wipe-out .3s cubic-bezier(.5,0,.75,0) both; mix-blend-mode: normal; }
::view-transition-new(root) { animation: wipe-in .3s .3s cubic-bezier(.25,1,.5,1) both; mix-blend-mode: normal; }
[dir="rtl"]::view-transition-old(root) { animation-name: wipe-out-rtl; }
[dir="rtl"]::view-transition-new(root) { animation-name: wipe-in-rtl; }
::view-transition-group(bar) { animation: none; }
::view-transition-old(bar) { display: none; }
::view-transition-new(bar) { animation: none; mix-blend-mode: normal; }
::view-transition-group(edge) { animation: edge .6s linear both; transform-origin: 50% 50%; }
[dir="rtl"]::view-transition-group(edge) { animation-name: edge-rtl; }
::view-transition-old(edge) { display: none; }
::view-transition-new(edge) { animation: none; opacity: 1; }
@keyframes wipe-out {
  from { clip-path: polygon(0 0, calc(100% + 60vh) 0, calc(100% + 60vh) 100%, -50vh 100%); }
  to { clip-path: polygon(calc(100% + 50vh) 0, calc(100% + 60vh) 0, calc(100% + 60vh) 100%, 100% 100%); }
}
@keyframes wipe-in {
  from { clip-path: polygon(-60vh 0, 0 0, -50vh 100%, -60vh 100%); }
  to { clip-path: polygon(-60vh 0, calc(100% + 50vh) 0, 100% 100%, -60vh 100%); }
}
@keyframes wipe-out-rtl {
  from { clip-path: polygon(100% 0, -60vh 0, -60vh 100%, calc(100% + 50vh) 100%); }
  to { clip-path: polygon(-50vh 0, -60vh 0, -60vh 100%, 0 100%); }
}
@keyframes wipe-in-rtl {
  from { clip-path: polygon(calc(100% + 60vh) 0, 100% 0, calc(100% + 50vh) 100%, calc(100% + 60vh) 100%); }
  to { clip-path: polygon(calc(100% + 60vh) 0, -50vh 0, 0 100%, calc(100% + 60vh) 100%); }
}
@keyframes edge {
  0% { transform: translateX(-25vh) skewX(-26.565deg); animation-timing-function: cubic-bezier(.5,0,.75,0); }
  50% { transform: translateX(calc(100vw + 25vh)) skewX(-26.565deg); animation-timing-function: step-end; }
  50.1% { transform: translateX(-25vh) skewX(-26.565deg); animation-timing-function: cubic-bezier(.25,1,.5,1); }
  100% { transform: translateX(calc(100vw + 25vh)) skewX(-26.565deg); }
}
@keyframes edge-rtl {
  0% { transform: translateX(calc(100vw + 25vh)) skewX(26.565deg); animation-timing-function: cubic-bezier(.5,0,.75,0); }
  50% { transform: translateX(-25vh) skewX(26.565deg); animation-timing-function: step-end; }
  50.1% { transform: translateX(calc(100vw + 25vh)) skewX(26.565deg); animation-timing-function: cubic-bezier(.25,1,.5,1); }
  100% { transform: translateX(-25vh) skewX(26.565deg); }
}
/* language: out in the old direction, a short dark beat, in from the other side in the new direction; no edge */
html[dir="ltr"]:active-view-transition-type(language)::view-transition-old(root) { animation: wipe-out-rtl .25s cubic-bezier(.5,0,.75,0) both; }
html[dir="ltr"]:active-view-transition-type(language)::view-transition-new(root) { animation: wipe-in .27s .33s cubic-bezier(.25,1,.5,1) both; }
html[dir="rtl"]:active-view-transition-type(language)::view-transition-old(root) { animation: wipe-out .25s cubic-bezier(.5,0,.75,0) both; }
html[dir="rtl"]:active-view-transition-type(language)::view-transition-new(root) { animation: wipe-in-rtl .27s .33s cubic-bezier(.25,1,.5,1) both; }
html:active-view-transition-type(language)::view-transition-group(edge) { display: none; }
/* an opening plays once per visit, and never on a language switch */
html:is(.settled, .seen) :is(.h1-art, .h1-art *:not(.pass), .h1-copy > *) { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
