/* Layout concept: the PDF's slide world on the web — a deep-blue field with a warm ember glow and faint grid,
   translucent rounded panels, one spark (the flame) in the hero, works shown as the original slides. */
:root {
  --navy-950: #0a1426;
  --navy-900: #0d2346;
  --navy-700: #123e73;
  --blue-500: #1d5d9b;
  --ember: #c07c5c;          /* warm glow from the file's top-left corner */
  --flame: #e0632f;          /* the cover's fire */
  --ink: #f5f1ea;
  --ink-2: rgba(245, 241, 234, .78);
  --muted: rgba(245, 241, 234, .58);
  --line: rgba(255, 255, 255, .12);
  --panel: rgba(255, 255, 255, .06);
  --panel-2: rgba(255, 255, 255, .1);
  --radius: 22px;
  --wrap: 1180px;
  --display: "Noto Naskh Arabic", "IBM Plex Sans Arabic", serif;
  --body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --latin: "Marcellus", Georgia, serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
/* no sideways scrolling anywhere (iOS Safari ignores overflow on <body> alone).
   clip, unlike hidden, doesn't create a scroll container, so the sticky header keeps working. */
html, body { overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
main, .site-footer { overflow-x: clip; }
html, body { max-width: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.85; overflow-x: hidden;
  background-color: var(--navy-950);
}
/* the file's backdrop on its own fixed layer: drawn once, never repainted while scrolling
   (background-attachment: fixed forces a full repaint on every scroll frame, especially on iPhone) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    radial-gradient(1100px 760px at 0% 0%, rgba(192,124,92,.55), transparent 60%),
    linear-gradient(135deg, #1a3f6e 0%, var(--navy-700) 30%, var(--navy-900) 60%, var(--navy-950) 100%);
  background-size: 160px 160px, 160px 160px, 100% 100%, 100% 100%;
  transform: translateZ(0);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
ul, dl { margin: 0; padding: 0; list-style: none; }
bdi { unicode-bidi: isolate; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--ink); color: var(--navy-950); padding: 8px 14px; border-radius: 8px; z-index: 100; text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 760px) { .wrap { padding-left: 36px; padding-right: 36px; } }

.display { font-family: var(--display); font-weight: 700; line-height: 1.25; text-wrap: balance; }
html[lang="en"] .display { font-family: var(--latin); font-weight: 400; letter-spacing: .02em; }
.latin { font-family: var(--latin); letter-spacing: .32em; color: var(--ink-2); text-transform: none; }

/* ===== Header ===== */
/* solid bar (no backdrop blur): the blur forced iPhone to re-blur everything under the bar on every scroll frame */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(11, 25, 48, .96); border-bottom: 1px solid var(--line); transform: translateZ(0); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 600; }
.brand img { width: 44px; height: auto; }
.header-tools { display: flex; align-items: center; gap: 10px; }
.nav { position: relative; }
.nav-list { display: flex; gap: 4px; align-items: center; }
.nav-list a { text-decoration: none; color: var(--ink-2); padding: 8px 14px; border-radius: 999px; font-size: .95rem; }
.nav-list a:hover, .nav-list a[aria-current="true"] { color: var(--ink); background: var(--panel-2); }
.nav-list a.nav-cta { background: var(--ink); color: var(--navy-950); font-weight: 600; }
.nav-toggle { display: none; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; width: 44px; height: 44px; color: var(--ink); cursor: pointer; align-items: center; justify-content: center; }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; padding: 3px; background: var(--panel); }
.lang-switch a { min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; text-decoration: none; font-weight: 600; color: var(--muted); }
.lang-switch a:hover { color: var(--ink); }
.lang-switch a[aria-current="true"] { background: var(--ink); color: var(--navy-950); }
@media (max-width: 820px) {
  .brand { gap: 8px; }
  .brand img { width: 38px; }
  .brand-name { font-size: .95rem; white-space: nowrap; }
  .nav-toggle { display: inline-flex; }
  .nav-list { position: absolute; inset-inline-end: 0; top: 54px; flex-direction: column; align-items: stretch; min-width: 210px; padding: 8px; background: rgba(13, 35, 70, .96); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 40px rgba(0,0,0,.35); display: none; }
  .nav-list.open { display: flex; }
  .nav-list a { padding: 12px 14px; border-radius: 10px; }
}

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 26px; border-radius: 999px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: transform .2s, background-color .2s, border-color .2s; }
.btn:active { transform: translateY(1px); }
.btn-solid { background: var(--ink); color: var(--navy-950); }
.btn-solid:hover { background: #fff; }
.btn-glass { background: var(--panel); border-color: rgba(255,255,255,.25); color: var(--ink); }
.btn-glass:hover { background: var(--panel-2); border-color: rgba(255,255,255,.45); }

/* ===== Hero: the spark that becomes a flame ===== */
/* the opening fills exactly one screen (below the 68px header); sizes follow the screen height so it always fits */
.hero {
  position: relative; overflow: hidden; text-align: center;
  min-height: calc(100vh - 68px); min-height: calc(100svh - 68px);
  display: flex; align-items: center; padding-block: clamp(20px, 4vh, 48px);
}
.hero-inner { position: relative; z-index: 1; display: grid; justify-items: center; gap: clamp(14px, 3vh, 28px); }
.hero h1 { display: grid; gap: clamp(0px, 1vh, 6px); }
.hero h1 .display { font-size: clamp(2.8rem, min(11vw, 13vh), 7.6rem); }
.hero h1 .latin { font-size: clamp(1rem, min(3.4vw, 4vh), 2.6rem); font-weight: 400; }
.intro { max-width: 62ch; display: grid; gap: clamp(8px, 1.6vh, 14px); color: var(--ink-2); font-size: clamp(.95rem, min(2.2vw, 2.3vh), 1.15rem); }
@media (max-height: 640px) and (min-width: 700px) { .intro p:nth-child(2) { font-size: .92em; } }
.intro p:first-child, .intro p:last-child { color: var(--ink); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 8px; }
.flame { position: absolute; inset: auto 0 0 0; height: 70%; pointer-events: none; display: grid; place-items: center;
  -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 38%); mask-image: linear-gradient(to top, transparent 0%, #000 38%); }
.flame span { position: absolute; bottom: 0; border-radius: 50% 50% 45% 45%; will-change: transform, opacity; }
.flame span:nth-child(1) { width: 300px; height: 460px; background: radial-gradient(closest-side, rgba(224,99,47,.55), transparent); animation: flicker 5s ease-in-out infinite; }
.flame span:nth-child(2) { width: 180px; height: 320px; background: radial-gradient(closest-side, rgba(255,170,90,.45), transparent); animation: flicker 3.6s ease-in-out infinite reverse; }
.flame span:nth-child(3) { width: 560px; height: 300px; background: radial-gradient(closest-side, rgba(192,124,92,.28), transparent); }
@keyframes flicker { 0%,100% { transform: translateY(0) scale(1); opacity: .9; } 35% { transform: translateY(-14px) scale(1.04, 1.08); opacity: 1; } 70% { transform: translateY(6px) scale(.97, .95); opacity: .8; } }
@media (prefers-reduced-motion: reduce) { .flame span { animation: none; } }

/* ===== Sections ===== */
.section { padding-block: 80px; scroll-margin-top: 60px; }
@media (min-width: 900px) { .section { padding-block: 110px; } }
.sec-head { display: grid; gap: 4px; margin-bottom: 40px; }
.sec-head .display { font-size: clamp(2.3rem, 6vw, 4rem); }
.sec-head .latin { font-size: clamp(.95rem, 2vw, 1.35rem); }
.sec-head.center { text-align: center; justify-items: center; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; min-width: 0; }
.panel h3 { font-family: var(--display); font-weight: 700; font-size: 1.55rem; margin-bottom: 14px; }
html[lang="en"] .panel h3 { font-family: var(--latin); font-weight: 400; font-size: 1.45rem; }

/* About */
.about-grid { display: grid; gap: 16px; }
.profile { display: flex; gap: 22px; align-items: flex-start; }
.profile-text { min-width: 0; }
.profile p { color: var(--ink-2); font-size: 1.08rem; }
.portrait { margin: 0; flex: 0 0 auto; width: 132px; }
.portrait img { width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 14px 30px rgba(0,0,0,.3); }
@media (max-width: 560px) { .profile { flex-direction: column; } .portrait { width: 112px; } }
.contact-card dl { display: grid; gap: 10px; }
.contact-card dl div { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.contact-card dt { color: var(--muted); font-size: .92rem; }
.contact-card dt::after { content: ":"; }
.contact-card dd { margin: 0; overflow-wrap: anywhere; }
.contact-card a { text-decoration: none; }
.contact-card a:hover { text-decoration: underline; text-underline-offset: 4px; }
.dots { display: grid; gap: 8px; }
.dots li { position: relative; padding-inline-start: 20px; color: var(--ink-2); }
.dots li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .8em; width: 6px; height: 6px; border-radius: 50%; background: var(--ember); }
.tools { display: flex; flex-wrap: wrap; gap: 8px; }
.tools li { direction: ltr; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: .95rem; }
@media (min-width: 900px) {
  .about-grid { grid-template-columns: 1.6fr 1fr; }
  .about-grid .profile { grid-column: 1; }
  .about-grid .contact-card { grid-column: 2; }
  .about-grid > :nth-child(n+3) { grid-column: auto; }
  .about-grid { grid-template-columns: repeat(6, 1fr); }
  .about-grid .profile { grid-column: span 4; }
  .about-grid .contact-card { grid-column: span 2; }
  .about-grid > :nth-child(3), .about-grid > :nth-child(4), .about-grid > :nth-child(5) { grid-column: span 2; }
}

/* Works */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.filter { font: inherit; cursor: pointer; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); }
.filter:hover { color: var(--ink); border-color: rgba(255,255,255,.3); }
.filter[aria-selected="true"] { background: var(--ink); color: var(--navy-950); border-color: var(--ink); font-weight: 600; }
.filter .count { font-size: .8rem; opacity: .7; margin-inline-start: 6px; font-variant-numeric: tabular-nums; }
.cat-latin { font-size: .95rem; min-height: 1.8em; margin-bottom: 22px; }
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .grid { grid-template-columns: repeat(3, 1fr); } }
/* every card has the same frame; the design sits whole inside it */
.card { position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--line);
  background: radial-gradient(120% 90% at 50% 0%, rgba(255,255,255,.09), rgba(255,255,255,.03)); }
