/* Iraq: The Story — first page + film hand-off
   Tokens follow content/design-system.md (Night library). */
:root {
  --night-950: #06080F;
  --night: #0A0E1A;
  --night-800: #121A2E;
  --deep-blue: #1C2A4A;
  --brass: #C8963E;
  --brass-light: #E0B866;
  --brass-dim: rgba(200, 150, 62, .25);
  --ivory: #E8D9B5;
  --text-primary: #F1E8D2;
  --text-secondary: #B8AE96;
  --text-muted: #8A8372;
  --moon: #6B8FB8;

  --font-display: Cinzel, Georgia, serif;
  --font-body: Inter, system-ui, -apple-system, sans-serif;
  --font-ar: Amiri, "Times New Roman", serif;
  /* Small Arabic UI text (scroll cue, kicker). Ghroob is not a web font: it shows where it is
     installed; everyone else gets Amiri until a licensed webfont file is added. */
  --font-ui-ar: "itf Ghroob Arabic", Amiri, "Times New Roman", serif;

  --gutter: 24px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}
@media (min-width: 768px) { :root { --gutter: 40px; } }
@media (min-width: 1200px) { :root { --gutter: 64px; } }
@media (min-width: 1024px) { :root { --pad-x: clamp(40px, 6.25vw, 80px); } }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--night); }
body {
  background: var(--night);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { font-family: var(--font-ar); }

/* ---------- Fixed layers ---------- */
.stage, .sky, .intro, .chapter { position: fixed; inset: 0; }

.stage { z-index: 0; opacity: 0; background: var(--night); }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#filmBg { filter: blur(36px) brightness(.62) saturate(1.2); transform: scale(1.15); }
/* Soft shadow where the film column meets the blurred sides */
.film-column .stage::after {
  content: ""; position: absolute; top: 0; bottom: 0;
  left: var(--col-x); width: var(--col-w);
  box-shadow: 0 0 90px 30px rgba(6, 8, 15, .55), inset 0 0 0 1px rgba(200, 150, 62, .08);
  pointer-events: none;
}
.fade-top {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(10,14,26,.85) 0%, rgba(10,14,26,.55) 28%, rgba(10,14,26,0) 55%);
}
.fade-bottom {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,14,26,.6) 0%, rgba(10,14,26,0) 22%);
}
/* Text over the film: the whole story is on screen at once, so the shade reaches further down */
html:not(.text-beside) .fade-top { background: linear-gradient(to bottom, rgba(10,14,26,.88) 0%, rgba(10,14,26,.72) 38%, rgba(10,14,26,.35) 62%, rgba(10,14,26,0) 80%); }
/* Wide screens: text lives beside the film column, so the top fade can be lighter */
.text-beside .fade-top { background: linear-gradient(to bottom, rgba(10,14,26,.55) 0%, rgba(10,14,26,0) 35%); }

.sky { z-index: 1; pointer-events: none; }
#skyCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* The map of Iraq behind the title */
.map {
  position: absolute; left: 50%; top: 50%;
  width: min(84vw, 66vh); height: min(84vw, 66vh);
  overflow: visible;
  opacity: .4;
  will-change: transform;
}
.map path, .map use { vector-effect: non-scaling-stroke; }
.border {
  fill: rgba(28, 42, 74, 0); stroke: var(--brass); stroke-width: 1.2; stroke-opacity: .45;
  stroke-linejoin: round;
  transition: fill 2.4s var(--ease-out);
}
.map.flowing .border { fill: rgba(28, 42, 74, .28); }
.river, .flow { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.river { stroke: var(--moon); stroke-width: 2; opacity: .75; }
.flow {
  stroke: #bcd6f2; stroke-width: 2.4; opacity: 0;
  stroke-dasharray: 10 38;
  animation: flow 4.5s linear infinite;
}
.flow-2 { animation-duration: 5.5s; }
.flow-3 { animation-duration: 3.5s; }
.map.flowing .flow { opacity: .85; transition: opacity 2s; }
@keyframes flow { to { stroke-dashoffset: -480; } }
.river-label {
  font: 500 12px/1 var(--font-body); letter-spacing: .28em; text-transform: uppercase;
  fill: var(--moon); opacity: 0; transition: opacity 1.6s;
}
html[lang="ar"] .river-label { font: 400 17px/1 var(--font-ar); letter-spacing: 0; }
.map.flowing .river-label { opacity: .8; }

.city { opacity: 0; }
.city-dot { fill: var(--brass-light); }
.city-baghdad .city-dot { fill: var(--ivory); opacity: .7; }
.city-pulse { fill: none; stroke: var(--brass); stroke-width: 1; transform-origin: 0 0; animation: pulse 2.6s var(--ease-out) infinite; }
@keyframes pulse { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(2.2); opacity: 0; } }
.city-label {
  font: 600 12px/1 var(--font-body); letter-spacing: .2em; text-transform: uppercase;
  fill: var(--brass-light); opacity: 0; transition: opacity .8s var(--ease-out);
}
.city-baghdad .city-label { fill: var(--text-secondary); }
html[lang="ar"] .city-label { font: 700 16px/1 var(--font-ar); letter-spacing: 0; }
.map.labels .city-label { opacity: .9; }

