/* Basirah · بصيرة — landing page
   Implements Basirah.dc.html from the Claude Design project. */

html, body { margin: 0; padding: 0; background: #070d19; }
* { box-sizing: border-box; }
a { color: #34e59a; text-decoration: none; }
a:hover { color: #f3c76b; }
img { display: block; }

/* ---------- Theme ---------- */
.root {
  --bg: #070d19; --bg2: #0c1526; --ink: #f2f6f3; --sub: #9aaba3;
  --accent: #34e59a; --gold: #f3c76b; --line: rgba(255,255,255,.1);
  --navbg: rgba(7,13,25,.62); --stars: 1; --card: rgba(255,255,255,.04);
  position: relative;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Poppins', system-ui, sans-serif;
  overflow-x: clip;
  transition: background .7s ease, color .7s ease;
}
.root.light {
  --bg: #f4f1e8; --bg2: #ebe6d8; --ink: #10231a; --sub: #56645c;
  --accent: #1a7a4c; --gold: #b07d22; --line: rgba(16,35,26,.12);
  --navbg: rgba(244,241,232,.72); --stars: 0; --card: rgba(16,35,26,.04);
}

.accent { color: var(--accent); }
.gold { color: var(--gold); }
.amiri { font-family: 'Amiri', serif; font-size: 16px; }
.grow { flex: 1; }

/* ---------- Backdrop ---------- */
.stars {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  pointer-events: none; z-index: 0;
  opacity: var(--stars); transition: opacity .7s ease;
}
.pattern {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='132' height='132'%3E%3Cg fill='none' stroke='%2334e59a' stroke-opacity='.07'%3E%3Crect x='41' y='41' width='50' height='50'/%3E%3Crect x='41' y='41' width='50' height='50' transform='rotate(45 66 66)'/%3E%3Ccircle cx='66' cy='66' r='11'/%3E%3C/g%3E%3C/svg%3E");
  mask-image: radial-gradient(ellipse at 50% 30%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 10%, transparent 75%);
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 14px clamp(18px,4vw,48px);
  transition: background .4s ease, border-color .4s ease, backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-logo { width: 38px; height: 38px; border-radius: 11px; box-shadow: 0 0 0 1px rgba(243,199,107,.35); }
.brand-name { font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
.nav-links { display: flex; gap: 26px; font-size: 14px; font-weight: 500; flex-wrap: wrap; }
.nav-links a { color: var(--sub); }
.nav-links a:hover { color: var(--ink); }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform .3s; padding: 0;
}
.theme-toggle:hover { transform: rotate(-20deg); }
.theme-toggle .icon-moon { display: none; }
.root.light .theme-toggle .icon-moon { display: block; }
.root.light .theme-toggle .icon-sun { display: none; }
.nav-cta {
  padding: 10px 18px; border-radius: 999px; background: var(--accent);
  color: #06140d; font-weight: 600; font-size: 14px;
  transition: transform .25s, box-shadow .25s;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(52,229,154,.45); color: #06140d; }

/* ---------- Shared ---------- */
.sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.center-stage { display: flex; align-items: center; justify-content: center; }
.split {
  position: relative; width: 100%; max-width: 1180px;
  padding: 70px clamp(20px,5vw,64px) 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%,380px), 1fr));
  gap: clamp(20px,5vw,90px); align-items: center;
}
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.title { margin: 12px 0 0; font-size: clamp(36px,4.6vw,64px); line-height: 1.02; font-weight: 800; letter-spacing: -.03em; }
.lead { margin: 18px 0 0; font-size: clamp(16px,1.4vw,19px); line-height: 1.6; color: var(--sub); max-width: 440px; }
.phone-col { display: flex; justify-content: center; }
.persp { perspective: 1400px; }

/* Phone: crops the device out of the 1242×2688 store screenshots */
.phone {
  position: relative; width: min(300px,33vh); aspect-ratio: 876/1889;
  border-radius: 13%/6%; overflow: hidden; background: #0b0f1a;
  box-shadow: 0 50px 120px -20px rgba(0,0,0,.75);
}
.phone-lg { width: min(330px,36vh); }
.phone-glow { box-shadow: 0 60px 140px -20px rgba(0,0,0,.8), 0 0 90px rgba(52,229,154,.18); }
.phone-edge { box-shadow: 0 60px 140px -20px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.05); will-change: transform; }
.phone-img { position: absolute; width: 141.8%; max-width: none; left: -20.9%; top: -37.1%; }
.hidden { opacity: 0; }

/* Store buttons */
.store-row { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; justify-content: center; }
.store-btn {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 22px 11px 17px; border-radius: 16px;
  background: #000; color: #fff; border: 1px solid rgba(255,255,255,.2);
  transition: transform .25s, box-shadow .25s;
}
.store-btn:hover { transform: translateY(-3px); box-shadow: 0 14px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(52,229,154,.5); color: #fff; }
.store-label { text-align: left; }
.store-small { font-size: 11px; opacity: .8; line-height: 1.2; }
.store-big { font-size: 19px; font-weight: 600; line-height: 1.1; letter-spacing: -.01em; }
.store-btn-lg { padding: 12px 24px 12px 18px; }
.store-btn-lg .store-big { font-size: 20px; }

/* ---------- Hero ---------- */
.hero { position: relative; height: 240vh; z-index: 1; }
.hero-stage { perspective: 1600px; }
.hero-glow {
  position: absolute; left: 50%; top: 62%; width: 1100px; height: 1100px;
  transform: translate(-50%,-50%);
  background: radial-gradient(circle, rgba(52,229,154,.28) 0%, rgba(52,229,154,.08) 35%, transparent 65%);
  pointer-events: none;
}
.hero-text {
  position: absolute; left: 0; right: 0; top: clamp(92px,13vh,150px);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 0 20px; z-index: 3; will-change: transform, opacity;
}
.hero-badge {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 16px 7px 8px; border-radius: 999px;
  border: 1px solid rgba(243,199,107,.3); background: rgba(243,199,107,.08);
  font-size: 13px; font-weight: 500; color: var(--gold);
}
.hero-badge-ar {
  font-family: 'Amiri', serif; font-size: 17px; line-height: 1;
  padding: 3px 10px; border-radius: 999px; background: rgba(243,199,107,.16);
}
.hero-title {
  margin: 22px 0 0; font-size: clamp(46px,7.6vw,108px); line-height: .98;
  font-weight: 800; letter-spacing: -.035em; text-wrap: balance;
}
.glow-accent { color: var(--accent); text-shadow: 0 0 60px rgba(52,229,154,.35); }
.hero-sub {
  margin: 22px 0 0; max-width: 560px; font-size: clamp(16px,1.5vw,20px);
  line-height: 1.55; color: var(--sub); text-wrap: pretty;
}
.hero-phone { position: absolute; left: 50%; top: 54%; }
.hero-phone.side { opacity: 0; z-index: 1; will-change: transform, opacity; }
.hero-phone.center {
  z-index: 2; will-change: transform;
  transform: translate(-50%,-50%) translateY(62vh) rotateX(32deg) scale(1.12);
}
.hero-cap {
  position: absolute; left: 0; right: 0; top: clamp(76px,9vh,110px);
  text-align: center; opacity: 0; z-index: 3; padding: 0 20px;
}
.hero-cap-text { font-size: clamp(26px,3.4vw,46px); font-weight: 700; letter-spacing: -.025em; }

/* ---------- Features ---------- */
.features { position: relative; height: 780vh; z-index: 1; }
.feat-glow {
  position: absolute; right: -10%; top: 50%; width: 1000px; height: 1000px;
  transform: translateY(-50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(52,229,154,.22), transparent 62%);
  transition: background 1s ease; pointer-events: none;
}
.feat-counter { display: flex; align-items: center; gap: 16px; font-size: 14px; font-weight: 600; color: var(--sub); }
.feat-num { color: var(--accent); font-size: 15px; min-width: 22px; }
.feat-track { position: relative; width: 140px; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.feat-bar {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 3px;
}
.feat-texts { position: relative; height: clamp(210px,34vh,320px); margin-top: 26px; }
.feat-text { position: absolute; inset: 0; opacity: 0; }
.feat-text[data-ft="0"] { opacity: 1; }

/* ---------- Day & Night ---------- */
.day-night { position: relative; height: 280vh; z-index: 1; }
.dn-dark-bg { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 60%, #0f2a22 0%, #070d19 60%); }
.dn-light-bg {
  position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(ellipse at 30% 30%, #e6efe2 0%, #f4f1e8 55%, #efe8d6 100%);
}
.dn-texts { position: relative; height: clamp(220px,34vh,320px); }
.dn-text { position: absolute; inset: 0; }
.dn-text-dark { color: #f2f6f3; }
.dn-text-light { opacity: 0; color: #10231a; }
.dn-phone { position: relative; width: min(330px,36vh); aspect-ratio: 876/1889; }
.dn-screen {
  position: absolute; inset: 0; border-radius: 13%/6%; overflow: hidden;
  background: #0b0f1a; box-shadow: 0 60px 140px -20px rgba(0,0,0,.6);
}
.dn-clip { position: absolute; inset: 0; clip-path: inset(0 0 0 100%); }
.dn-line {
  position: absolute; top: -4%; bottom: -4%; left: 100%; width: 2px; margin-left: -1px;
  background: linear-gradient(transparent, #f3c76b 20%, #fff 50%, #f3c76b 80%, transparent);
  box-shadow: 0 0 24px 4px rgba(243,199,107,.6); opacity: 0;
}

/* ---------- Gallery ---------- */
.gallery { position: relative; height: 320vh; z-index: 1; }
.gallery-stage { display: flex; flex-direction: column; justify-content: center; gap: clamp(20px,4vh,44px); }
.gallery-head {
  padding: 60px clamp(20px,5vw,64px) 0; max-width: 1180px; width: 100%; margin: 0 auto;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.gallery-title { margin: 0; font-size: clamp(34px,4.4vw,60px); line-height: 1.02; font-weight: 800; letter-spacing: -.03em; }
.gallery-sub { margin: 0; max-width: 340px; font-size: 16px; line-height: 1.6; color: var(--sub); }
.track {
  display: flex; gap: 24px; width: max-content; will-change: transform;
  padding: 0 max(24px, calc((100vw - 1180px) / 2 + 64px));
}
.track img {
  height: min(60vh,580px); aspect-ratio: 1242/2688; border-radius: 26px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.6);
}

/* ---------- Download ---------- */
.download {
  position: relative; z-index: 1;
  padding: clamp(120px,18vh,200px) 20px clamp(100px,14vh,160px);
  display: flex; flex-direction: column; align-items: center; text-align: center; overflow: hidden;
}
.download-glow {
  position: absolute; left: 50%; top: 45%; width: 900px; height: 900px;
  transform: translate(-50%,-50%);
  background: radial-gradient(circle, rgba(243,199,107,.18), rgba(52,229,154,.08) 40%, transparent 65%);
  pointer-events: none;
}
.reveal {
  position: relative; opacity: 0; transform: translateY(40px);
  transition: opacity 1s ease, transform 1.2s cubic-bezier(.2,.8,.2,1);
}
.reveal.d1 { transition-delay: .1s, .1s; }
.reveal.d2 { transition-delay: .2s, .2s; }
.reveal.d3 { transition-delay: .3s, .3s; }
.reveal.shown { opacity: 1; transform: none; }
.download-logo {
  width: 128px; height: 128px; border-radius: 32px;
  box-shadow: 0 30px 80px -10px rgba(5,77,54,.8), 0 0 0 1px rgba(243,199,107,.4), 0 0 80px rgba(243,199,107,.25);
  transform: translateY(40px) scale(.9);
}
.download-title {
  margin: 36px 0 0; font-size: clamp(40px,6vw,84px); line-height: 1;
  font-weight: 800; letter-spacing: -.035em; text-wrap: balance;
}
.download-sub { margin: 20px 0 0; max-width: 480px; font-size: 18px; line-height: 1.6; color: var(--sub); }
.download-stores { margin-top: 36px; }

/* ---------- Footer ---------- */
.footer {
  position: relative; z-index: 1; border-top: 1px solid var(--line);
  padding: 28px clamp(20px,5vw,64px);
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  font-size: 14px; color: var(--sub);
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-logo { width: 28px; height: 28px; border-radius: 8px; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { color: var(--sub); }
.footer-links a:hover { color: var(--ink); }

/* ---------- Phones ----------
   The design is laid out for desktop; on narrow screens the section links
   are hidden and each slide's text and phone are sized to share one screen. */
@media (max-width: 720px) {
  .nav { gap: 12px; }
  .nav-links { display: none; }
  .split {
    grid-template-columns: 1fr; align-content: center;
    padding-top: 64px; gap: 18px;
  }
  .feat-texts, .dn-texts { height: 190px; margin-top: 14px; }
  .dn-texts { margin-top: 0; }
  .title { font-size: 32px; }
  .lead { font-size: 15px; margin-top: 10px; line-height: 1.55; }
  /* The phone takes whatever height the text leaves (2.157 = 1889/876). */
  .phone-lg, .dn-phone { width: clamp(120px, calc((100svh - 330px) / 2.157), 230px); }
  .features .phone-lg { width: clamp(120px, calc((100svh - 360px) / 2.157), 230px); }
}

/* Short phones (iPhone SE, or Safari with its toolbars showing) */
@media (max-width: 720px) and (max-height: 700px) {
  .split { padding-top: 60px; gap: 12px; }
  .feat-counter { font-size: 12px; }
  .feat-texts, .dn-texts { height: 158px; margin-top: 8px; }
  .dn-texts { margin-top: 0; }
  .eyebrow { font-size: 11px; }
  .title { font-size: 27px; margin-top: 8px; }
  .lead { font-size: 13.5px; margin-top: 8px; line-height: 1.5; }
  .phone-lg, .dn-phone { width: clamp(110px, calc((100svh - 270px) / 2.157), 230px); }
  .features .phone-lg { width: clamp(110px, calc((100svh - 290px) / 2.157), 230px); }
  .hero-text { top: 78px; }
  .hero-title { margin-top: 16px; font-size: 40px; }
  .hero-sub { margin-top: 14px; font-size: 14.5px; }
  .hero .store-row { margin-top: 20px; gap: 10px; }
  .store-btn { padding: 8px 18px 8px 14px; }
  .store-big { font-size: 17px; }
  .gallery-stage { gap: 16px; }
  .gallery-head { padding-top: 64px; }
  .gallery-title { font-size: 28px; }
  .gallery-sub { font-size: 13.5px; }
  .track img { height: min(50svh, 580px); border-radius: 20px; }
}
