/* =========================================================
   Coming-soon teaser — styles
   ========================================================= */

:root {
  --bg: #08060C;
  --graphite: #120D1A;
  --charcoal: #1B1426;
  --ink: #F4F6F7;
  --ink-2: rgba(244, 246, 247, .72);
  --ink-3: rgba(244, 246, 247, .48);
  --line: rgba(244, 246, 247, .14);
  --glass: rgba(20, 12, 32, .42);
  --accent: #C9A0FF;
  --accent-deep: #8A4DFF;
  --accent-glow: rgba(160, 100, 255, .45);

  --font: "Readex Pro", "Segoe UI", system-ui, -apple-system, "Noto Sans Arabic", "Geeza Pro", sans-serif;
  --ease: cubic-bezier(.2, .75, .1, 1);
  --ease-soft: cubic-bezier(.45, 0, .2, 1);

  --gutter: clamp(20px, 5vw, 72px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --intro: 2.9s; /* when the text reveal starts */
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

button { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 999px; }

/* ---------- Media layer ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  isolation: isolate;
}

.media { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }

.media__poster,
.media__ambient,
.media__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: var(--focus, 50% 50%);
}

.media__ambient, .media__video { opacity: 0; transition: opacity 1.4s var(--ease-soft); }
.media.is-ambient .media__ambient { opacity: 1; }
.media.is-video .media__video { opacity: 1; }

/* slow cinematic push-in after the intro */
.js .media__poster, .js .media__ambient, .js .media__video {
  transform: scale(1.08);
  animation: push 6s var(--ease) calc(var(--intro) - .6s) forwards;
}
@keyframes push { to { transform: scale(1); } }

.media__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(8,6,12,.92) 0%, rgba(8,6,12,.55) 28%, rgba(8,6,12,0) 58%),
    linear-gradient(to bottom, rgba(8,6,12,.6) 0%, rgba(8,6,12,0) 22%),
    radial-gradient(120% 90% at 50% 45%, rgba(8,6,12,0) 55%, rgba(8,6,12,.55) 100%);
}

.media__grain {
  position: absolute; inset: -50%;
  opacity: .07; pointer-events: none; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Brand mark ---------- */
.mark { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; }
.mark svg, .mark img { width: 100%; height: 100%; display: block; }
.mark svg { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.mark__route { stroke: var(--accent); }
.mark__dot { fill: var(--accent); stroke: none; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; inset-inline: 0; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-top) + clamp(18px, 3.2vw, 36px)) var(--gutter) 0;
}

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__name {
  font-weight: 500; font-size: 15px; letter-spacing: .32em; text-transform: uppercase;
  margin-inline-end: -.32em;
}

.lang {
  display: inline-flex; align-items: center;
  height: 40px; padding: 0 6px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
}
.lang__btn {
  min-width: 40px; height: 32px; padding: 0 10px;
  border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  font-size: 13px; font-weight: 500; letter-spacing: .08em; color: var(--ink-3);
  transition: color .3s, background-color .3s;
}
.lang__btn:hover { color: var(--ink); }
.lang__btn[aria-pressed="true"] { color: var(--bg); background: var(--ink); }
.lang__sep { width: 1px; height: 14px; background: var(--line); margin: 0 2px; }

/* ---------- Copy ---------- */
.copy {
  position: relative;
  padding: 0 var(--gutter) calc(var(--safe-bottom) + clamp(96px, 13vh, 150px));
  max-width: 1100px;
}

.eyebrow {
  margin: 0 0 clamp(14px, 2vh, 22px);
  font-size: clamp(15px, 1.5vw, 19px); font-weight: 400; color: var(--accent);
}
.eyebrow::before {
  content: ""; display: inline-block; vertical-align: middle; width: 34px; height: 1px; margin-inline-end: 14px;
  background: linear-gradient(to var(--to-end, right), transparent, var(--accent));
}
[dir="rtl"] { --to-end: left; }

.headline {
  margin: 0;
  font-weight: 500;
  font-size: clamp(44px, 7.4vw, 112px);
  line-height: 1.12;
  letter-spacing: -.02em;
  text-wrap: balance;
  text-shadow: 0 2px 40px rgba(0,0,0,.35);
}
:lang(ar) .headline { letter-spacing: 0; line-height: 1.3; font-weight: 500; }

.sub {
  margin: clamp(14px, 2.2vh, 24px) 0 0;
  font-size: clamp(18px, 2.1vw, 28px); font-weight: 300; color: var(--ink-2);
  line-height: 1.5; max-width: 34ch;
}