/* ---------- Top bar (Figma: Al-Qaseh › Main Navbar); mirrors in Arabic ----------
   Phones: one row, star · globe · menu. 1024px and up: utility row (shortcuts + globe), a thin
   rule, then the brand, the Prologue / Chapters menus and Contact Us. An open menu turns the
   bar solid and drops a full-width panel under it. */
.topbar {
  position: fixed; z-index: 10; top: 0; left: 0; right: 0;
  display: grid; align-items: center;
  grid-template-columns: auto 1fr auto auto;
  grid-template-areas: "home . lang menu";
  column-gap: 10px;
  height: 36px; box-sizing: content-box;
  padding: max(8px, env(safe-area-inset-top)) var(--gutter) 0;
  pointer-events: none;
}
.topbar a, .topbar button { pointer-events: auto; }
.topbar-actions { display: contents; }
.home { grid-area: home; }
.lang { grid-area: lang; }
.menu-btn { grid-area: menu; margin-inline-end: -8px; }
.toplinks, .topbar-rule, .topnav, .btn-cta, .brand { display: none; }
.lang, .home, .menu-btn {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  background: none; border: 0; border-radius: 50%;
  color: var(--ivory);
  cursor: pointer;
  transition: background .3s, transform .4s var(--ease-out);
}
.home { margin-inline-start: -8px; text-decoration: none; }
.lang img { width: 20px; height: 20px; display: block; transition: transform .6s var(--ease-out); }
.lang:hover, .home:hover, .menu-btn:hover { background: rgba(28, 42, 74, .55); }
.lang:hover img { transform: rotate(-25deg); }
.topbar a:focus-visible, .topbar button:focus-visible { outline: 2px solid var(--brass-light); outline-offset: 2px; }

