/* VUSION v5 — global styles (editorial cinematic).
   Pill buttons, lighter chrome, less neon. */

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: #080A0C;
  color: #F0F0F0;
  font-family: 'Onest', sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scroll-padding-top: 96px; /* anchors clear the fixed nav (84/62px) */
}

/* Skip link — first focusable; visible only on keyboard focus */
.v8-skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 2000;
  transform: translateY(-200%);
  background: #00F0FF; color: #080A0C;
  padding: 10px 16px; border-radius: 8px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  letter-spacing: 0.08em; text-decoration: none;
  transition: transform 180ms cubic-bezier(0.23,1,0.32,1);
}
.v8-skip-link:focus { transform: translateY(0); outline: 2px solid #080A0C; outline-offset: 2px; }

::selection { background: rgba(0, 240, 255, 0.28); color: #F0F0F0; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0a0c0e; }
::-webkit-scrollbar-thumb { background: rgba(0,240,255,0.12); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,240,255,0.28); }

.no-scrollbar { scrollbar-width: thin; scrollbar-color: rgba(0,240,255,0.18) transparent; }
.no-scrollbar::-webkit-scrollbar { height: 8px; }
.no-scrollbar::-webkit-scrollbar-thumb { background: rgba(0,240,255,0.12); border-radius: 4px; }

button { font-family: inherit; }
a { color: inherit; }
img { display: block; }

/* ═══ Pill buttons ═══════════════════════════════════════ */
.v8-pill {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: 'Onest', sans-serif;
  font-size: 14px; font-weight: 500;
  letter-spacing: -0.005em;
  text-decoration: none; cursor: pointer;
  transition:
    transform 200ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 200ms cubic-bezier(0.23, 1, 0.32, 1),
    background-color 180ms ease,
    border-color 180ms ease;
  white-space: nowrap;
  border: 1px solid transparent;
}
.v8-pill-primary {
  background: #00F0FF;
  color: #080A0C;
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 8px 28px rgba(0,240,255,0.18);
}
.v8-pill-primary:active { transform: translateY(0) scale(0.97); }

.v8-pill-light { background: #F0F0F0; color: #080A0C; }
.v8-pill-dark  { background: #0b0c0e; color: #F0F0F0; border: 1px solid rgba(255,255,255,0.06); }

.v8-pill-ghost {
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.v8-pill-ghost:active { transform: scale(0.97); }

.v8-pill-outline { background: transparent; color: #F0F0F0; border: 1.5px solid #F0F0F0; }
.v8-pill-outline:active { transform: scale(0.97); }

/* Hover — pointer devices only. Touch devices get false hover on tap. */
@media (hover: hover) and (pointer: fine) {
  .v8-pill-primary:hover {
    box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 12px 40px rgba(0,240,255,0.30);
    transform: translateY(-2px);
  }
  .v8-pill-light:hover   { background: #f0f0f0; }
  .v8-pill-dark:hover    { background: #18191b; }
  .v8-pill-ghost:hover   { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.32); }
  .v8-pill-outline:hover { background: #F0F0F0; color: #080A0C; }
}

.v8-pill-sm { padding: 8px 16px; font-size: 12px; gap: 6px; }
.v8-pill-lg { padding: 18px 36px; font-size: 15px; gap: 12px; }

/* ═══ Chip — small prompt-style ════════════════════════ */
.v8-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  color: rgba(255,255,255,0.92);
  font-family: 'Onest', sans-serif;
  font-size: 13px; font-weight: 400;
  text-decoration: none;
}

/* ═══ Editorial link — magazine-style ═════════════════ */
.v8-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: #00F0FF;
  text-decoration: none;
  transition: color 180ms ease;
}
.v8-link .v8-link-arrow {
  display: inline-block;
  transition: transform 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
@media (hover: hover) and (pointer: fine) {
  .v8-link:hover { color: #fff; }
  .v8-link:hover .v8-link-arrow { transform: translateX(4px); }
}

/* ═══ Nav drawer ═════════════════════════════════════════ */
.v8-nav-drawer {
  animation: v8-drawer-in 0.28s cubic-bezier(0.23, 1, 0.32, 1) both;
}
@keyframes v8-drawer-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══ Nav links ══════════════════════════════════════════ */
.v8-nav-link {
  transition: color 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
@media (hover: hover) and (pointer: fine) {
  .v8-nav-link:hover { color: rgba(255,255,255,1) !important; }
}
.v8-nav-link:focus-visible { color: rgba(255,255,255,1) !important; }

/* ═══ Footer links ═══════════════════════════════════════ */
.v8-footer-link {
  transition: color 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
@media (hover: hover) and (pointer: fine) {
  .v8-footer-link:hover { color: rgba(255,255,255,0.88) !important; }
}
.v8-footer-link:focus-visible { color: rgba(255,255,255,0.88) !important; }

/* ═══ Focus ═════════════════════════════════════════════ */
:focus { outline: none; }
:focus-visible { outline: 2px solid rgba(0, 240, 255, 0.7); outline-offset: 3px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.1ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ═══ Letterbox cinema bars ══════════════════════════════ */
.v8-letterbox-bar-t,
.v8-letterbox-bar-b {
  position: absolute;
  left: 0; right: 0;
  height: 55%;
  background: #080A0C;
  z-index: 9;
  pointer-events: none;
  will-change: transform;
}
.v8-letterbox-bar-t {
  top: 0;
  animation: v8-gate-open-t 1.1s cubic-bezier(0.23,1,0.32,1) 0ms both;
}
.v8-letterbox-bar-b {
  bottom: 0;
  animation: v8-gate-open-b 1.1s cubic-bezier(0.23,1,0.32,1) 0ms both;
}

/* Frame line — brief cyan seam flash as gate opens */
.v8-letterbox-line {
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: rgba(0,240,255,0.18);
  z-index: 10;
  pointer-events: none;
  transform-origin: center;
  animation: v8-frame-line 0.7s cubic-bezier(0.16,1,0.3,1) 0.45s both;
}

/* ═══ Hero entrance ══════════════════════════════════════ */
/* Delays: bars open at 1100ms; content emerges from 400ms as bars part.   */
/* 60ms stagger gaps (Emil: 30-80ms). Strong ease-out: 0.23,1,0.32,1.     */
.v8-hero-h1        { animation: v8-fade-up 0.9s cubic-bezier(0.23,1,0.32,1) 0.40s both; }
.v8-hero-sub       { animation: v8-fade-up 0.8s cubic-bezier(0.23,1,0.32,1) 0.46s both; }
.v8-hero-arabic    { animation: v8-fade-up 0.7s cubic-bezier(0.23,1,0.32,1) 0.52s both; }
.v8-hero-cta       { animation: v8-fade-up 0.7s cubic-bezier(0.23,1,0.32,1) 0.58s both; }
.v8-hero-audience  { animation: v8-fade-up 0.7s cubic-bezier(0.23,1,0.32,1) 0.64s both; }

/* ═══ Animations ════════════════════════════════════════ */
@keyframes v8-gate-open-t  { from { transform: translateY(0); }    to { transform: translateY(calc(-100% + 44px)); } }
@keyframes v8-gate-open-b  { from { transform: translateY(0); }    to { transform: translateY(calc(100% - 44px));  } }
@keyframes v8-frame-line   { 0% { transform: scaleX(0); opacity: 1; } 65% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes v8-blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
@keyframes v8-fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes v8-fade-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes v8-ken-burns {
  0%   { transform: scale(1.08) translate(-1%, 0); }
  100% { transform: scale(1.18) translate(1%, -1%); }
}
@keyframes v8-pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.85); } }
@keyframes v8-ticker     { from { transform: translateX(0);    } to { transform: translateX(-50%); } }
@keyframes v8-ticker-rev { from { transform: translateX(-50%); } to { transform: translateX(0);    } }

/* Output band — scroll-driven + drag-to-scroll rows */
.v8-out-row {
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  -ms-overflow-style: none;          /* IE/Edge */
  scrollbar-width: none;             /* Firefox */
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.v8-out-row::-webkit-scrollbar { width: 0; height: 0; display: none; }
.v8-out-row.v8-dragging { cursor: grabbing; }
.v8-out-row img, .v8-out-row video { user-select: none; -webkit-user-drag: none; }

/* Tile media zoom + caption (base state) */
.v8-out-media {
  transform: scale(1);
  transition: transform 0.45s cubic-bezier(0.23,1,0.32,1),
              filter 0.45s cubic-bezier(0.23,1,0.32,1);
  will-change: transform;
}
.v8-out-cap {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s cubic-bezier(0.23,1,0.32,1),
              transform 0.4s cubic-bezier(0.23,1,0.32,1);
}
/* Drag hint — fades out after first interaction */
.v8-out-hint {
  opacity: 1;
  transition: opacity 0.5s cubic-bezier(0.23,1,0.32,1);
}
.v8-out-hint.v8-hint-hidden { opacity: 0; pointer-events: none; }

/* ── Use Cases ("What you can direct") — two-column hover masonry ── */
.v8-uc-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  padding: 0 clamp(24px, 5vw, 80px);
  max-width: 1600px; margin: 0 auto;
}

/* Constellation Reel — labels orbit a centered live media core */
.v8-uc-galaxy {
  position: relative;
  height: clamp(520px, 62vw, 780px);
  max-width: 1500px; margin: clamp(28px, 4vw, 56px) auto 0;
  --px: 0; --py: 0;
}
/* Constellation labels (fixed editorial positions; parallax by depth band) */
.v8-uc-stars { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; z-index: 3; }
.v8-uc-star-li {
  position: absolute;
  transform: translate(calc(var(--px) * var(--d) * 5px), calc(var(--py) * var(--d) * 5px));
  transition: transform 0.6s cubic-bezier(0.23,1,0.32,1);   /* damps the mouse follow */
  will-change: transform;
}
.v8-uc-star {
  background: none; border: 0; padding: 8px; margin: 0;
  cursor: pointer; transform: translate(-50%, -50%);   /* anchor at its point */
}
.v8-uc-star-inner { display: inline-block; animation: v8-star-float 9s ease-in-out infinite; animation-delay: calc(var(--i) * -0.73s); }
@keyframes v8-star-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.v8-uc-word {
  font-family: 'DM Serif Display', Georgia, serif; font-style: italic;
  font-size: clamp(15px, 1.55vw, 26px); line-height: 1.0; letter-spacing: -0.01em;
  color: #6b6b6b; white-space: nowrap;
  transition: color 0.35s cubic-bezier(0.23,1,0.32,1), text-shadow 0.35s ease;
}
.v8-uc-star.is-active .v8-uc-word { color: #F0F0F0; text-shadow: 0 0 18px rgba(0,240,255,0.35); }
@media (hover: hover) and (pointer: fine) {
  .v8-uc-star:hover .v8-uc-word { color: rgba(240,240,240,0.85); }
}
.v8-uc-star:focus-visible { outline: 2px solid #00F0FF; outline-offset: 4px; border-radius: 4px; }
/* Centered media core — the live reel (still anchor); titles sit around it */
.v8-uc-core {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: clamp(320px, 60%, 860px); z-index: 1;
}
.v8-uc-core .v8-uc-stage { height: clamp(320px, 42vw, 540px); }
.v8-uc-core .v8-uc-stage-meta { display: none; }   /* the lit constellation label names it */

/* RIGHT — single media, native orientation, rounded, collated swipe */
.v8-uc-stage {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  height: clamp(420px, 46vw, 600px);
}
.v8-uc-card {
  position: relative;
  height: 100%; width: auto; max-width: 100%; max-height: 100%;
  border-radius: 16px; overflow: hidden;
  background: #111416;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
  animation: v8-swipe-in 0.36s cubic-bezier(0.23,1,0.32,1);   /* next clip swipes in */
}
@keyframes v8-swipe-in {
  from { opacity: 0; transform: translateX(7%); }
  to   { opacity: 1; transform: translateX(0); }
}
.v8-uc-stage-meta {
  position: absolute; left: 2px; bottom: -38px;
  display: flex; align-items: baseline; gap: 12px;
}
.v8-uc-dots { display: inline-flex; gap: 6px; align-self: center; }
.v8-uc-dot {
  width: 18px; height: 2px; border-radius: 2px;
  background: rgba(255,255,255,0.22);
  transition: background 0.3s ease, width 0.3s cubic-bezier(0.23,1,0.32,1);
}
.v8-uc-dot.on { background: #00F0FF; width: 26px; }

/* Tablet / mobile — collapse the constellation to media + a wrapped label row */
@media (max-width: 900px) {
  .v8-uc-galaxy { height: auto; display: flex; flex-direction: column; gap: 22px; padding: 0 clamp(20px, 5vw, 40px); }
  .v8-uc-core { position: static; inset: auto; transform: none; width: 100%; border-radius: 0; overflow: visible; box-shadow: none; }
  .v8-uc-core .v8-uc-stage { height: clamp(320px, 86vw, 460px); }
  .v8-uc-core .v8-uc-stage-meta { display: flex; position: static; margin-top: 14px; }
  .v8-uc-stars { position: static; display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: center; }
  .v8-uc-star-li { position: static; transform: none !important; }
  .v8-uc-star { transform: none; padding: 4px 6px; }
  .v8-uc-star-inner { animation: none; }
  .v8-uc-word { font-size: clamp(16px, 4.5vw, 22px); }
}

/* Ambient glow drift */
.v8-out-glow {
  animation: v8-out-glow 22s ease-in-out infinite;
  will-change: transform;
}
@keyframes v8-out-glow {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(3%, -2%, 0); }
}

/* Hover reveal — desktop pointers only, never on touch */
@media (hover: hover) and (pointer: fine) {
  .v8-out-tile:hover .v8-out-media { transform: scale(1.06); filter: brightness(1.08); }
  .v8-out-tile:hover .v8-out-cap   { opacity: 1; transform: translateY(0); }
}
/* Freeze hover effects while a row is being dragged */
.v8-out-row.v8-dragging .v8-out-media { transform: scale(1) !important; filter: none !important; }
.v8-out-row.v8-dragging .v8-out-cap   { opacity: 0 !important; }
@keyframes v8-orbit  { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ═══ Responsive ═════════════════════════════════════════ */
@media (max-width: 1100px) {
  .v8-pricing-grid { grid-template-columns: 1fr !important; }
  .v8-mena-grid { grid-template-columns: 1fr !important; }
  .v8-showcase-row { grid-template-columns: 1fr !important; }
  .v8-mag-grid { grid-template-columns: 1fr !important; gap: 28px !important; }
  .v8-engines-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    grid-auto-rows: 280px !important;
  }
  .v8-engines-grid > a:first-child {
    grid-column: span 2 !important;
    grid-row: span 2 !important;
    min-height: 520px !important;
  }
}
@media (max-width: 900px) {
  .v8-nav-links { display: none !important; }
  .v8-nav-cta { display: none !important; }
  .v8-nav-burger { display: flex !important; }
  .v8-hero-h1 { font-size: clamp(56px, 12vw, 96px) !important; }
  .v8-wb-shell { grid-template-columns: 1fr !important; }
  .v8-wb-canvas { height: auto !important; min-height: 480px !important; }
  .v8-mission-h { font-size: clamp(36px, 6.5vw, 72px) !important; }
  .v8-scout-controls { display: none !important; }
  .v8-engines-grid {
    grid-template-columns: 1fr !important;
    grid-auto-rows: auto !important;
  }
  .v8-engines-grid > a {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
    min-height: 360px !important;
  }
  .v8-engines-grid > a:first-child { min-height: 480px !important; }
  .v8-notif-card { width: calc(100vw - 32px) !important; right: 16px !important; bottom: 16px !important; }
}
@media (max-width: 520px) {
  .v8-hero-h1 { font-size: clamp(40px, 13vw, 72px) !important; }
}

/* ═══ Engine modal — stack the 55/45 split on narrow viewports ═══ */
/* Desktop: side-by-side visual | detail. Mobile: the fixed 660px row would
   clip, so stack to a scrollable column (visual on top, detail fills + scrolls). */
@media (max-width: 760px) {
  .v8-engine-modal { flex-direction: column !important; width: 94vw !important; height: min(88vh, 760px) !important; }
  .v8-engine-modal-visual { flex: 0 0 clamp(180px, 34vh, 260px) !important; }
  .v8-engine-modal-body { flex: 1 1 auto !important; padding: 20px 22px 24px !important; }
}

/* ═══ YALLA bilingual lockup ══════════════════════════════ */
/* Desktop: "YALLA AI │ يلا AI" side by side with a vertical hairline divider
   (set inline). Narrow: stack left-aligned and flip the divider to a short
   horizontal rule so the two language halves never cramp, wrap, or overlap. */
@media (max-width: 560px) {
  .v8-yalla-lockup { flex-direction: column !important; align-items: flex-start !important; gap: 14px !important; }
  .v8-yalla-lockup .v8-yalla-div { width: clamp(40px, 14vw, 64px) !important; height: 1px !important; }
}

/* Reduced motion — collapse all transitions, pause continuous animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .v8-ken-burns { animation: none !important; }
  .v8-ticker-inner { animation: none !important; }
  .v8-out-glow { animation: none !important; transform: none !important; }
  .v8-out-media, .v8-out-cap { transition: none !important; }
  .v8-uc-star-li { transition: none !important; transform: none !important; }
  .v8-uc-star-inner { animation: none !important; }
  .v8-uc-card { animation: none !important; }
  .v8-letterbox-bar-t { animation: none !important; transform: translateY(calc(-100% + 44px)) !important; }
  .v8-letterbox-bar-b { animation: none !important; transform: translateY(calc(100% - 44px)) !important; }
  .v8-letterbox-line  { animation: none !important; opacity: 0 !important; }
  .v8-hero-h1, .v8-hero-sub, .v8-hero-arabic, .v8-hero-cta, .v8-hero-audience { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* ═══ Letterbox bottom-bar metadata row (v8) ═════════════ */
@media (max-width: 760px) {
  .v8-hero-bar-audience { display: none; }
  .v8-letterbox-bar-b > div { padding: 0 20px !important; }
}

/* ═══ MENA hairline columns (v8) ═════════════════════════ */
@media (max-width: 1100px) {
  .v8-mena-cols { grid-template-columns: 1fr !important; }
  .v8-mena-cols .v8-mena-col {
    border-right: none !important;
    border-top: 1px solid rgba(200,169,110,0.18);
    padding: 20px 0 20px !important;
  }
  .v8-mena-cols > *:first-child .v8-mena-col { border-top: none; padding-top: 0 !important; }
}

/* ═══ Merged access ending (v8) ══════════════════════════ */
@media (max-width: 1100px) {
  .v8-access-grid { grid-template-columns: 1fr !important; gap: 48px !important; }
}