.tag {
  display: inline-flex; align-items: center; gap: 16px;
  margin: clamp(26px, 4.5vh, 44px) 0 0;
  font-size: 13px; font-weight: 400; letter-spacing: .34em; text-transform: uppercase; color: var(--ink-2);
}
.tag :lang(ar), .tag [data-t="tagA"]:lang(ar) { letter-spacing: 0; font-size: 15px; }
.tag__sep { width: 1px; height: 16px; background: var(--accent); opacity: .8; }

/* ---------- CTA ---------- */
.cta {
  display: inline-flex; align-items: center; gap: 14px;
  margin-top: clamp(22px, 3.4vh, 34px);
  min-height: 54px; padding: 0 22px 0 20px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  font-size: 15px; font-weight: 400; cursor: pointer;
  transition: border-color .4s, background-color .4s, box-shadow .4s, transform .4s var(--ease);
}
.cta:hover { border-color: rgba(160,100,255,.55); box-shadow: 0 0 0 6px rgba(160,100,255,.06), 0 10px 40px -10px var(--accent-glow); }
.cta:active { transform: scale(.98); }
.cta__dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow); animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--accent-glow); } 70%, 100% { box-shadow: 0 0 0 10px rgba(160,100,255,0); } }
.cta__arrow { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .4s var(--ease); }
[dir="rtl"] .cta__arrow { transform: scaleX(-1); }
.cta:hover .cta__arrow { transform: translateX(4px); }
[dir="rtl"] .cta:hover .cta__arrow { transform: scaleX(-1) translateX(4px); }