@media (min-width: 1024px) {
  .topbar {
    height: auto;
    grid-template-columns: auto auto 1fr auto auto;
    grid-template-areas:
      "links links links links lang"
      "rule rule rule rule rule"
      "home nav . cta cta";
    column-gap: 24px; row-gap: 0;
    padding: max(24px, env(safe-area-inset-top)) var(--pad-x) 24px;
    transition: background .3s;
  }
  .menu-open .topbar { background: var(--night-800); }
  .menu-btn { display: none; }
  .toplinks { grid-area: links; display: flex; align-items: center; justify-content: flex-end; gap: 24px; padding-inline-start: 12px; }
  .lang { width: 20px; height: 20px; margin-inline-end: 12px; border-radius: 4px; }
  .lang:hover { background: none; }
  .toplink {
    display: flex; align-items: center; gap: 2px;
    color: var(--text-primary); text-decoration: none; white-space: nowrap;
    font: 500 16px/22px var(--font-body);
    transition: color .3s;
  }
  .toplink:hover { color: var(--brass-light); }
  .toplink .ico-up { --icon: url(images/ui/nav/arrow-right-up.svg); width: 16px; height: 16px; }
  html[dir="rtl"] .ico-up { transform: scaleX(-1); }
  .topbar-rule {
    grid-area: rule; display: block; align-self: start;
    height: 0; margin-top: 8px; border-top: .5px solid var(--brass-dim);
  }
  .home, .topnav, .btn-cta { margin-top: 12px; }
  .home {
    width: auto; height: 40px; gap: 12px;
    display: flex; margin-inline-start: 0; margin-inline-end: 32px;
    border-radius: 8px;
  }
  .home:hover { background: none; }
  .brand {
    display: block; color: var(--ivory);
    font: 700 15px/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase;
  }
  .topnav { grid-area: nav; display: flex; align-items: center; gap: 24px; align-self: stretch; }
  .topnav-btn {
    display: flex; align-items: center; gap: 2px; height: 100%;
    background: none; border: 0; padding: 0; cursor: pointer;
    color: var(--text-primary); font: 500 16px/22px var(--font-body);
    transition: color .3s;
  }
  .topnav-btn .ico-chev { width: 16px; height: 16px; transition: transform .45s var(--ease-out); }
  .topnav-btn:hover, .topnav-btn[aria-expanded="true"] { color: var(--brass-light); }
  .topnav-btn[aria-expanded="true"] .ico-chev { transform: rotate(180deg); }
  .btn-cta {
    grid-area: cta; justify-self: end; display: flex; align-items: center; justify-content: center;
    padding: 12px 24px; border-radius: 12px;
    background: var(--brass); color: var(--night-950);
    font: 600 16px/22px var(--font-body); text-decoration: none;
    transition: background .3s, border-radius .3s, transform .3s var(--ease-out);
  }
  .menu-open .btn-cta { border-radius: 16px; }
  .btn-cta:hover { background: var(--brass-light); }
  .btn-cta:active { transform: scale(.98); }

  html[lang="ar"] .toplink { font: 500 16px/22px var(--font-ui-ar); }
  html[lang="ar"] .brand { font: 700 20px/1 var(--font-ar); letter-spacing: 0; text-transform: none; }
  html[lang="ar"] .topnav-btn { font: 700 18px/26px var(--font-ar); }
  html[lang="ar"] .btn-cta { font: 700 18px/26px var(--font-ar); }

  html .kicker { top: calc(var(--nav-h, 136px) + 24px); }
  html[dir] .chapter { padding-top: calc(var(--nav-h, 136px) + clamp(56px, 8vh, 88px)); }
}

/* Line icons from Figma, drawn in the current text colour */
.ico {
  display: block; flex: none; width: 24px; height: 24px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}
.ico-menu { --icon: url(images/ui/menu/hamburger.svg); }
.ico-close { --icon: url(images/ui/menu/close.svg); width: 28px; height: 28px; }
.ico-chev { --icon: url(images/ui/menu/chevron-down.svg); }
.ico-arrow { --icon: url(images/ui/menu/arrow-left.svg); width: 16px; height: 16px; }
.menu-btn .ico { grid-area: 1 / 1; transition: opacity .3s, transform .5s var(--ease-out); }
.menu-btn .ico-close { opacity: 0; transform: rotate(-90deg) scale(.6); }
.menu-open .menu-btn .ico-menu { opacity: 0; transform: rotate(90deg) scale(.6); }
.menu-open .menu-btn .ico-close { opacity: 1; transform: none; }

.emblem { width: 28px; height: 28px; overflow: visible; display: block; }
.emblem-ring { fill: none; stroke: var(--brass); stroke-width: .56; }
.emblem-star { fill: none; stroke: var(--brass); stroke-width: .896; stroke-linejoin: round; }
.emblem-core { fill: var(--brass); }

/* ---------- Chapters menu (Figma: Mobile Navbar) ---------- */
/* Phone: covers the screen under a solid bar. Tablet: a drawer on the menu's side.
   1024px and up: a dropdown under the bar (Figma: Main Navbar, Solution / Company). */
