/* ============================================================
   MBZ — محمد بن زايد آل نهيان
   Auto-playing 42s film → redirect screen → the official site.
   ============================================================ */

html { scroll-behavior: smooth; overscroll-behavior-y: none; }

body {
  margin: 0;
  /* the film and hand-off layers cannot scroll; a downward drag on them
     would otherwise be Android's pull-to-refresh */
  overscroll-behavior-y: none;
  background: #050505;
  color: #efece5;
  font-family: 'Almarai', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: #efece5; }
a:hover { color: #ffffff; }
::selection { background: rgba(255,255,255,.22); }

.stage {
  min-height: 100vh;
  background: #050505;
  color: #efece5;
  font-family: 'Almarai', system-ui, sans-serif;
  position: relative;
}

/* ---------- keyframes ---------- */

@keyframes introZoom { from { transform: scale(1.02) } to { transform: scale(1.09) } }

@keyframes kenBg { from { transform: scale(1.04) translateY(0) } to { transform: scale(1.12) translateY(-1.5%) } }

@keyframes grainJit {
  0%   { background-position: 0 0 }
  25%  { background-position: -70px 40px }
  50%  { background-position: 40px -60px }
  75%  { background-position: -30px -30px }
  100% { background-position: 60px 50px }
}

@keyframes dashMove { to { stroke-dashoffset: -100 } }

@keyframes dotBlink { 0%, 100% { opacity: .05 } 35%, 65% { opacity: 1 } }

@keyframes wordIn {
  from { opacity: 0; letter-spacing: .7em; filter: blur(14px); transform: translateY(20px) }
  to   { opacity: 1; letter-spacing: .28em; filter: blur(0); transform: translateY(0) }
}

@keyframes riseIn { from { opacity: 0; transform: translateY(26px) } to { opacity: 1; transform: translateY(0) } }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes floaty { from { transform: translateY(0) } to { transform: translateY(-14px) } }
@keyframes floatyTilt  { from { transform: rotate(-2.5deg) translateY(0) } to { transform: rotate(-2.5deg) translateY(-16px) } }
@keyframes floatyTiltB { from { transform: rotate(2.2deg) translateY(0) }  to { transform: rotate(2.2deg) translateY(-16px) } }
@keyframes qUp { from { opacity: 0; transform: translateY(54px) } to { opacity: 1; transform: translateY(0) } }

@keyframes neonPulse {
  from { box-shadow: 0 0 8px rgba(255,255,255,.45), 0 0 26px rgba(255,255,255,.2), 0 0 64px rgba(255,255,255,.1), 0 40px 110px rgba(0,0,0,.8) }
  to   { box-shadow: 0 0 13px rgba(255,255,255,.75), 0 0 42px rgba(255,255,255,.32), 0 0 100px rgba(255,255,255,.16), 0 40px 110px rgba(0,0,0,.8) }
}

@keyframes cue {
  0%   { transform: scaleY(0); transform-origin: top }
  45%  { transform: scaleY(1); transform-origin: top }
  55%  { transform: scaleY(1); transform-origin: bottom }
  100% { transform: scaleY(0); transform-origin: bottom }
}

/* ---------- scroll backdrop ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: #050505;
}

.backdrop-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05) brightness(.5);
  opacity: 0;
  animation: kenBg 46s ease-in-out infinite alternate;
}

.backdrop-img--1 { object-position: 50% 18%; }
.backdrop-img--2 { object-position: 62% 30%; animation-delay: -15s; }
.backdrop-img--3 { object-position: 50% 22%; animation-delay: -30s; }

.backdrop-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(5,5,5,.22) 0%, rgba(5,5,5,.75) 62%, rgba(5,5,5,.95) 100%),
    linear-gradient(to bottom, rgba(5,5,5,.9) 0%, rgba(5,5,5,.3) 18%, rgba(5,5,5,.3) 82%, rgba(5,5,5,.92) 100%);
}

.sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.site { position: relative; z-index: 1; }
.site[hidden] { display: none; }

/* ---------- header ---------- */

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 30px;
  background: linear-gradient(to bottom, rgba(5,5,5,.78), rgba(5,5,5,0));
}

.brand { display: flex; align-items: center; gap: 14px; }

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-image: url('assets/emblem.jpg');
  background-size: cover;
  background-position: 50% 22%;
  filter: grayscale(1) contrast(1.08);
  box-shadow: 0 0 0 1px rgba(255,255,255,.22), 0 8px 24px rgba(0,0,0,.6);
}

