:root {
  --bg: #050F18;
  --ink: #F2F7F8;
  --muted: #8CA3AE;
  --accent: #00D3DE;
  --accent-ink: #06202E;
  --navy: #0B3D62;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  overflow-x: hidden;
}
.lat { font-family: 'Archivo', sans-serif; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }

/* ---------- top chrome ---------- */
.lang-toggle {
  position: fixed;
  top: 20px; inset-inline-end: 20px;
  z-index: 50;
  font-family: 'Archivo', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  background: rgba(5, 15, 24, 0.55);
  color: var(--ink);
  border: 1px solid rgba(242, 247, 248, 0.35);
  padding: 9px 16px;
  cursor: pointer;
}
/* Lives inside the pinned hero stage (not fixed to the viewport), tucked above the
   scroll cue at the bottom — so it can never land under the fixed header, in either
   language direction, and scrolls away naturally with the rest of the hero. */
.skip-journey {
  position: absolute;
  bottom: 76px; inset-inline: 0;
  z-index: 20;
  width: fit-content;
  margin-inline: auto;
  font-family: 'Archivo', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  background: rgba(5, 15, 24, 0.55);
  color: var(--ink);
  border: 1px solid rgba(242, 247, 248, 0.35);
  padding: 9px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: opacity .3s ease;
}
.lang-toggle:focus-visible, .skip-journey:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- journey pin container ---------- */
#journey { position: relative; height: calc(var(--total-vh, 360) * 1vh); }
.journey-stage {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--bg);
}
#journey-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- design concept label ----------
   A discreet caption pinned to the hero's bottom-right corner (a fixed physical corner,
   not a start/end one, like a photo credit) — kept well clear of the logo/header above,
   and of the centered scroll cue and skip button and the floating WhatsApp button (which
   sits at the opposite, inline-end corner: right in English, left in Arabic) below. */
.design-concept-label {
  position: absolute; bottom: 102px; right: 18px;
  z-index: 15;
  font-family: 'Archivo', sans-serif;
  font-size: 10px;
  letter-spacing: .03em;
  color: var(--muted);
  background: rgba(5,15,24,0.32);
  border: 1px solid rgba(140,163,174,0.22);
  padding: 4px 8px;
  transition: opacity .3s ease;
}
@media (max-width: 760px) {
  .design-concept-label { bottom: 88px; right: 14px; font-size: 9px; padding: 3px 7px; }
}

/* ---------- first screen: proposition + quote button ----------
   Sits in the top band of the first frame, under the fixed header — clear of the design-concept
   label (bottom corner), the skip button and the scroll cue (bottom centre). journey.js fades it
   out with the scroll cue as the journey starts; without JS it simply stays visible. */
.journey-intro {
  position: absolute; inset-inline: 0; top: 0;
  z-index: 22;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: max(14vh, 116px) 24px 56px;
  padding: max(14svh, 116px) 24px 56px;
  text-align: center;
  background: linear-gradient(to bottom, rgba(5,15,24,0.62) 0%, rgba(5,15,24,0.34) 62%, rgba(5,15,24,0) 100%);
  pointer-events: none;
  transition: opacity .3s ease;
}
.journey-intro-line {
  font-size: clamp(16px, 1.5vw, 19px);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: .01em;
  color: var(--ink);
  max-width: 34ch;
  text-shadow: 0 1px 14px rgba(0,0,0,0.45);
}
.journey-intro-cta {
  pointer-events: auto;
  font-size: 14px; font-weight: 600;
  color: var(--ink); text-decoration: none;
  background: rgba(5,15,24,0.5);
  border: 1px solid var(--accent);
  padding: 10px 20px;
  transition: background-color .2s ease, color .2s ease;
}
.journey-intro-cta:hover { background: var(--accent); color: var(--accent-ink); }
.journey-intro-cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
body.rm-static .journey-intro { display: none; }

/* ---------- caption ---------- */
.journey-caption {
  position: absolute;
  inset-inline: 0;
  bottom: 14%;
  z-index: 20;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  padding-inline: 24px;
}
.journey-caption span {
  display: inline-block;
  font-size: clamp(22px, 3.2vw, 38px);
  font-weight: 300;
  line-height: 1.3;
  color: var(--ink);
  text-shadow: 0 2px 24px rgba(0,0,0,0.5);
  max-width: 18ch;
}