html.menu-open { overflow: hidden; }
.menu-open .topbar { opacity: 1 !important; }
.menu-scrim {
  position: fixed; inset: 0; z-index: 8;
  background: rgba(6, 8, 15, .6);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; transition: opacity .4s, visibility 0s .4s;
}
.menu {
  --bar-h: calc(max(8px, env(safe-area-inset-top)) + 48px);
  position: fixed; z-index: 9; top: 0; bottom: 0; inset-inline-end: 0;
  width: 100%;
  display: flex; flex-direction: column;
  padding-top: var(--bar-h);
  background: linear-gradient(var(--night-800), var(--night-800)) top / 100% var(--bar-h) no-repeat, var(--night);
  opacity: 0; visibility: hidden; transform: translateY(-12px);
  transition: opacity .35s var(--ease-out), transform .5s var(--ease-out), visibility 0s .5s;
}
.menu::before {
  content: ""; position: absolute; top: calc(var(--bar-h) - 1px); left: 0; right: 0; height: 1px;
  background: rgba(200, 150, 62, .18);
}
.menu-open .menu, .menu-open .menu-scrim { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
@media (min-width: 768px) {
  .menu { width: 420px; transform: translateX(24px); box-shadow: 0 0 80px rgba(0, 0, 0, .5); }
  html[dir="rtl"] .menu { transform: translateX(-24px); }
  html.menu-open .menu { transform: none; }
}

.menu-body {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px;
}
.menu-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 16px 12px 16px 16px;
  background: none; border: 0; border-bottom: 1px solid rgba(200, 150, 62, .14);
  color: var(--ivory); font: 500 16px/22px var(--font-body); text-align: start; text-decoration: none;
  cursor: pointer;
}
html[dir="rtl"] .menu-head { padding: 16px 16px 16px 12px; }
.menu-head .ico-chev { color: var(--text-muted); transition: transform .45s var(--ease-out), color .3s; }
.menu-head:hover .ico-chev { color: var(--brass-light); }
.menu-group.open .menu-head { border-bottom-color: transparent; }
.menu-group.open .ico-chev { transform: rotate(180deg); }

/* Folding list: animates its height from 0 to its content */
.menu-fold { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease-out); }
.menu-fold > * { min-height: 0; overflow: hidden; }
.menu-group.open .menu-fold { grid-template-rows: 1fr; }
.menu-group.open { padding-bottom: 8px; border-bottom: 1px solid rgba(200, 150, 62, .14); }
.menu-list { list-style: none; }