.brand-word {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  letter-spacing: .34em;
  color: rgba(244,241,234,.92);
}

.header-links { display: flex; align-items: center; gap: 10px; }

.btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.25);
  text-decoration: none;
  font-weight: 300;
  transition: all .3s ease;
}

.btn-outline--wide { height: 36px; padding: 0 18px; font-size: 12.5px; }
.btn-outline--icon { width: 36px; height: 36px; font-family: 'Cinzel', serif; font-size: 15px; }
.btn-outline--lg { border-color: rgba(255,255,255,.3); padding: 13px 46px; font-size: 15px; font-weight: 400; }

.btn-outline:hover {
  background: #efece5;
  color: #0a0a0a;
  border-color: #efece5;
}

/* ---------- hero ---------- */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 120px 24px 90px;
  position: relative;
  text-align: center;
}

.hero-ring {
  padding: 12px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 50%;
  animation: fadeIn 1.8s ease both;
}

.hero-emblem {
  width: 136px;
  height: 136px;
  border-radius: 50%;
  background-image: url('assets/emblem.jpg');
  background-size: cover;
  background-position: 50% 22%;
  filter: grayscale(1) contrast(1.08);
  box-shadow: 0 26px 70px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.16), 0 0 90px rgba(255,255,255,.05);
}

.hero-title {
  margin: 14px 0 0;
  font-family: 'Cinzel', serif;
  font-weight: 500;
  font-size: clamp(64px, 15vw, 190px);
  line-height: 1;
  letter-spacing: .28em;
  margin-right: -.28em;
  color: #f4f1ea;
  text-shadow: 0 0 70px rgba(255,255,255,.14);
  animation: wordIn 2.4s cubic-bezier(.16,.8,.26,1) .25s both;
}

.hero-wordmark {
  width: clamp(240px, 32vw, 380px);
  display: block;
  filter: drop-shadow(0 0 26px rgba(255,255,255,.14));
  animation: riseIn 1.6s ease 1s both;
}

.hero-rule {
  width: 92px;
  height: 1px;
  background: rgba(255,255,255,.28);
  animation: riseIn 1.6s ease 1.25s both;
}

.hero-sub {
  font-size: 14px;
  font-weight: 300;
  color: rgba(239,236,229,.58);
  animation: riseIn 1.6s ease 1.45s both;
}

.scroll-cue {
  position: absolute;
  bottom: 34px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: fadeIn 2s ease 2.2s both;
}

.scroll-cue-label { font-size: 11px; color: rgba(239,236,229,.58); }

.scroll-cue-line {
  width: 1px;
  height: 56px;
  background: rgba(255,255,255,.3);
  animation: cue 2.6s ease-in-out infinite;
}

/* ---------- scroll reveal ---------- */

.reveal {
  animation: qUp linear both;
  animation-timeline: view();
  animation-range: entry 10% entry 60%;
}

.reveal--early { animation-range: entry 5% entry 40%; }
.reveal--media { animation-range: entry 10% entry 45%; }
.reveal--mid   { animation-range: entry 5% entry 45%; }
.reveal--late  { animation-range: entry 20% entry 60%; }

/* Browsers without scroll-driven animations get the same motion, driven by
   IntersectionObserver in app.js (the .is-in class). */
