/* App page (/app?app=<slug>): one layout, dressed in each app's own colours and fonts (set by app.js from
   apps-data.js as --bg, --surface, --accent, --body …). Top: the big mark, the name and the store buttons, beside an
   iPhone 17 Pro playing the app's video. Then: about, the screens, the features, a call to action, the other apps. */
:root {
  --bg: #07070a; --solid: #07070a; --surface: rgba(255, 255, 255, .06); --line: rgba(255, 255, 255, .12);
  --text: #f2f2f2; --muted: #a2a4a9; --brand: #e3262d; --accent: #e3262d; --accent2: #ff4a4f; --on-accent: #fff;
  --f1: #3a3a40; --f2: #121216; --r: 22px; --markH: 1;
  --body: 'IBM Plex Sans Arabic', sans-serif; --display: 'IBM Plex Sans Arabic', sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; background: var(--solid); color: var(--text); }
html, body { overflow-x: clip; }
body { font-family: var(--body); -webkit-font-smoothing: antialiased; background: var(--bg); background-attachment: fixed; min-height: 100svh; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--on-accent); }

/* ---------- top bar ---------- */
.bar { position: fixed; inset: 0 0 auto; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px clamp(16px, 4vw, 48px); transition: background .3s, backdrop-filter .3s, border-color .3s; border-bottom: 1px solid transparent; }
.bar.solid { background: color-mix(in srgb, var(--solid) 72%, transparent); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); border-color: var(--line); }
.back { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; transition: transform .25s var(--ease), border-color .25s; }
.back:hover { transform: translateX(3px); border-color: color-mix(in srgb, var(--brand) 60%, transparent); }
.back svg { width: 16px; height: 16px; }
.wm { font: 700 16px/1 'Inter', var(--body); letter-spacing: .02em; white-space: nowrap; opacity: .9; }
.w77 { display: inline-block; height: 1.46em; width: auto; aspect-ratio: 537 / 1324; margin: 0 .06em; vertical-align: -.42em; fill: currentColor; }

/* ---------- hero ---------- */
.hero { position: relative; display: grid; grid-template-columns: 1.08fr .92fr; grid-template-areas: "head device" "actions device";
  align-items: center; column-gap: clamp(24px, 5vw, 80px); min-height: 100svh; padding: clamp(96px, 13vh, 130px) clamp(20px, 6vw, 96px) clamp(40px, 7vh, 80px);
  max-width: 1320px; margin: 0 auto; isolation: isolate; overflow-x: clip; }
.hero-glow { position: absolute; z-index: -1; inset-inline-end: 4%; top: 18%; width: min(46vw, 640px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 42%, transparent), transparent 66%); filter: blur(30px); opacity: .9; animation: glow 8s ease-in-out infinite; }
@keyframes glow { 50% { transform: scale(1.08); opacity: .7; } }
.hero-head { grid-area: head; align-self: end; }
.hero-actions { grid-area: actions; align-self: start; }
.mark { height: calc(var(--markH) * clamp(110px, 13vw, 184px)); width: auto; margin-bottom: clamp(14px, 2.4vh, 26px);
  filter: drop-shadow(0 12px 40px color-mix(in srgb, var(--brand) 55%, transparent)); animation: rise 1s var(--ease) both; }