.menu-row {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; border-bottom: .5px solid rgba(200, 150, 62, .12);
  color: var(--text-primary); text-decoration: none;
  transition: background .3s;
}
.menu-row:hover { background: rgba(28, 42, 74, .35); }
.menu-thumb {
  flex: none; width: 44px; height: 44px; border-radius: 8px; object-fit: cover;
  background: var(--deep-blue); box-shadow: inset 0 0 0 1px rgba(200, 150, 62, .2);
  outline: 1px solid rgba(200, 150, 62, .2); outline-offset: -1px;
}
.menu-text { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.menu-title { font: 500 14px/20px var(--font-body); letter-spacing: .1px; }
.menu-hook { display: none; }
.menu-tag {
  padding: 4px 12px; border-radius: 8px;
  background: rgba(28, 42, 74, .7); color: var(--brass-light);
  font: 400 12px/16px var(--font-body);
}
.menu-row[aria-current] .menu-title { color: var(--brass-light); }
.menu-row[aria-current] .menu-thumb { outline: 1.5px solid var(--brass); }

.menu-more {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 16px; color: var(--brass-light); text-decoration: none;
  font: 500 16px/22px var(--font-body);
}
.menu-more .ico-arrow { transform: scaleX(-1); }
html[dir="rtl"] .menu-more .ico-arrow { transform: none; }
.menu-more:hover span { text-decoration: underline; text-underline-offset: 4px; }

.menu-cta { padding: 12px 16px max(24px, env(safe-area-inset-bottom)); }
.btn-contact {
  display: flex; align-items: center; justify-content: center;
  height: 56px; padding: 16px 24px; border-radius: 16px;
  background: var(--brass); color: var(--night-950);
  font: 600 16px/22px var(--font-body); text-decoration: none;
  transition: background .3s, transform .3s var(--ease-out);
}
.btn-contact:hover { background: var(--brass-light); }
.btn-contact:active { transform: scale(.98); }
.menu a:focus-visible, .menu button:focus-visible { outline: 2px solid var(--brass-light); outline-offset: -2px; }

html[lang="ar"] .menu-head, html[lang="ar"] .menu-more { font: 700 18px/26px var(--font-ar); }
html[lang="ar"] .menu-title { font: 700 16px/24px var(--font-ar); letter-spacing: 0; }
html[lang="ar"] .menu-tag { font: 400 13px/18px var(--font-ui-ar); }
html[lang="ar"] .btn-contact { font: 700 18px/26px var(--font-ar); }

/* The dropdown shows the open group only; the bar above stays live so its buttons can toggle it */
@media (min-width: 1024px) {
  html { scrollbar-gutter: stable; } /* Locking the page must not nudge the bar sideways */
  .menu-scrim { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  html[dir] .menu {
    top: var(--nav-h, 136px); bottom: auto; inset-inline: 0; width: auto;
    max-height: calc(100dvh - var(--nav-h, 136px));
    padding-top: 0;
    background: var(--night);
    box-shadow: 0 10px 10px -5px rgba(0, 0, 0, .2), 0 20px 25px -5px rgba(0, 0, 0, .45);
    transform: translateY(-12px);
  }
  html[dir].menu-open .menu { transform: none; }
  .menu::before, .menu-cta, .menu-body > .menu-head, .menu-group > .menu-head, .menu-group:not(.open) { display: none; }
  .menu-body { padding: 16px var(--pad-x); gap: 0; }
  .menu-group.open { padding-bottom: 0; border-bottom: 0; }
  .menu-fold { display: block; }
  /* Fills column by column; 1fr rows make every card as tall as the tallest */
  .menu-list {
    --rows: 2;
    display: grid; grid-auto-flow: column; column-gap: 56px; width: min(958px, 100%);
    grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(var(--rows), 1fr);
  }
  #menuChapters .menu-list { --rows: 5; }
  .menu-list li { display: flex; }
  .menu-row { flex: 1; gap: 8px; border-bottom-width: 1px; }
  .menu-row[data-go="8"] { border-bottom: 0; }
  .menu-text { flex: 1; display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; row-gap: 4px; }
  .menu-title { font: 500 16px/22px var(--font-body); letter-spacing: 0; }
  .menu-hook {
    display: block; grid-column: 1 / -1;
    color: var(--text-secondary); font: 400 14px/20px var(--font-body); letter-spacing: .25px;
  }
  .menu-more { margin-top: 10px; padding: 12px 0 0; border-top: 1px solid rgba(200, 150, 62, .14); }

  html[lang="ar"] .menu-hook { font: 400 15px/22px var(--font-ui-ar); letter-spacing: 0; }
}

/* ---------- Intro ---------- */
.intro {
  z-index: 3;
  display: grid; place-items: center;
  padding: 160px var(--gutter);
  pointer-events: none;
}
.intro a, .intro button { pointer-events: auto; }
.intro-inner {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  max-width: 980px;
  will-change: transform, opacity, filter;
}

/* The kicker sits on its own near the top, under the bar */
.kicker {
  position: absolute; left: 0; right: 0;
  top: calc(max(8px, env(safe-area-inset-top)) + 88px);
  text-align: center;
  font: 600 12px/16px var(--font-body);
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--brass);
}
.count { font-variant-numeric: tabular-nums; display: inline-block; min-width: 4.2ch; text-align: end; }
html[lang="ar"] .kicker { font: 500 14px/20px var(--font-ui-ar); letter-spacing: 0; text-transform: none; }
html[lang="ar"] .count { min-width: 3.4ch; }

.display {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(36px, 6.4vw, 76px);
  line-height: 1.14;
  letter-spacing: .02em;
  color: var(--ivory);
}
/* Phones: tight 36/38 leading, as in Figma */
@media (max-width: 767px) { html[lang="en"] .display { line-height: 38px; } }
html[lang="ar"] .display {
  font-family: var(--font-ar);
  font-size: clamp(40px, 7vw, 84px);
  line-height: 1.44;
  letter-spacing: 0;
}
@media (max-width: 767px) { html[lang="ar"] .display { line-height: 56px; } }

/* Word-by-word reveal */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .04em .12em; margin: 0 -.04em -.12em; }
html[lang="ar"] .w { padding-top: .1em; margin-top: -.1em; }
.wi { display: inline-block; will-change: transform; }