@supports not (animation-timeline: view()) {
  .reveal { animation: none; opacity: 0; transform: translateY(54px); transition: opacity .9s ease, transform .9s cubic-bezier(.16,.8,.26,1); }
  .reveal.is-in { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  /* pause, not remove: the tilted and neon frames keep their resting
     rotation and glow only through their keyframes */
  .backdrop-img, .frame--float, .frame--tilt-a, .frame--tilt-b, .frame--tilt-c,
  .framed, .neon-dash, .grain { animation-play-state: paused; }
  .scroll-cue-line, .redirect-dots > span { animation: none; }
}

/* ---------- neon frames ---------- */

.frame { position: relative; }
.frame--float  { animation: floaty 9s ease-in-out infinite alternate; }
.frame--tilt-a { animation: floatyTilt 8s ease-in-out infinite alternate; }
.frame--tilt-b { animation: floatyTiltB 9s ease-in-out infinite alternate; }
.frame--tilt-c { animation: floatyTilt 8.5s ease-in-out infinite alternate; }

.frame-neon {
  position: absolute;
  inset: -3px;
  width: calc(100% + 6px);
  height: calc(100% + 6px);
  pointer-events: none;
  overflow: visible;
}

.frame-neon rect {
  width: calc(100% - 6px);
  height: calc(100% - 6px);
}

.neon-dash {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  animation: dashMove 6s linear infinite;
  animation-delay: var(--dash-delay, 0s);
}

.neon-dash--bright {
  stroke: rgba(255,255,255,.95);
  stroke-dasharray: 12 88;
  filter: drop-shadow(0 0 6px rgba(255,255,255,.85));
}

.neon-dash--dim {
  stroke: rgba(255,255,255,.4);
  stroke-dasharray: 8 92;
  animation-delay: calc(var(--dash-delay, 0s) - 3s);
}

.framed {
  display: block;
  padding: 8px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 6px;
  animation: neonPulse 7s ease-in-out infinite alternate;
  animation-delay: var(--pulse-delay, 0s);
}

.framed--r8 { padding: 10px; border-radius: 8px; }
.framed--cdn { aspect-ratio: 3 / 2; object-fit: cover; }

/* ---------- timeline section ---------- */

.timeline-section { position: relative; padding: 12vh 0 4vh; }

.section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 0 24px;
}

.section-title-rule { width: 70px; height: 1px; background: rgba(255,255,255,.22); }

.section-title-text {
  /* a real <h2> for heading navigation; the browser's h2 margin and bold
     weight are pinned back so the render is unchanged */
  margin: 0;
  font-family: 'Amiri', serif;
  font-weight: 400;
  font-size: clamp(22px, 3vw, 30px);
  color: rgba(244,241,234,.9);
  white-space: nowrap;
}

.opening {
  margin: 0;
  padding: 8vh 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.opening-img {
  max-height: 72vh;
  max-width: 86vw;
  filter: grayscale(1) contrast(1.04);
}

.opening-caption {
  max-width: 820px;
  font-family: 'Amiri', serif;
  font-size: clamp(19px, 2.1vw, 25px);
  line-height: 2.05;
  color: rgba(242,239,232,.88);
  text-align: center;
  padding: 0 12px;
}

.timeline {
  position: relative;
  max-width: 1160px;
  margin: 0 auto;
  padding: 8vh clamp(20px, 6vw, 90px) 2vh;
}

.timeline-rail {
  position: absolute;
  top: 8vh;
  bottom: 2vh;
  right: clamp(20px, 6vw, 90px);
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,.28) 4%, rgba(255,255,255,.28) 96%, transparent);
}

.tl-item {
  position: relative;
  padding: 54px clamp(34px, 4.5vw, 64px) 54px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(30px, 4.5vw, 72px);
}

.tl-dot {
  position: absolute;
  top: 84px;
  right: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f4f1ea;
  box-shadow: 0 0 14px rgba(255,255,255,.9), 0 0 34px rgba(255,255,255,.4);
}

