/* تَبْصِرَة | TABSIRAH — official download page. Mobile first, RTL. */
@font-face {
  font-family: "Thmanyah Text";
  src: url("/assets/fonts/thmanyah-text-medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Thmanyah Display";
  src: url("/assets/fonts/thmanyah-display-black.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}

:root {
  --ink: #050706;
  --ink-2: #0a110e;
  --emerald: #0f5a40;
  --emerald-hi: #38c48e;
  --gold: #c8a35a;
  --gold-hi: #f0d9a2;
  --gold-deep: #8a6a32;
  --ivory: #f4ede0;
  --muted: #b9b2a3;
  --line: rgba(200, 163, 90, 0.22);
  --card: rgba(16, 30, 24, 0.55);
  --radius: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --text: "Thmanyah Text", "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif;
  --display: "Thmanyah Display", "Thmanyah Text", "Noto Naskh Arabic", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--ink); overflow-x: clip; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--text);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.95;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 900; }
h2 { font-family: var(--display); font-size: clamp(1.7rem, 6vw, 2.6rem); line-height: 1.5; color: var(--gold-hi); text-align: center; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 4px; border-radius: 8px; }

.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 50; background: var(--gold); color: var(--ink); padding: 8px 14px; border-radius: 10px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- ambience (fixed, decorative, never interactive) ---------- */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; contain: strict; }
.sky__glow { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.55; will-change: transform; }
.sky__glow--emerald { width: 120vmax; height: 80vmax; left: 50%; top: -38vmax; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(15, 90, 64, 0.95), rgba(15, 90, 64, 0) 70%); animation: breathe 14s ease-in-out infinite; }
.sky__glow--gold { width: 70vmax; height: 50vmax; left: 50%; bottom: -30vmax; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(200, 150, 70, 0.45), rgba(200, 150, 70, 0) 70%); animation: breathe 18s ease-in-out infinite reverse; }
.sky__pattern {
  position: absolute; inset: 0; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23c8a35a' stroke-width='.7'%3E%3Crect x='24' y='24' width='48' height='48'/%3E%3Crect x='24' y='24' width='48' height='48' transform='rotate(45 48 48)'/%3E%3Ccircle cx='48' cy='48' r='14'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 20%, transparent 75%);
}
@keyframes breathe { 50% { transform: translateX(-50%) scale(1.08); } }