/* The highlighted word ("place" / «مكان») glows like lamplight */
.glow {
  background: linear-gradient(100deg, var(--brass-light) 0%, var(--brass-light) 38%, #f3dca2 47%, #fbefcd 50%, #f3dca2 53%, var(--brass-light) 62%, var(--brass-light) 100%);
  background-size: 300% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 7s var(--ease-out) 3.2s infinite;
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  45%, 100% { background-position: 0% 0; }
}

.sub {
  margin-top: 16px;
  font: 500 clamp(20px, 2vw, 26px)/1.46 var(--font-body);
  color: var(--text-secondary);
  max-width: 320px;
}
@media (max-width: 767px) { html[lang="en"] .sub { line-height: 28px; } }
@media (min-width: 768px) { .sub { max-width: 34ch; } }
html[lang="ar"] .sub { font: 700 clamp(22px, 2.3vw, 28px)/1.72 var(--font-ar); margin-top: 12px; }
@media (max-width: 767px) { html[lang="ar"] .sub { max-width: none; } }
.rule {
  display: block; width: 48px; height: 1px; margin-top: 16px;
  background: var(--brass); transform-origin: center;
}
html[lang="ar"] .rule { width: 80px; }

/* Scroll cue: a word, then a thin track with a brass bar that keeps sliding down */
.cue {
  position: absolute; left: 50%;
  bottom: calc(var(--partners-h) + env(safe-area-inset-bottom) + 32px);
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.cue-text { font: 500 16px/22px var(--font-ui-ar); color: var(--brass); white-space: nowrap; }
.cue-track {
  position: relative; width: 4px; height: 38px; overflow: hidden;
  background: var(--deep-blue);
}
.cue-track i {
  position: absolute; left: 0; top: 0; width: 4px; height: 20px;
  background: var(--brass);
  animation: track 1.8s var(--ease-out) infinite;
}
@keyframes track {
  0% { transform: translateY(-20px); }
  60%, 100% { transform: translateY(38px); }
}

/* Bottom strip of logos */
:root { --partners-h: 72px; }
.partners {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: calc(var(--partners-h) + env(safe-area-inset-bottom));
  padding: 0 48px env(safe-area-inset-bottom);
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(242, 252, 250, .05);
}
.partners img { display: block; height: auto; opacity: .95; }
@media (min-width: 768px) {
  .partners { justify-content: center; gap: 72px; }
}

/* ---------- Chapter text over the film ---------- */
.chapter {
  z-index: 2;
  padding: 96px var(--gutter) 0;
  pointer-events: none;
  display: flex; flex-direction: column; align-items: flex-start;
}
/* Text over the film column (phones, and desktops too narrow for a side column) */
.film-column .chapter { left: var(--col-x); right: auto; width: var(--col-w); padding-top: 88px; }
/* Text beside the film column */
.text-beside .chapter { left: 0; width: var(--side-w); padding-top: 120px; }
html.text-beside[dir="rtl"] .chapter { left: auto; right: 0; }
html[dir="rtl"] .chapter { text-align: right; }

.ch-kicker {
  font: 600 12px/16px var(--font-body); letter-spacing: .16em; text-transform: uppercase;
  color: var(--brass); margin-bottom: 12px;
}
.ch-title {
  font: 700 clamp(32px, 4.2vw, 56px)/1.18 var(--font-display);
  letter-spacing: .02em; color: var(--ivory); margin-bottom: 16px;
}
.ch-hook { font: 500 clamp(20px, 1.9vw, 26px)/1.46 var(--font-body); color: var(--text-primary); margin-bottom: 24px; }
@media (max-width: 767px) { html[lang="en"] .ch-hook { line-height: 28px; } }
.ch-story { font: 400 clamp(17px, 1.4vw, 20px)/1.6 var(--font-body); color: var(--text-primary); margin-bottom: 12px; max-width: 34ch; }
.chapter .beat { text-shadow: 0 1px 16px rgba(10,14,26,.6); }
/* A side fact, set apart from the story by a brass rule */
.ch-whisper {
  font: 400 14px/1.6 var(--font-body); color: var(--text-secondary); max-width: 34ch;
  margin-top: 12px; padding-inline-start: 12px; border-inline-start: 1px solid var(--brass);
}
html:not(.text-beside) .chapter .ch-whisper { grid-row: 5; grid-column: 2; }
html[lang="ar"] .ch-whisper { font: 400 clamp(16px, 1.3vw, 18px)/1.8 var(--font-ar); }

html[lang="ar"] .ch-kicker { font: 700 clamp(14px, 1.1vw, 16px)/1.6 var(--font-ar); letter-spacing: 0; text-transform: none; }
html[lang="ar"] .ch-title { font: 700 clamp(36px, 4.6vw, 60px)/1.5 var(--font-ar); letter-spacing: 0; margin-bottom: 8px; }
html[lang="ar"] .ch-hook { font: 700 clamp(22px, 2.1vw, 28px)/1.72 var(--font-ar); }
html[lang="ar"] .ch-story { font: 400 clamp(20px, 1.7vw, 24px)/1.8 var(--font-ar); }

.beat {
  opacity: 0;
  transform: translateY(16px);
  filter: blur(6px);
  transition: opacity .7s var(--ease-out), transform .9s var(--ease-out), filter .7s var(--ease-out);
}
.beat.on { opacity: 1; transform: none; filter: none; }
/* Story lines rise in from a little lower and settle, with a brass mark that draws in beside them */
.chapter .beat { transition-duration: 1.2s, 1.5s, 1.2s; }
.ch-story { position: relative; transform: translateY(26px); }
.chapter .ch-story { transition-duration: 1.6s, 2s, 1.6s; }
/* Leaving is quick, so the old story is gone before the camera moves on */
.chapter .beat:not(.on) { transition-duration: .4s; }
.ch-story::before {
  content: ""; position: absolute; inset-inline-start: calc(var(--gutter) * -.5); top: .55em;
  width: 2px; height: 0; background: var(--brass); border-radius: 1px;
  transition: height .4s var(--ease-out);
}
.ch-story.on::before { height: .9em; transition: height 1.4s var(--ease-out); transition-delay: inherit; }
/* Text over the film: a tighter story so the whole chapter fits in the dark top of the frame */
@media (max-width: 767px) {
  html:not(.text-beside) .ch-hook { margin-bottom: 16px; }
  html:not(.text-beside) .ch-story { font-size: 16px; line-height: 1.5; margin-bottom: 8px; }
  html[lang="ar"]:not(.text-beside) .ch-story { font-size: 19px; line-height: 1.65; }
}
.chapter.out .beat { opacity: 0; transform: translateY(-10px); filter: blur(4px); transition-duration: .35s; transition-delay: 0s !important; }

/* Language swap: text blurs out, changes, blurs back in */
#kicker span, .cue-text, .river-label textPath, .end [data-i18n] { transition: opacity .5s var(--ease-out), filter .5s var(--ease-out); }
html.swapping [data-i18n], html.swapping #title, html.swapping #count, html.swapping .river-label {
  opacity: 0 !important; filter: blur(6px); transition: opacity .3s ease-in, filter .3s ease-in;
}

/* Film progress hairline */
.progress {
  position: fixed; z-index: 4; left: 0; right: 0; bottom: 0; height: 2px;
  background: rgba(200,150,62,.12); opacity: 0; transition: opacity .5s;
}
.progress.on { opacity: 1; }
.progress span { display: block; height: 100%; background: var(--brass); transform-origin: left; transform: scaleX(0); }
html[dir="rtl"] .progress span { transform-origin: right; }

/* ---------- Scroll track ---------- */
.track { position: relative; z-index: 5; pointer-events: none; }
.zone-intro { height: 120vh; height: 120svh; }
.zone-film { height: 4320vh; }   /* intro.js sets it from the chapter timings */
.end {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: linear-gradient(to bottom, rgba(10,14,26,0), var(--night) 40%);
  text-align: center; pointer-events: auto; padding: 0 var(--gutter);
}
.end-title { font: 700 clamp(28px, 4vw, 48px)/1.2 var(--font-display); color: var(--ivory); margin-bottom: 8px; }
.end-line { font: 400 clamp(17px, 1.4vw, 20px)/1.6 var(--font-body); color: var(--text-primary); max-width: 34ch; }
.end-link { margin-top: 20px; color: var(--text-secondary); font: 500 14px/20px var(--font-body); text-decoration: none; border-bottom: 1px solid var(--brass-dim); padding-bottom: 2px; }
.end-link:hover { color: var(--ivory); border-color: var(--brass); }
html[lang="ar"] .end-title { font: 700 clamp(32px, 4.4vw, 54px)/1.5 var(--font-ar); }
html[lang="ar"] .end-line { font: 400 clamp(20px, 1.7vw, 24px)/1.8 var(--font-ar); }
html[lang="ar"] .end-link { font: 400 17px/24px var(--font-ar); }

/* ---------- Footer (Figma: Footer / Phone) ---------- */
.site-footer {
  position: relative; z-index: 5;
  background: var(--night-950);
  border-top: 1px solid rgba(200, 150, 62, .18);
  padding: 24px 16px max(24px, env(safe-area-inset-bottom));
}
.foot-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 32px;
}
.foot-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.foot-brand { gap: 8px; }
.zeros-logo { display: block; width: 56px; height: auto; margin-top: 4px; outline: 1px solid rgba(200, 150, 62, .25); }
.foot-tagline { font: 400 14px/20px var(--font-body); letter-spacing: .25px; color: var(--text-primary); }