.tl-text {
  width: min(480px, 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tl-text--wide { width: min(520px, 100%); }

.tl-year {
  font-family: 'Cinzel', serif;
  font-size: clamp(52px, 6.5vw, 88px);
  line-height: 1;
  color: #f4f1ea;
  text-align: right;
  text-shadow: 0 0 55px rgba(255,255,255,.13);
}

.tl-rule { width: 64px; height: 1px; background: rgba(255,255,255,.3); }

.tl-body {
  margin: 0;
  font-family: 'Amiri', serif;
  font-size: clamp(20px, 2.2vw, 27px);
  line-height: 1.95;
  color: rgba(242,239,232,.92);
}

.tl-media { filter: grayscale(1) contrast(1.1) brightness(.9); }
.tl-media--sm   { width: clamp(200px, 21vw, 280px); }
.tl-media--md   { width: clamp(230px, 26vw, 330px); }
.tl-media--wide { width: clamp(230px, 26vw, 340px); filter: grayscale(1) contrast(1.08) brightness(.88); }

.link-row { display: flex; justify-content: center; padding-top: 3vh; }
/* the gallery's link sits flush; only the timeline's is padded */
.link-row--flush { padding-top: 0; }

.text-link {
  font-size: 13px;
  font-weight: 300;
  color: rgba(239,236,229,.55);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.25);
  padding-bottom: 4px;
  transition: all .3s ease;
}

.text-link:hover { color: #ffffff; border-color: #ffffff; }

/* ---------- portrait ---------- */

.portrait-section { padding: 16vh 6vw 14vh; display: flex; justify-content: center; }

.portrait {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.portrait-img {
  max-height: 76vh;
  max-width: 88vw;
  filter: grayscale(1) contrast(1.07);
}

.portrait-caption {
  font-size: 13px;
  font-weight: 300;
  color: #F5F4F280;
  letter-spacing: 0;
}

/* ---------- quotes ---------- */

.quotes-section { padding: 8vh 0 4vh; }

.quote-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(48px, 7vw, 110px);
  padding: 13vh 8vw;
}

.quote-row--reverse { flex-direction: row-reverse; }

.quote {
  margin: 0;
  max-width: 560px;
  font-family: 'Amiri', serif;
  font-size: clamp(26px, 3.1vw, 42px);
  line-height: 2;
  color: #f2efe8;
}

.quote-source {
  margin-top: 18px;
  font-family: 'Almarai', sans-serif;
  font-size: 13px;
  font-weight: 300;
  color: rgba(239,236,229,.5);
}

.quote-img--lg { width: clamp(210px, 24vw, 300px); filter: grayscale(1) contrast(1.12) brightness(.88); }
.quote-img--sm { width: clamp(190px, 20vw, 260px); filter: grayscale(1) contrast(1.1) brightness(.9); }

/* ---------- gallery ---------- */

.gallery-section { padding: 10vh 0 8vh; }

.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(28px, 3.5vw, 48px);
  padding: 7vh 6vw 3vh;
}

.gallery-card {
  width: min(540px, 88vw);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* a card whose official-site photo failed to load is removed outright
   (display:flex above would otherwise beat the browser's [hidden] rule) */
.gallery-card[hidden], .gallery-section[hidden], .reveal--media[hidden] { display: none; }

.gallery-img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08) brightness(.85);
  transition: filter .5s ease, transform .5s ease;
}

.gallery-card:hover .gallery-img {
  filter: grayscale(1) contrast(1.08) brightness(1);
  transform: scale(1.015);
}

.gallery-caption {
  font-size: 13px;
  font-weight: 300;
  color: rgba(239,236,229,.55);
  text-align: center;
}

/* ---------- slow video ---------- */

.video-section { position: relative; height: 230vh; }

.video-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  overflow: hidden;
  padding: 24px;
}

.video-title {
  margin: 0;
  font-family: 'Amiri', serif;
  font-weight: 700;
  font-size: clamp(28px, 4vw, 48px);
  color: #f2efe8;
}

.slow-video {
  height: min(72vh, 140vw);
  max-width: 92vw;
  border-radius: 5px;
  filter: grayscale(.92) contrast(1.08) brightness(.82);
  box-shadow: 0 60px 150px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.1), 0 0 110px rgba(255,255,255,.04);
}

.video-note { font-size: 12px; font-weight: 300; color: rgba(239,236,229,.58); }

/* ---------- footer ---------- */