/* ---------- Video controls ---------- */
.controls {
  position: fixed; z-index: 5;
  inset-inline-end: var(--gutter);
  bottom: calc(var(--safe-bottom) + clamp(28px, 4.5vh, 44px));
  display: flex; gap: 10px;
}
.ctrl {
  position: relative;
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  cursor: pointer; transition: border-color .3s, background-color .3s;
}
.ctrl:hover { border-color: rgba(244,246,247,.4); background: rgba(30,36,42,.55); }
.ico { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ctrl .ico--on { display: none; }
.ctrl[aria-pressed="true"] .ico--on { display: block; color: var(--accent); }
.ctrl[aria-pressed="true"] .ico--off { display: none; }

.progress {
  position: fixed; inset-inline: 0; bottom: 0; height: 2px; z-index: 5;
  background: rgba(244,246,247,.06);
  opacity: 0; transition: opacity .8s;
}
.progress span {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(to right, var(--accent-deep), var(--accent));
  transform-origin: left; transform: scaleX(0);
}
[dir="rtl"] .progress span { transform-origin: right; }
.has-video .progress { opacity: 1; }

/* ---------- Footer ---------- */
.foot {
  position: fixed; z-index: 5;
  inset-inline-start: var(--gutter);
  bottom: calc(var(--safe-bottom) + clamp(28px, 4.5vh, 44px));
  height: 44px; display: flex; align-items: center; gap: 18px;
  font-size: 12px; color: var(--ink-3); letter-spacing: .04em;
}
.foot a { text-decoration: none; transition: color .3s; }
.foot a:hover { color: var(--ink); }

/* ---------- Brand intro ---------- */
.intro {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: var(--bg);
  pointer-events: none;
  animation: intro-out 1s var(--ease-soft) 2.1s forwards;
}
.intro__brand { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.intro .mark { width: 64px; height: 64px; }
.intro .mark svg { stroke-width: 1.8; }
.intro .mark__ring { stroke-dasharray: 110; stroke-dashoffset: 110; animation: draw 1.1s var(--ease) .1s forwards; }
.intro .mark__route { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .8s var(--ease) .5s forwards; }
.intro .mark__dot { opacity: 0; transform-origin: 42px 24px; transform: scale(0); animation: pop .5s var(--ease) .95s forwards; }
.intro__name {
  font-size: 14px; font-weight: 500; text-transform: uppercase;
  letter-spacing: .9em; margin-inline-end: -.9em;
  opacity: 0; animation: name-in 1.1s var(--ease) .45s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { to { opacity: 1; transform: scale(1); } }
@keyframes name-in { from { opacity: 0; letter-spacing: .9em; } to { opacity: 1; letter-spacing: .42em; } }
@keyframes intro-out { to { opacity: 0; visibility: hidden; } }

.intro__bars::before, .intro__bars::after {
  content: ""; position: fixed; inset-inline: 0; height: 13vh; background: #000; z-index: 51;
  animation: bar-out 1.3s var(--ease) 2.3s forwards;
}
.intro__bars::before { top: 0; transform-origin: top; }
.intro__bars::after { bottom: 0; transform-origin: bottom; }
@keyframes bar-out { to { transform: scaleY(0); } }

/* ---------- Text reveal (enabled by JS) ---------- */
.js .reveal .w {
  display: inline-block;
  opacity: 0;
  transform: translateY(.55em);
  filter: blur(10px);
}
.js .reveal:not(:has(.w)) { opacity: 0; }
.js .fade { opacity: 0; transform: translateY(10px); }

.play .reveal .w {
  animation: rise 1.25s var(--ease) forwards;
  animation-delay: calc(var(--intro-now, var(--intro)) + var(--d, 0s) + var(--i, 0) * 90ms);
}
.play .fade {
  animation: fade-up 1.1s var(--ease) forwards;
  animation-delay: calc(var(--intro-now, var(--intro)) + var(--d, 0s));
}
@keyframes rise { to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes fade-up { to { opacity: 1; transform: none; } }

/* ---------- Early access sheet ---------- */
.sheet {
  width: min(480px, calc(100% - 32px));
  max-height: calc(100svh - 32px);
  padding: 0; border: 1px solid var(--line); border-radius: 28px;
  background: linear-gradient(180deg, rgba(26,31,36,.92), rgba(12,15,18,.96));
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  color: var(--ink);
  box-shadow: 0 40px 120px -20px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.06);
  overflow: auto;
}
.sheet[open] { animation: sheet-in .6s var(--ease); }
.sheet::backdrop { background: rgba(4,5,6,.62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px) scale(.98); } }

.sheet__inner { position: relative; padding: 40px 32px 30px; }
.sheet__close {
  position: absolute; top: 14px; inset-inline-end: 14px;
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: rgba(255,255,255,.05); cursor: pointer;
}
.sheet__close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.sheet__close:hover { background: rgba(255,255,255,.1); }
.sheet__title { margin: 0 0 10px; font-size: 26px; font-weight: 500; letter-spacing: -.01em; }
.sheet__intro { margin: 0 0 26px; color: var(--ink-2); font-size: 15px; line-height: 1.6; }

.form { display: grid; gap: 18px; }
.hp { position: absolute; top: 0; inset-inline-start: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
.field { display: grid; gap: 8px; }
.field__label { font-size: 13px; color: var(--ink-2); }
.field__input {
  height: 54px; padding: 0 18px; width: 100%;
  border: 1px solid var(--line); border-radius: 14px;
  background: rgba(8,6,12,.6); color: var(--ink);
  font: inherit; font-size: 16px; font-weight: 400;
  transition: border-color .3s, box-shadow .3s;
}
.field__input::placeholder { color: var(--ink-3); }
.field__input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(160,100,255,.12); }
[dir="rtl"] .field__input { text-align: right; }

.check { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; }
.check__box {
  width: 22px; height: 22px; border: 1px solid rgba(244,246,247,.3); border-radius: 7px;
  display: grid; place-items: center; transition: background-color .2s, border-color .2s;
}
.check__box::after {
  content: ""; width: 10px; height: 6px; border: 2px solid var(--bg); border-top: 0; border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px); opacity: 0;
}
.check input:checked + .check__box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .check__box::after { opacity: 1; }
.check input:focus-visible + .check__box { outline: 2px solid var(--accent); outline-offset: 3px; }
.check__text { font-size: 13px; line-height: 1.6; color: var(--ink-2); }

.submit {
  height: 54px; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(180deg, #D7B6FF, var(--accent-deep));
  color: #12051F; font-size: 16px; font-weight: 500;
  box-shadow: 0 12px 40px -12px var(--accent-glow);
  transition: transform .3s var(--ease), filter .3s;
}
.submit:hover { filter: brightness(1.06); }
.submit:active { transform: scale(.98); }
.submit[disabled] { opacity: .6; cursor: progress; }

.form__status { margin: 0; min-height: 1.4em; font-size: 14px; color: var(--accent); }
.form__status.is-error { color: #FF8F8F; }
.form__note { margin: 0; font-size: 12px; line-height: 1.6; color: var(--ink-3); }
.form__note a { color: var(--ink-2); }
.form.is-done .field, .form.is-done .check, .form.is-done .submit { display: none; }
.form.is-done .form__status { font-size: 17px; color: var(--ink); }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .brand__name { font-size: 13px; }
  .mark { width: 30px; height: 30px; }
  .copy { padding-bottom: calc(var(--safe-bottom) + 108px); }
  .headline { font-size: clamp(40px, 11.5vw, 64px); }
  :lang(ar) .headline { font-size: clamp(42px, 12.5vw, 68px); }
  .sub { font-size: 19px; }
  .cta { width: 100%; justify-content: center; min-height: 58px; font-size: 16px; }
  .controls { bottom: calc(var(--safe-bottom) + 28px); }
  .foot { bottom: calc(var(--safe-bottom) + 28px); }

  .sheet {
    width: 100%; max-width: none; max-height: 92svh;
    margin: auto 0 0; inset-inline: 0; border-radius: 28px 28px 0 0; border-bottom: 0;
  }
  .sheet[open] { animation: sheet-up .55s var(--ease); }
  .sheet__inner { padding: 34px 22px calc(var(--safe-bottom) + 24px); }
  @keyframes sheet-up { from { transform: translateY(100%); } }
}

@media (max-height: 560px) and (orientation: landscape) {
  .copy { padding-bottom: 90px; }
  .headline { font-size: clamp(32px, 6vw, 56px); }
  .tag { margin-top: 16px; }
  .cta { margin-top: 14px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .intro, .intro__bars { display: none; }
  .js .media__poster, .js .media__ambient, .js .media__video { animation: none; transform: none; }
  .js .reveal .w, .js .reveal:not(:has(.w)), .js .fade { opacity: 1; transform: none; filter: none; }
  .play .reveal .w, .play .fade { animation: none; }
  .cta__dot { animation: none; }
  .sheet[open] { animation: none; }
  * { transition-duration: .01ms !important; }
}

/* ---------- Simple pages (privacy, thanks, 404) ---------- */
.doc { background: radial-gradient(90% 60% at 50% 0%, rgba(160,100,255,.12), transparent 60%), var(--bg); }
.doc__main { max-width: 680px; margin: 0 auto; padding: calc(var(--safe-top) + 48px) 20px calc(var(--safe-bottom) + 64px); }
.doc h1 { font-size: clamp(28px, 6vw, 40px); font-weight: 500; margin: 0 0 20px; }
.doc p, .doc li { font-size: 16px; line-height: 1.8; color: var(--ink-2); }
.doc strong { color: var(--ink); font-weight: 500; }
.doc ul { padding-inline-start: 20px; }
.doc a { color: var(--accent); }
.doc__back { display: inline-block; margin-bottom: 36px; font-size: 14px; text-decoration: none; color: var(--ink-2) !important; }
.doc__rule { border: 0; height: 1px; background: var(--line); margin: 48px 0; }
.doc--center { display: grid; place-items: center; min-height: 100svh; text-align: center; }
.doc--center .doc__back { margin: 32px 0 0; }
.doc__en { color: var(--ink-3) !important; }

/* ---------- Real logo (image wordmark) ---------- */
.has-logo .brand__name, .has-logo .intro__name { display: none; }
.has-logo .topbar .mark { display: block; width: auto; height: auto; }
.has-logo .topbar .mark img { width: auto; height: 44px; filter: drop-shadow(0 2px 14px rgba(0,0,0,.45)); }

.has-logo .intro__brand { position: relative; }
.has-logo .intro .mark { width: min(440px, 74vw); height: auto; display: block; position: relative; }
.has-logo .intro .mark img {
  width: 100%; height: auto;
  opacity: 0; transform: scale(.94); filter: blur(12px);
  animation: logo-in 1.3s var(--ease) .2s forwards;
}
/* light sweep across the logo */
.has-logo .intro .mark::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.95) 50%, transparent 65%) no-repeat;
  background-size: 250% 100%; background-position: 130% 0;
  -webkit-mask: var(--logo-url) center / 100% 100% no-repeat; mask: var(--logo-url) center / 100% 100% no-repeat;
  animation: sweep 1.2s var(--ease-soft) 1.05s forwards;
}
.has-logo .intro__brand::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 140%; height: 220%;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(138,77,255,.38), rgba(138,77,255,0));
  opacity: 0; animation: fade-in-glow 1.6s var(--ease) .4s forwards;
}
.has-logo .intro {
  background: radial-gradient(90% 70% at 85% 0%, rgba(140,80,220,.35), transparent 60%), #0B0613;
}
@keyframes logo-in { to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes sweep { from { background-position: 130% 0; } to { background-position: -30% 0; } }
@keyframes fade-in-glow { to { opacity: 1; } }

@media (max-width: 720px) {
  .has-logo .topbar .mark img { height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .has-logo .intro .mark img { animation: none; opacity: 1; transform: none; filter: none; }
}
.intro__bars { position: absolute; }
/* desktop: darken the side the text sits on so it never fights the video */
@media (min-width: 721px) {
  .media__shade::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(to left, rgba(8,6,12,.82) 0%, rgba(8,6,12,.55) 32%, rgba(8,6,12,0) 62%);
  }
  [dir="ltr"] .media__shade::after { background: linear-gradient(to right, rgba(8,6,12,.82) 0%, rgba(8,6,12,.55) 32%, rgba(8,6,12,0) 62%); }
}