.foot-head {
  padding-bottom: 2px; margin-bottom: 8px;
  font: 700 16px/24px var(--font-body); letter-spacing: .15px; color: var(--ivory);
}
.foot-contact, .foot-list, .contact-list, .foot-rights { font: 400 14px/20px var(--font-body); letter-spacing: .25px; color: var(--text-secondary); }
.contact-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.contact-item { display: inline-flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; }
.contact-item .ico { width: 16px; height: 16px; color: var(--brass); }
.contact-item .ico-whatsapp { width: 14px; height: 14px; margin-inline: 2px; }
.num { color: var(--text-primary); font-weight: 500; letter-spacing: .1px; text-decoration: none; border-bottom: .5px solid var(--brass-dim); }
.site-footer a { transition: color .3s, border-color .3s; }
.site-footer a:hover, .site-footer a:hover .num { color: var(--brass-light); border-color: var(--brass); }
.site-footer a:focus-visible { outline: 2px solid var(--brass-light); outline-offset: 2px; border-radius: 4px; }

.ico-mail { --icon: url(images/ui/footer/letter.svg); }
.ico-whatsapp { --icon: url(images/ui/footer/whatsapp.svg); }
.ico-linkedin { --icon: url(images/ui/footer/linkedin.svg); width: 19px; height: 19.2px; margin: 0 0 2px 1px; }
.ico-instagram { --icon: url(images/ui/footer/instagram.svg); width: 22px; height: 21.1px; }