/* ---------- scroll cue ---------- */
#scroll-cue {
  position: absolute; bottom: 36px; inset-inline-start: 0; inset-inline-end: 0;
  z-index: 20; text-align: center;
  font-family: 'Archivo', sans-serif;
  font-size: 12px; letter-spacing: .1em; color: var(--muted);
  transition: opacity .3s ease;
}
#scroll-cue .chev {
  width: 14px; height: 14px; margin: 8px auto 0;
  /* Physical right+bottom borders, not border-inline-end/block-end: a "point down" chevron
     should look the same in Arabic and English. The logical inline-end property flips to the
     left edge in RTL, which combined with the same rotate(45deg) drew a left-pointing chevron
     on the Arabic page instead of a downward one. */
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  animation: cue-bob 1.8s ease-in-out infinite;
}
@keyframes cue-bob { 0%,100%{ transform: translateY(0) rotate(45deg);} 50%{ transform: translateY(6px) rotate(45deg);} }

/* ---------- final reveal panel, held on K2b in the sky area ---------- */
#journey-final {
  position: absolute; inset-inline: 0; top: 0;
  z-index: 25;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  /* Clears the fixed header (~84px desktop / ~80px mobile) with margin to spare, so the
     logo/headline never starts underneath it. */
  padding: max(9vh, 112px) 24px 0;
  padding: max(9svh, 112px) 24px 0;
  opacity: 0;
  visibility: hidden;
}
#journey-final::before {
  content: '';
  position: absolute;
  inset-inline: -10%;
  top: -8%;
  height: 155%;
  background: linear-gradient(to bottom, rgba(5,15,24,0.72) 0%, rgba(5,15,24,0.46) 55%, rgba(5,15,24,0) 100%);
  z-index: -1;
  pointer-events: none;
}
.final-logo { height: 40px; width: auto; margin-bottom: 26px; }
.final-headline {
  font-weight: 300;
  font-size: clamp(26px, 3.6vw, 46px);
  line-height: 1.25;
  max-width: 16ch;
  margin-bottom: 14px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}