.site-footer {
  padding: 14vh 8vw 9vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.footer-emblem {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-image: url('assets/emblem.jpg');
  background-size: cover;
  background-position: 50% 22%;
  filter: grayscale(1) contrast(1.08);
  box-shadow: 0 0 0 1px rgba(255,255,255,.2), 0 14px 40px rgba(0,0,0,.7);
}

.footer-word {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  letter-spacing: .42em;
  margin-right: -.42em;
  color: rgba(244,241,234,.92);
}

.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

.footer-note {
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 300;
  color: rgba(239,236,229,.58);
  max-width: 520px;
  line-height: 1.9;
}

.footer-year { font-size: 11px; color: rgba(239,236,229,.5); }

/* ============================================================
   Intro layer — the 42s film, loader, redirect
   ============================================================ */

.intro {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #000;
  overflow: hidden;
  transition: opacity 1.9s ease;
  touch-action: manipulation;   /* no double-tap zoom on the film */
}

.intro[hidden] { display: none; }

.intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  filter: grayscale(1) contrast(1.24) brightness(.65);
  will-change: transform;
}

.grain {
  position: absolute;
  inset: 0;
  background: url('assets/grain.png?v=9600e063') repeat;
  background-size: 190px 190px;
  opacity: .08;
  mix-blend-mode: overlay;
  animation: grainJit .9s steps(5) infinite;
  pointer-events: none;
}

.spot {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 160px, rgba(0,0,0,.38) 300px, rgba(0,0,0,.82) 430px, rgba(0,0,0,.96) 600px);
}

.vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(0,0,0,.94) 0%, rgba(0,0,0,0) 26%),
    linear-gradient(to bottom, rgba(0,0,0,.78) 0%, rgba(0,0,0,0) 18%),
    linear-gradient(to right, rgba(0,0,0,.88) 0%, rgba(0,0,0,0) 24%),
    linear-gradient(to left, rgba(0,0,0,.88) 0%, rgba(0,0,0,0) 24%);
}

.loader {
  position: absolute;
  bottom: 42px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  z-index: 6;
}

.loader-word {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: .52em;
  margin-right: -.52em;
  color: rgba(255,255,255,.78);
}

.loader-track {
  width: min(240px, 60vw);
  height: 1px;
  background: rgba(255,255,255,.16);
  position: relative;
}

.loader-fill {
  position: absolute;
  top: 0;
  right: 0;
  height: 1px;
  width: 0%;
  background: #f5f2ea;
  box-shadow: 0 0 12px rgba(255,255,255,.7);
}

.loader-pct { font-size: 11.5px; font-weight: 300; color: rgba(255,255,255,.5); }

/* ---------- redirect hand-off ---------- */

.redirect {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  text-align: center;
  padding: 40px;
  animation: fadeIn 1.3s ease both;
  touch-action: manipulation;
}

.redirect[hidden] { display: none; }
.redirect:focus { outline: none; }
/* the address is a real link now; keep the panel pixel-identical */
.redirect-url a { color: inherit; text-decoration: none; }

.redirect-msg {
  margin: 0;
  font-family: 'Amiri', serif;
  font-weight: 700;
  font-size: clamp(20px, 2.4vw, 32px);
  line-height: 2.1;
  color: #f4f1ea;
  max-width: 1150px;
  text-shadow: 0 0 50px rgba(255,255,255,.1);
}

.redirect-url {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
  align-items: baseline;
  gap: 10px;
  font-family: 'Cinzel', serif;
  /* identical from ~405px up; below that the line shrinks with the screen
     instead of running off both edges (it was 358px wide on a 320px phone) */
  font-size: min(clamp(17px, 2.1vw, 24px), 4.2vw);
  letter-spacing: .16em;
  color: rgba(244,241,234,.88);
}

.redirect-dots { display: flex; gap: 7px; font-size: 1.3em; line-height: 1; }
.redirect-dots > span { animation: dotBlink 1.4s ease infinite; }
.redirect-dots > span:nth-child(2) { animation-delay: .35s; }
.redirect-dots > span:nth-child(3) { animation-delay: .7s; }
.redirect-dots > span:nth-child(4) { animation-delay: 1.05s; }