/* Link columns: two by two on phones, one row on wide screens */
.foot-links { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 16px; padding: 0 16px; }
.foot-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.foot-list a { color: inherit; text-decoration: none; }

.studio-name { font: 400 12px/16px var(--font-body); letter-spacing: .2em; text-transform: uppercase; color: var(--text-muted); }
.foot-social { list-style: none; display: flex; justify-content: center; gap: 24px; direction: ltr; }
.social .ico-whatsapp { width: 24px; height: 24px; }
.social .ico-mail { width: 26px; height: 26px; }
.social {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 999px;
  background: var(--ivory); border: 1px solid var(--brass); color: var(--night);
  transition: background .3s, transform .3s var(--ease-out);
}
.site-footer .social:hover { background: var(--brass-light); color: var(--night); transform: translateY(-2px); }
.foot-rights { font-size: 12px; line-height: 16px; letter-spacing: 0; color: var(--text-muted); }

@media (min-width: 768px) {
  .site-footer { padding: 56px var(--gutter) 32px; }
  .foot-inner { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 40px 64px; }
  .foot-brand, .foot-contact { grid-column: 1; }
  .foot-links { grid-column: 2; grid-row: 1 / span 2; grid-template-columns: repeat(4, 1fr); padding: 0; }
  .foot-social, .foot-rights { grid-row: 3; align-self: stretch; align-items: center; padding-top: 24px; border-top: 1px solid rgba(200, 150, 62, .12); }
  .foot-rights { grid-column: 1; display: flex; }
  .foot-social { grid-column: 2; justify-content: flex-end; }
}

html[lang="ar"] .foot-tagline, html[lang="ar"] .foot-list, html[lang="ar"] .contact-list { font: 400 16px/24px var(--font-ar); letter-spacing: 0; }
html[lang="ar"] .foot-head { font: 700 18px/26px var(--font-ar); letter-spacing: 0; }
html[lang="ar"] .studio-name { font: 400 15px/22px var(--font-ar); letter-spacing: 0; }
html[lang="ar"] .foot-rights { font: 400 13px/20px var(--font-ui-ar); }
html[lang="ar"] .num { font-family: var(--font-body); }

/* Before the intro plays, hide what JS will reveal (no-JS shows everything) */
.js .intro-inner > *, .js .kicker, .js .cue, .js .partners, .js .topbar { opacity: 0; }
.js .draw { stroke-dasharray: var(--len, 3000); stroke-dashoffset: var(--len, 3000); }
.js #skyCanvas { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .menu, .menu-fold, .menu-scrim, .menu-btn .ico { transition-duration: .01s !important; }
  .flow, .glow, .cue-track i, .city-pulse { animation: none !important; }
  .cue-track i { transform: translateY(18px); }
  .beat { transform: none; filter: none; transition: opacity .4s; }
}