.mark.icon { border-radius: 22.5%; box-shadow: 0 0 0 1px var(--line), 0 30px 60px -24px color-mix(in srgb, var(--brand) 80%, transparent); filter: none; }
.word-logo { display: inline-block; direction: ltr; margin-bottom: clamp(10px, 2vh, 20px); font: 400 clamp(64px, 9vw, 132px)/.9 'Anton', 'Inter', sans-serif; letter-spacing: .02em; color: var(--text); animation: rise 1s var(--ease) both; }
.word-logo b { font-weight: 400; color: var(--red, #ff2d55); text-shadow: 0 0 30px color-mix(in srgb, var(--red, #ff2d55) 70%, transparent); }
.eyebrow { margin: 0; font: 600 13px/1.4 'Inter', var(--body); letter-spacing: .18em; text-transform: uppercase; color: var(--brand); direction: ltr; text-align: right; animation: rise 1s var(--ease) .06s both; }
.name { margin: 8px 0 0; font-family: var(--display); font-weight: 700; font-size: clamp(42px, 6.2vw, 86px); line-height: 1.12; letter-spacing: -.01em; animation: rise 1s var(--ease) .1s both; }
.gold .name { background: linear-gradient(180deg, #FFE3A6, #F2C46B 45%, #C8923A); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { margin: 16px 0 0; max-width: 34em; font-size: clamp(16px, 1.45vw, 20px); line-height: 1.85; color: var(--muted); text-wrap: pretty; animation: rise 1s var(--ease) .16s both; }
.status { display: inline-flex; align-items: center; gap: 9px; margin: clamp(18px, 3vh, 28px) 0 0; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; animation: rise 1s var(--ease) .22s both; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.status.soon i { background: transparent; border: 1.5px solid var(--muted); box-shadow: none; }
.stores { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; animation: rise 1s var(--ease) .28s both; }

/* store buttons: live = filled with the app's action colour; not yet = outlined, «قريباً» */
.store { position: relative; display: inline-flex; align-items: center; gap: 11px; min-width: 182px; padding: 11px 18px 11px 20px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--surface); transition: transform .25s var(--ease), box-shadow .25s, background .25s; }
.store svg { width: 24px; height: 24px; flex: none; }
.store span { display: grid; line-height: 1.15; }
.store small { font-size: 11.5px; opacity: .78; }
.store b { font: 700 17px/1.2 'Inter', var(--body); letter-spacing: .01em; white-space: nowrap; }
a.store:hover { transform: translateY(-3px); }
.store.live { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--on-accent); border-color: transparent;
  box-shadow: 0 14px 34px -14px color-mix(in srgb, var(--accent) 85%, transparent); }
.store.live:hover { box-shadow: 0 20px 44px -14px color-mix(in srgb, var(--accent) 95%, transparent); }
.store.soon { border-style: dashed; color: var(--muted); cursor: default; }
.store.soon::after { content: "قريباً"; position: absolute; inset-inline-start: 12px; top: -10px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--brand); color: var(--solid); }
.store.web b { font-size: 15px; }

/* ---------- the phone: iPhone 17 Pro ---------- */
.hero-device { grid-area: device; display: grid; place-items: center; perspective: 1400px; padding: 10px 0 30px; animation: rise 1.2s var(--ease) .12s both; }
.device-float { animation: float 7s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-12px); } }
.device { --w: min(clamp(232px, 25vw, 340px), calc((100svh - 240px) * .479)); position: relative; width: var(--w); aspect-ratio: .479; transform-style: preserve-3d;
  transform: rotateY(var(--ry, -8deg)) rotateX(var(--rx, 4deg)); transition: transform .5s var(--ease); }
.frame { position: absolute; inset: 0; border-radius: calc(var(--w) * .165);
  background: linear-gradient(150deg, var(--f1), var(--f2) 40%, var(--f1) 62%, var(--f2));
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .28), inset 0 0 0 4px rgba(0, 0, 0, .35),
    0 60px 120px -40px rgba(0, 0, 0, .75), 0 0 120px -30px color-mix(in srgb, var(--brand) 70%, transparent); }
.frame::before { content: ""; position: absolute; inset: calc(var(--w) * .016); border-radius: calc(var(--w) * .15); background: #050506; }
.screen { position: absolute; inset: calc(var(--w) * .034); border-radius: calc(var(--w) * .133); overflow: hidden; background: #000; }
.screen video, .screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(118deg, rgba(255, 255, 255, .13), transparent 34%); }
.key { position: absolute; width: calc(var(--w) * .014); border-radius: 3px; background: linear-gradient(180deg, var(--f1), var(--f2)); }
.key.l { right: 100%; } .key.r { left: 100%; }
.key.a { top: 18%; height: 6%; } .key.vu { top: 27%; height: 9%; } .key.vd { top: 38%; height: 9%; }
.key.p { top: 28%; height: 13%; } .key.cc { top: 56%; height: 8%; background: #0b0b0d; }
.device-shadow { width: calc(var(--w, 300px) * .9); height: 18px; margin-top: 8px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent); filter: blur(6px); }
.light .device-shadow { background: radial-gradient(closest-side, rgba(38, 51, 102, .3), transparent); }

/* the video bar under the phone: play/pause, a thin line you can drag, the time. In the app's colours */
.vbar { display: flex; align-items: center; gap: 10px; width: calc(var(--w, 300px) * 1.02); max-width: 100%; margin-top: 2px; padding: 7px 14px 7px 7px;
  border-radius: 999px; background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); box-shadow: 0 16px 40px -22px rgba(0, 0, 0, .6); }