/* the app's own screens, drifting like faint stars (max 20% opacity) */
.sky__screens { position: absolute; inset: 0; }
.star {
  position: absolute; left: var(--x); top: 0;
  width: var(--w); aspect-ratio: 1264 / 2594;
  border-radius: calc(var(--w) * 0.12);
  background: var(--img) center / cover no-repeat, var(--ink-2);
  box-shadow: 0 0 0 1px rgba(200, 163, 90, 0.35), 0 0 calc(var(--w) * 0.5) rgba(56, 196, 142, 0.25);
  opacity: 0;
  will-change: transform, opacity;
  animation: drift var(--dur) linear var(--delay) infinite;
}
@keyframes drift {
  0%   { transform: translate3d(0, 110vh, 0) rotate(var(--r0)) scale(var(--s)); opacity: 0; }
  12%  { opacity: var(--o); }
  50%  { opacity: calc(var(--o) * 0.55); }
  88%  { opacity: var(--o); }
  100% { transform: translate3d(var(--dx), -30vh, 0) rotate(var(--r1)) scale(var(--s)); opacity: 0; }
}

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: linear-gradient(180deg, rgba(5, 7, 6, 0.85), rgba(5, 7, 6, 0));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.bar__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.05rem; }
.bar__brand img { border-radius: 9px; box-shadow: 0 0 0 1px var(--line); }
.bar__latin { font-size: 0.7rem; letter-spacing: 0.32em; color: var(--gold); margin-inline-start: 6px; }
.bar__cta {
  text-decoration: none; font-size: 0.95rem; padding: 6px 18px; border-radius: 999px;
  color: var(--gold-hi); box-shadow: inset 0 0 0 1px rgba(200, 163, 90, 0.55);
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.bar__cta:hover { background: var(--gold); color: var(--ink); }

main, .foot { position: relative; z-index: 1; }

/* ---------- hero ---------- */
.hero {
  min-height: calc(100svh - 56px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px 20px 72px; position: relative; overflow: clip;
}
.hero__mark { position: absolute; top: 2%; left: 50%; width: min(92vw, 520px); transform: translateX(-50%); color: var(--gold); opacity: 0.09; pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent); mask-image: radial-gradient(closest-side, #000 55%, transparent); }
.hero__star { width: 100%; height: auto; animation: spin 140s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero__icon {
  width: 132px; height: 132px; border-radius: 22.5%;
  box-shadow: 0 0 0 1px rgba(240, 217, 162, 0.35), 0 18px 60px rgba(0, 0, 0, 0.65), 0 0 90px rgba(56, 196, 142, 0.35);
  animation: float 7s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-8px); } }
.hero__title { margin-top: 18px; display: flex; flex-direction: column; align-items: center; }
.hero__title img { width: min(82vw, 560px); filter: drop-shadow(0 0 28px rgba(214, 170, 80, 0.35)); }
.hero__latin { font-family: var(--text); font-weight: 500; font-size: 0.82rem; letter-spacing: 0.6em; color: var(--gold); margin-top: 2px; padding-inline-start: 0.6em; }
.hero__tag { margin: 20px 0 6px; font-family: var(--display); font-size: clamp(1.45rem, 6.2vw, 2.15rem); line-height: 1.6;
  background: linear-gradient(100deg, var(--gold-hi), var(--gold) 45%, var(--gold-hi) 70%, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 220% 100%; animation: sheen 9s ease-in-out infinite; }
@keyframes sheen { 50% { background-position: 100% 0; } }
.hero__lead { max-width: 34em; margin: 0 auto 30px; color: var(--muted); font-size: 1.04rem; }
.hero__scroll { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border-radius: 20px; box-shadow: inset 0 0 0 1px rgba(200, 163, 90, 0.5); }
.hero__scroll span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--gold); animation: wheel 2.2s var(--ease) infinite; }
@keyframes wheel { 60% { transform: translateY(12px); opacity: 0; } 61% { transform: none; opacity: 0; } 100% { opacity: 1; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 56px; padding: 12px 30px; border-radius: 999px;
  text-decoration: none; font-size: 1.08rem; line-height: 1.4; -webkit-tap-highlight-color: transparent;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), filter 0.35s var(--ease);
  position: relative; isolation: isolate; overflow: hidden;
}
.btn svg { width: 22px; height: 22px; flex: none; }
.btn span { white-space: nowrap; }
.btn--gold {
  color: #1a1206;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold) 55%, var(--gold-deep));
  box-shadow: 0 10px 34px rgba(200, 163, 90, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn--gold::after { /* a slow glint across the button */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%);
  transform: translateX(-120%); animation: glint 5.5s ease-in-out infinite;
}
@keyframes glint { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.btn--gold:hover { transform: translateY(-2px); box-shadow: 0 16px 44px rgba(200, 163, 90, 0.45), 0 0 0 4px rgba(200, 163, 90, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.btn--gold:active { transform: translateY(1px) scale(0.98); filter: brightness(0.96); }
.btn--xl { min-height: 62px; font-size: 1.14rem; padding-inline: clamp(22px, 6vw, 38px); }

/* ---------- sections ---------- */
section { padding: 72px 20px; }
.ornament { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 18px; }
.ornament span { width: 64px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.ornament span:last-child { transform: scaleX(-1); }
.ornament i { width: 9px; height: 9px; transform: rotate(45deg); box-shadow: 0 0 0 1px var(--gold); }
.about__text { max-width: 38em; margin: 16px auto 40px; text-align: center; color: var(--muted); }

.cards { list-style: none; padding: 0; margin: 0 auto; max-width: 1080px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card {
  position: relative; padding: 20px 16px 18px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20, 40, 31, 0.72), rgba(9, 16, 13, 0.72));
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(120% 80% at 50% 0%, rgba(56, 196, 142, 0.14), transparent 60%); opacity: 0; transition: opacity 0.45s var(--ease); }
.card:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px rgba(240, 217, 162, 0.45), 0 18px 40px rgba(0, 0, 0, 0.45); }
.card:hover::before { opacity: 1; }
.card svg { width: 34px; height: 34px; fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 8px; }
.card h3 { font-family: var(--display); font-size: 1.12rem; line-height: 1.6; color: var(--ivory); }
.card p { margin: 6px 0 0; font-size: 0.9rem; line-height: 1.85; color: var(--muted); }

/* gallery of real screens */
.inside h2 { margin-bottom: 28px; }
.shots {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px 20px 26px; margin: 0 -20px;
  scrollbar-width: thin; scrollbar-color: var(--gold-deep) transparent; -webkit-overflow-scrolling: touch;
}
.shot { flex: 0 0 min(58vw, 240px); margin: 0; scroll-snap-align: center; text-align: center; }
.shot img {
  border-radius: 26px; aspect-ratio: 540 / 1108; object-fit: cover; background: var(--ink-2);
  box-shadow: 0 0 0 6px #0b0d0c, 0 0 0 7px rgba(200, 163, 90, 0.45), 0 24px 50px rgba(0, 0, 0, 0.6);
}
.shot figcaption { margin-top: 18px; color: var(--muted); font-size: 0.92rem; }

/* download */
.download__panel {
  max-width: 680px; margin: 0 auto; text-align: center; padding: 44px 22px 36px; border-radius: 32px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(15, 90, 64, 0.55), rgba(8, 14, 11, 0.9) 70%);
  box-shadow: inset 0 0 0 1px rgba(200, 163, 90, 0.35), 0 30px 80px rgba(0, 0, 0, 0.5);
}
.download__icon { margin: 0 auto 16px; border-radius: 22.5%; box-shadow: 0 0 0 1px rgba(240, 217, 162, 0.35), 0 0 50px rgba(56, 196, 142, 0.35); }
.download__panel p { color: var(--muted); margin: 8px 0 26px; }
.badge { display: block; width: 210px; margin: 22px auto 0; border-radius: 10px; transition: transform 0.35s var(--ease), filter 0.35s var(--ease); }
.badge:hover { transform: translateY(-2px); filter: drop-shadow(0 8px 22px rgba(56, 196, 142, 0.35)); }

/* QR */
.qr h2 { margin-bottom: 28px; }
.qr__grid { display: grid; gap: 18px; max-width: 760px; margin: 0 auto; grid-template-columns: minmax(0, 1fr); }
.qr__card { margin: 0; padding: 24px 18px 20px; border-radius: var(--radius); text-align: center; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.qr__card figcaption { font-family: var(--display); font-size: 1.1rem; color: var(--gold-hi); margin-bottom: 16px; }
.qr__card img { width: min(64vw, 240px); margin: 0 auto; border-radius: 14px; background: #f4ede0; }
.qr__url { display: block; margin: 14px auto 0; font-size: 0.72rem; color: var(--muted); word-break: break-all; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; line-height: 1.6; max-width: 26em; }
.qr__dl { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.qr__dl a { text-decoration: none; font-size: 0.9rem; padding: 6px 16px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(200, 163, 90, 0.5); color: var(--gold-hi); transition: background 0.3s var(--ease), color 0.3s var(--ease); }
.qr__dl a:hover { background: var(--gold); color: var(--ink); }

/* footer */
.foot { text-align: center; padding: 56px 20px calc(36px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(200, 163, 90, 0.16); background: linear-gradient(180deg, transparent, rgba(15, 90, 64, 0.14)); }
.foot img { margin: 0 auto 12px; border-radius: 22.5%; box-shadow: 0 0 0 1px var(--line); }
.foot__name { margin: 0; font-family: var(--display); font-size: 1.25rem; }
.foot__name span { color: var(--gold); margin: 0 6px; }
.foot__tag { margin: 2px 0 14px; color: var(--gold); }
.foot__links { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; }
.foot__links a { color: var(--muted); text-decoration: none; border-bottom: 1px solid rgba(200, 163, 90, 0.35); }
.foot__links a:hover { color: var(--gold-hi); }
.foot__copy { margin: 18px 0 0; color: var(--muted); font-size: 0.9rem; }
.foot__legal { margin: 6px 0 0; color: #6f6a60; font-size: 0.68rem; }

/* scroll reveal (only when JS is running) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }
/* the hero (above the fold) enters by itself with CSS, independent of scripts and scrolling */
.hero .reveal, .js .hero .reveal { opacity: 1; transform: none; transition: none; animation: rise 0.9s var(--ease) both; }
.hero .hero__title { animation-delay: 0.08s; }
.hero .hero__tag { animation-delay: 0.18s; }
.hero .hero__lead { animation-delay: 0.26s; }
.hero .btn { animation-delay: 0.34s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.hero .hero__icon { animation: rise 0.9s var(--ease) both, float 7s ease-in-out 1s infinite; }

/* ---------- larger screens ---------- */
@media (min-width: 700px) {
  body { font-size: 18px; }
  .hero__icon { width: 150px; height: 150px; }
  .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .card { padding: 24px 20px 22px; }
  .qr__grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .shots { justify-content: safe center; }
  .shot { flex-basis: 220px; }
  section { padding: 96px 32px; }
}

/* ---------- motion & contrast preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .sky__screens { display: none; }
  .js .reveal { opacity: 1; transform: none; }
}