.final-tagline {
  font-family: 'Archivo';
  font-size: clamp(15px, 1.6vw, 18px);
  color: var(--ink);
  max-width: 42ch;
  margin-bottom: 26px;
}
.final-ctas { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.btn-primary {
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; font-size: 16px;
  padding: 15px 30px; text-decoration: none; display: inline-block;
}
.btn-secondary {
  color: var(--ink); font-weight: 400; font-size: 16px; text-decoration: none;
  border-bottom: 1px solid var(--muted); padding-bottom: 3px;
  display: inline-flex; align-items: center;
}

/* ---------- underwater layers: normal (non-pinned) section ---------- */
#underwater-layers {
  background: radial-gradient(120% 70% at 50% 0%, #0c2c42 0%, #050F18 70%);
  padding: 90px 24px 110px;
}
.uw-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.uw-head h2 {
  font-weight: 300; font-size: clamp(28px, 3.4vw, 42px); margin-bottom: 14px; color: var(--ink);
}
.uw-head p { color: var(--muted); font-size: 16px; }
.cross-section {
  max-width: 820px; margin-inline: auto; width: 100%;
  display: flex; flex-direction: column; gap: 3px;
}
.uw-layer {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 20px;
  background: rgba(242,247,248,0.045);
  border-inline-start: 3px solid rgba(0,211,222,0.3);
  opacity: 0; transform: translateY(20px);
  transition: opacity .5s ease, transform .5s ease;
}
.uw-layer.is-visible { opacity: 1; transform: translateY(0); border-inline-start-color: var(--accent); }
.uw-layer .num {
  font-family: 'Archivo'; font-size: 13px; color: var(--accent);
  min-width: 2.4ch; flex-shrink: 0;
}
.uw-layer .label { font-size: clamp(14px, 1.5vw, 18px); color: var(--ink); line-height: 1.6; }

/* ---------- reduced motion static fallback ---------- */
body.rm-static .lang-toggle, body.rm-static .skip-journey { display: none; }
#journey.is-static { height: 100vh; height: 100svh; }
#journey.is-static .journey-stage { position: relative; }
#journey.is-static .rm-only { display: flex !important; }
.rm-hero {
  display: none;
  position: absolute; inset: 0;
  background: url('/assets/journey/v3/m/final.webp') center/cover;
  align-items: flex-start; justify-content: center;
  padding: max(9vh, 112px) 24px 0;
  padding: max(9svh, 112px) 24px 0;
  text-align: center;
}
@media (min-width: 761px) {
  .rm-hero { background-image: url('/assets/journey/v3/d/img/K2b.webp'); }
}
.rm-hero::after {
  content: ''; position: absolute; inset-inline: -10%; top: -8%; height: 155%;
  background: linear-gradient(to bottom, rgba(5,15,24,0.72) 0%, rgba(5,15,24,0.46) 55%, rgba(5,15,24,0) 100%);
  z-index: 0;
}
.rm-hero-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.rm-hero-inner .final-logo { margin-bottom: 26px; }
.rm-hero-inner .rm-headline { font-weight: 300; font-size: clamp(26px, 3.6vw, 46px); line-height: 1.25; max-width: 16ch; margin-bottom: 14px; }
.rm-hero-inner p { color: var(--ink); font-size: 17px; margin-bottom: 26px; max-width: 42ch; }
body:not(.rm-static) .rm-hero { display: none !important; }

/* ---------- mobile (<= 760px): autoplay video hero, no pinning ----------
   journey.js plays /assets/journey/v3/m/hero.mp4 once over the poster, then adds .is-final:
   the final still (the video's own last frame) with the headline, proposition and buttons.
   Without JS the poster and the proposition + quote button stay on screen — never a blank hero. */
.journey-down { display: none; }
@media (max-width: 760px) {
  #journey { height: 100vh; height: 100svh; }
  .journey-stage { background: var(--bg) url('/assets/journey/v3/m/poster.webp') center/cover no-repeat; }
  .journey-stage::before {
    content: ''; position: absolute; inset: 0; z-index: 0;
    background: url('/assets/journey/v3/m/final.webp') center/cover no-repeat;
    opacity: 0; transition: opacity .6s ease;
  }
  #journey-canvas, .skip-journey, #scroll-cue, .journey-caption { display: none; }
  .journey-video {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; z-index: 1; background: transparent;
    transition: opacity .6s ease;
  }
  #journey.is-final .journey-stage::before { opacity: 1; }
  #journey.is-final .journey-video { opacity: 0; pointer-events: none; }
  #journey.is-final .journey-intro { opacity: 0; visibility: hidden; transition: opacity .4s ease, visibility 0s .4s; }
  #journey.is-final #journey-final {
    opacity: 1; visibility: visible; transform: none; pointer-events: auto;
    transition: opacity .7s ease .15s, transform .7s ease .15s;
  }
  #journey-final { transform: translateY(16px); }
  .journey-down {
    display: flex; align-items: center; justify-content: center;
    position: absolute; bottom: 22px; inset-inline: 0; margin-inline: auto; z-index: 26;
    width: 44px; height: 44px;
    opacity: 0; visibility: hidden; transition: opacity .5s ease .6s;
  }
  .journey-down .chev {
    width: 13px; height: 13px; margin-top: -6px;
    border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
    transform: rotate(45deg);
  }
  .journey-down:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  #journey.is-final .journey-down { opacity: 1; visibility: visible; }
  /* Owner's call: on phones the video plays with no text over it — the proposition line and the
     quote button appear only in the final state (and in the reduced-motion static hero); the
     header logo is the only logo (no second ATLAS mark above the headline). */
  .journey-intro { display: none; }
  #journey-final .final-logo, .rm-hero .final-logo { display: none; }
  body.rm-static .journey-down { display: none; }
  .journey-caption { bottom: 18%; }
  #journey-final, .rm-hero { padding-top: max(7vh, 112px); padding-top: max(7svh, 112px); }
  .final-logo { height: 32px; margin-bottom: 18px; }
  .final-ctas { flex-direction: column; align-items: stretch; width: 100%; max-width: 280px; }
  .btn-primary { text-align: center; }
  .btn-secondary { text-align: center; border-bottom: none; background: rgba(242,247,248,0.08); padding: 13px; }
  #underwater-layers { padding: 64px 18px 80px; }
  .uw-layer { padding: 14px 16px; gap: 12px; }
}