[dir="rtl"] .vbar { padding: 7px 7px 7px 14px; }
.vbtn { flex: none; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  color: var(--on-accent); background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 80%, transparent);
  transition: transform .2s var(--ease); }
.vbtn:hover { transform: scale(1.06); }
.vbtn:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.vbtn svg { width: 16px; height: 16px; }
.vbtn .i-pause { display: none; }
.vbtn.is-playing .i-pause { display: block; }
.vbtn.is-playing .i-play { display: none; }
.vtime { flex: none; min-width: 2.6em; font: 500 11.5px/1 'Inter', var(--body); font-variant-numeric: tabular-nums; color: var(--muted); text-align: center; direction: ltr; }
.vtrack { position: relative; flex: 1; height: 22px; display: block; }
.vtrack::before, .vbuf, .vfill { content: ""; position: absolute; inset-inline-start: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 3px; }
.vtrack::before { inset-inline-end: 0; background: color-mix(in srgb, var(--text) 16%, transparent); }
.vbuf { background: color-mix(in srgb, var(--text) 26%, transparent); width: 0; }
.vfill { width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent); }
[dir="rtl"] .vfill { background: linear-gradient(270deg, var(--accent), var(--accent2)); }
.vtrack input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
.vtrack input::-webkit-slider-runnable-track { height: 100%; background: transparent; }
.vtrack input::-moz-range-track { height: 100%; background: transparent; }
.vtrack input::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; margin-top: 4.5px; border-radius: 50%; background: var(--text);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); transition: transform .15s; }
.vtrack input::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.vtrack:hover input::-webkit-slider-thumb, .vtrack input:active::-webkit-slider-thumb { transform: scale(1.25); }
.vtrack input:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; border-radius: 6px; }

/* ---------- sections ---------- */
section.block { max-width: 1240px; margin: 0 auto; padding: clamp(56px, 10vh, 110px) clamp(20px, 6vw, 72px); }
.sec-title { margin: 0 0 clamp(20px, 3vh, 34px); font-family: var(--display); font-weight: 700; font-size: clamp(30px, 3.6vw, 48px); line-height: 1.2; }
.sec-title em { font-style: normal; color: var(--brand); }
.gold .sec-title em { color: #F2C46B; }

.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(24px, 4vw, 60px); align-items: start; }
.lead { margin: 0; font-size: clamp(18px, 1.6vw, 22px); line-height: 2; text-wrap: pretty; }
.role { padding: clamp(22px, 3vw, 32px); border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); }
.role h3 { margin: 0 0 10px; font-size: 15px; letter-spacing: .04em; color: var(--brand); }
.role p { margin: 0; line-height: 1.95; color: var(--muted); text-wrap: pretty; }
.tech { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; direction: ltr; justify-content: flex-end; }
.tech li { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); font: 600 12.5px/1.2 'Inter', var(--body); }

/* the screens: a rail you can swipe or drag, each screen with the app's own corner radius */
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.rail-nav { display: flex; gap: 8px; margin-bottom: clamp(20px, 3vh, 34px); }
.rail-nav button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: grid; place-items: center; transition: transform .2s, background .2s; }
.rail-nav button:hover { background: color-mix(in srgb, var(--brand) 22%, transparent); transform: scale(1.06); }
.rail-nav svg { width: 18px; height: 18px; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(190px, 21vw, 262px); gap: clamp(14px, 1.8vw, 24px); overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none; padding: 14px 4px 34px; cursor: grab;
  -webkit-mask: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); mask: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.rail::-webkit-scrollbar { display: none; }
.rail.drag { cursor: grabbing; scroll-snap-type: none; }
.shot { margin: 0; scroll-snap-align: center; aspect-ratio: 1290 / 2796; border-radius: clamp(22px, 2.4vw, 32px); overflow: hidden; position: relative;
  border: 1px solid var(--line); background: var(--surface); box-shadow: 0 30px 60px -34px rgba(0, 0, 0, .8);
  transition: transform .45s var(--ease), box-shadow .45s; cursor: zoom-in; }