.card button { all: unset; display: block; width: 100%; cursor: zoom-in; }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; padding: 10px; transition: transform .5s ease; }
#grid-identity .card img { aspect-ratio: 16 / 9; padding: 8px; }
.card:hover img { transform: scale(1.03); }
.card .tag { position: absolute; inset-block-end: 10px; inset-inline-start: 10px; padding: 3px 12px; border-radius: 999px; font-size: .8rem; background: rgba(10,20,38,.7); border: 1px solid var(--line); backdrop-filter: blur(6px); }
.card button:focus-visible { outline: 2px solid var(--ember); outline-offset: -4px; border-radius: 18px; }
.card[hidden] { display: none; }

/* Motion */
.motion { margin-top: 56px; display: grid; gap: 22px; justify-items: center; text-align: center; }
.motion[hidden] { display: none; }
.motion-head { display: grid; gap: 2px; }
.motion-head .display { font-size: clamp(1.8rem, 4.5vw, 2.8rem); }
.motion-videos { width: 100%; display: grid; gap: 16px; }
/* the three clips: one shared height on wide screens, stacked on phones */
.motion-videos.has-videos { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.clip { margin: 0; width: 100%; min-width: 0; }
.motion-videos .clip video { width: 100%; height: auto; aspect-ratio: var(--ar, 16 / 9); object-fit: cover; display: block; }
.clip.tall { max-width: 320px; }
@media (min-width: 760px) {
  .motion-videos.has-videos { flex-direction: row; align-items: flex-start; }
  .clip { flex-basis: 0; width: auto; }
  .clip.tall { max-width: none; }
}
.motion-preview { max-width: 980px; margin-inline: auto; width: 100%; }
.motion-preview img { aspect-ratio: auto; padding: 0; }
.motion-actions { display: flex; justify-content: center; margin-top: 26px; }
.motion-actions:has(> [hidden]:only-child) { display: none; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
.footer-wa { color: var(--ink); font-weight: 600; }
.footer-wa:hover { text-decoration: underline; text-underline-offset: 4px; }
.motion-videos video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 18px; border: 1px solid var(--line); background: #000; }
.motion-videos video:fullscreen { object-fit: contain; border-radius: 0; }
.motion-preview { width: 100%; border-radius: 18px; border: 1px solid var(--line); overflow: hidden; }
.motion-note { color: var(--muted); font-size: .95rem; }

/* Partners: logo rows drifting in opposite directions */
.partners { overflow: hidden; display: grid; gap: 18px; padding-block: 34px; margin-inline: auto; max-width: 1380px; border-block: 1px solid var(--line); background: rgba(255,255,255,.04); }
.p-row { overflow: hidden; direction: ltr; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.p-strip { height: 80px; background-repeat: repeat-x; background-position: 0 0; background-size: auto 100%; }
@media (max-width: 640px) { .p-strip { height: 46px; } }
@keyframes drift { from { transform: translate3d(0,0,0); } to { transform: translate3d(-50%,0,0); } }
@keyframes drift-rev { from { transform: translate3d(-50%,0,0); } to { transform: translate3d(0,0,0); } }
@media (prefers-reduced-motion: reduce) {

}

/* Contact */
.contact-links { display: grid; gap: 14px; max-width: 900px; margin-inline: auto; }
@media (min-width: 760px) { .contact-links { grid-template-columns: repeat(3, 1fr); } }
.c-link { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); text-decoration: none; transition: background-color .2s, border-color .2s; min-width: 0; }
.c-link:hover { background: var(--panel-2); border-color: rgba(255,255,255,.3); }
.c-link span { color: var(--muted); font-size: .92rem; }
.c-link bdi { font-weight: 600; font-size: 1.1rem; overflow-wrap: anywhere; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 20px; padding-block: 24px; }
.footer-inner > span { display: inline-flex; align-items: center; gap: 8px; }
.footer-inner a { color: var(--ink-2); text-decoration: none; }

/* Lightbox */
.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(6, 12, 24, .94); color: var(--ink); }
.lightbox::backdrop { background: rgba(6, 12, 24, .7); }
.lightbox[open] { display: grid; grid-template-rows: auto 1fr; }
.lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px max(16px, env(safe-area-inset-left, 0px)) 6px; }
.lb-caption { color: var(--ink-2); font-size: .95rem; }
.lb-stage { position: relative; display: grid; place-items: center; padding: 8px 64px 24px; min-height: 0; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 110px); width: auto; height: auto; border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.5); user-select: none; }
.lb-btn { background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.lb-btn:hover { background: rgba(255,255,255,.2); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { inset-inline-start: 12px; }
.lb-next { inset-inline-end: 12px; }
html[dir="rtl"] .lb-nav svg { transform: scaleX(-1); }
@media (max-width: 640px) { .lb-stage { padding: 8px 8px 72px; } .lb-nav { top: auto; bottom: 14px; transform: none; } }

/* ===== Scroll reveal: each element appears as it reaches the screen =====
   Hidden states apply only when JS adds .js-motion, so the page stays readable without JS. */
:root { --ease: cubic-bezier(.2, .75, .2, 1); }
.js-motion [data-reveal] {
  opacity: 0;
  transition: opacity .55s var(--ease), transform .6s var(--ease);
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}
.js-motion [data-reveal="up"]    { transform: translateY(26px); }
.js-motion [data-reveal="blur"]  { transform: translateY(22px) scale(.97); }
.js-motion [data-reveal="zoom"]  { transform: translateY(20px) scale(.95); }
.js-motion [data-reveal="start"] { transform: none; }
.js-motion [data-reveal="end"]   { transform: none; }
.js-motion [data-reveal="track"] { transform: translateY(12px); }
html[dir="rtl"] { --from-start: 70px; --from-end: -70px; }
html[dir="ltr"] { --from-start: -70px; --from-end: 70px; }
.js-motion [data-reveal].in { opacity: 1; transform: none; filter: none; }

/* section title underline that draws in */
.sec-head .display { position: relative; }
.js-motion .sec-head .display::after { content: ""; display: block; height: 2px; width: 0; margin-top: 10px; background: linear-gradient(90deg, var(--ember), transparent); transition: width .7s var(--ease) .15s; }
.sec-head.center .display::after { margin-inline: auto; }
.js-motion .sec-head .display.in::after { width: min(220px, 60%); }
/* hero flame rises after the title */
.js-motion .flame { opacity: 0; transform: translateY(80px); transition: opacity 1.6s ease .5s, transform 1.8s var(--ease) .5s; }
.js-motion.loaded .flame { opacity: 1; transform: none; }
/* scroll progress line */
.progress { position: fixed; top: 0; inset-inline-start: 0; height: 3px; width: 100%; transform-origin: var(--origin, right); transform: scaleX(0); background: linear-gradient(90deg, var(--flame), var(--ember)); z-index: 60; pointer-events: none; }
html[dir="ltr"] .progress { --origin: left; }
@media (prefers-reduced-motion: reduce) {
  .js-motion [data-reveal], .js-motion .flame { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }

  .progress { display: none; }
}