.light .shot { box-shadow: 0 30px 60px -34px rgba(38, 51, 102, .45); }
.shot:hover { transform: translateY(-8px) scale(1.015); box-shadow: 0 40px 70px -30px color-mix(in srgb, var(--brand) 55%, transparent); }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot:nth-child(even) { translate: 0 18px; }

/* features: numbered cards */
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: clamp(12px, 1.6vw, 20px); }
.feat { position: relative; padding: clamp(22px, 2.6vw, 30px); border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s; }
.feat:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--brand) 55%, transparent); }
.feat::before { content: ""; position: absolute; inset: -40% -40% auto auto; width: 180px; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%); }
.feat .n { display: block; font: 700 13px/1 'Inter', var(--body); letter-spacing: .14em; color: var(--brand); direction: ltr; text-align: right; }
.feat h3 { position: relative; margin: 14px 0 8px; font-size: clamp(18px, 1.5vw, 21px); }
.feat p { position: relative; margin: 0; line-height: 1.85; color: var(--muted); text-wrap: pretty; }

/* call to action */
.cta-card { position: relative; display: grid; justify-items: center; text-align: center; gap: 14px; padding: clamp(40px, 6vw, 72px) clamp(20px, 4vw, 48px);
  border-radius: calc(var(--r) * 1.4); border: 1px solid var(--line); overflow: hidden;
  background: radial-gradient(70% 90% at 50% 0%, color-mix(in srgb, var(--brand) 26%, transparent), transparent 70%), var(--surface); }
.cta-card .icon { width: 88px; height: 88px; border-radius: 22.5%; box-shadow: 0 20px 40px -16px color-mix(in srgb, var(--brand) 80%, transparent); }
.cta-card h2 { margin: 6px 0 0; font-family: var(--display); font-size: clamp(28px, 3.4vw, 44px); }
.cta-card p { margin: 0; color: var(--muted); }
.cta-card .stores { justify-content: center; animation: none; }

/* other apps */
.more-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.more-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); transition: transform .25s var(--ease), border-color .25s; }
.more-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 55%, transparent); }
.more-card img, .more-card .tile { width: 48px; height: 48px; border-radius: 22.5%; flex: none; }
.more-card .tile { display: flex; align-items: center; justify-content: center; background: #0d1421; color: #fff; font: 400 15px/1 'Anton', sans-serif; letter-spacing: .04em; direction: ltr; }
.more-card .tile b { font-weight: 400; color: #ff2d55; }
.more-card span { display: grid; gap: 2px; min-width: 0; }
.more-card b { font-size: 15px; }
.more-card small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

footer { padding: 30px 20px 40px; text-align: center; color: var(--muted); font-size: 13px; }
footer a { text-decoration: underline; text-underline-offset: 3px; }

/* the screens, big */
.lightbox { padding: 0; border: 0; background: transparent; max-width: none; max-height: none; width: 100vw; height: 100dvh; }
.lightbox::backdrop { background: color-mix(in srgb, var(--solid) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-height: 88dvh; max-width: 92vw; width: auto; border-radius: 28px; box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .8); }
.lb-btn { position: fixed; top: 50%; translate: 0 -50%; width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; display: grid; place-items: center; }
.lb-btn svg { width: 20px; height: 20px; }
.lb-prev { right: 3vw; } .lb-next { left: 3vw; }
.lb-close { top: 26px; translate: 0; left: 3vw; }

/* entrance */
@keyframes rise { from { opacity: 0; transform: translateY(22px); } }
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- smaller screens: name, then the phone, then the buttons ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; grid-template-areas: "head" "device" "actions"; min-height: auto; text-align: center; justify-items: center; padding-top: 92px; row-gap: 8px; }
  .hero-head, .hero-actions { display: grid; justify-items: center; }
  .eyebrow { text-align: center; }
  .tagline { margin-inline: auto; }
  .stores { justify-content: center; }
  .hero-glow { inset-inline-end: auto; left: 50%; translate: -50% 0; top: 30%; width: 120vw; }
  .device { --w: min(68vw, 300px); }
  .mark { height: calc(var(--markH) * 96px); }
  .about-grid { grid-template-columns: 1fr; }
  .tech { justify-content: flex-start; }
  .shot:nth-child(even) { translate: 0 0; }
  .rail { grid-auto-columns: 62vw; }
  .rail-nav { display: none; }
}
@media (max-width: 520px) {
  .store { min-width: 0; flex: 1 1 150px; }
  .word-logo { font-size: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
