/* موقع فهرس: «مكتبة ليلية» بإضاءة ذهبية، وخط IBM Plex Sans Arabic كما في التطبيق */
:root {
  --bg: #15100d; --surface: #1d1611; --card: #211913; --line: #33261d;
  --ink: #f3e8da; --ink2: #b9a897; --gold: #e2b86c; --accent: #f96161; --on-accent: #1a0f0c; --free: #8fd4a6;
  --r1: 18px; --r2: 12px;
  --font: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.8; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .4em; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--gold); font-size: 14px; font-weight: 600; letter-spacing: .3px; margin-bottom: 14px; }
.eyebrow::before { content: ''; width: 22px; height: 1px; background: currentColor; opacity: .7; }
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none;
  padding: 13px 26px; border-radius: 999px; transition: transform .2s, box-shadow .2s; box-shadow: 0 8px 30px -10px rgba(249, 97, 97, .6); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -10px rgba(249, 97, 97, .7); }
.btn.small { padding: 8px 18px; font-size: 14px; box-shadow: none; }

/* الشريط العلوي */
.top { position: sticky; top: 0; z-index: 50; padding: 14px 0; transition: background .3s, border-color .3s, padding .3s; border-bottom: 1px solid transparent; }
.home .top { position: fixed; inset-inline: 0; }
.top.solid, .top:not(.home .top) { background: rgba(21, 16, 13, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-color: var(--line); padding: 10px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 24px; font-weight: 700; }
.brand img { width: 38px; height: 38px; border-radius: 10px; }
.links { display: none; gap: 28px; margin-inline-start: auto; margin-inline-end: 24px; }
.links a { text-decoration: none; color: var(--ink2); font-size: 15px; transition: color .2s; }
.links a:hover { color: var(--ink); }
.lang { text-decoration: none; color: var(--ink2); font-size: 13px; font-weight: 600; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; margin-inline-start: auto; margin-inline-end: 10px; transition: color .2s, border-color .2s; }
.lang:hover { color: var(--ink); border-color: var(--gold); }
[dir=ltr] .hero h1 { letter-spacing: -1px; }

/* الافتتاحية */
.hero { position: relative; min-height: 100svh; display: grid; align-items: center; padding: 110px 0 60px; overflow: hidden; isolation: isolate; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: -2; opacity: .5;
  background: repeating-linear-gradient(0deg, transparent 0 118px, rgba(226, 184, 108, .06) 118px 120px),
              repeating-linear-gradient(90deg, transparent 0 28px, rgba(255, 255, 255, .012) 28px 30px);
  mask-image: radial-gradient(ellipse at 30% 50%, #000 20%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse at 30% 50%, #000 20%, transparent 70%); }
.glow { position: absolute; z-index: -1; width: 900px; height: 900px; inset-inline-end: -250px; top: -200px; pointer-events: none;
  background: radial-gradient(circle, rgba(226, 184, 108, .18), rgba(249, 97, 97, .06) 40%, transparent 70%); filter: blur(10px); }
.hero-grid { display: grid; gap: 50px; align-items: center; }
.hero h1 { font-size: clamp(40px, 7vw, 76px); letter-spacing: -.5px; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--gold), #f3d9a4 50%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(17px, 2vw, 20px); color: var(--ink2); max-width: 540px; }
.stores { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0; }
.stores.center { justify-content: center; }
.store { display: inline-flex; align-items: center; gap: 10px; padding: 10px 20px 10px 22px; border-radius: 14px; text-decoration: none;
  background: var(--ink); color: #15100d; font-weight: 700; font-size: 18px; line-height: 1.2; transition: transform .2s; }
.store:hover { transform: translateY(-2px); }
.store svg { width: 26px; height: 26px; fill: currentColor; }
.store small { display: block; font-size: 11px; font-weight: 500; opacity: .7; }
.store.soon { background: transparent; color: var(--ink2); border: 1px solid var(--line); }
.nums { display: flex; gap: 36px; margin: 0; }
.nums dt { font-size: 28px; font-weight: 700; color: var(--gold); line-height: 1.2; }
.nums dd { margin: 0; color: var(--ink2); font-size: 14px; }
.nums > div { border-inline-start: 1px solid var(--line); padding-inline-start: 16px; }
.nums > div:first-child { border: 0; padding: 0; }

.hero-art { position: relative; height: 560px; display: grid; place-items: center; }
.phone { position: relative; width: 270px; aspect-ratio: 1206 / 2622; border-radius: 46px; padding: 9px; background: linear-gradient(145deg, #3a2d24, #120d0a 60%, #2a2019);
  box-shadow: 0 0 0 1px rgba(226, 184, 108, .25), 0 40px 80px -20px rgba(0, 0, 0, .8), 0 0 90px -30px rgba(226, 184, 108, .35); }
.phone .screen { position: relative; width: 100%; height: 100%; border-radius: 38px; overflow: hidden; background: #000; }
.phone .screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-phone { z-index: 2; animation: rise 1s cubic-bezier(.2, .8, .2, 1) both; }
.float { position: absolute; width: 130px; border-radius: 8px; overflow: hidden; box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .8); animation: bob 7s ease-in-out infinite; }
.float img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.float.c0 { inset-inline-start: 2%; top: 8%; rotate: -12deg; }
.float.c1 { inset-inline-end: 4%; top: 16%; rotate: 10deg; animation-delay: -2s; width: 115px; }
.float.c2 { inset-inline-start: 8%; bottom: 6%; rotate: 8deg; animation-delay: -4s; width: 110px; }
.float.c3 { inset-inline-end: 0; bottom: 12%; rotate: -8deg; animation-delay: -5.5s; }
@keyframes bob { 50% { translate: 0 -14px; } }
@keyframes rise { from { opacity: 0; translate: 0 40px; } }

/* شريط الأغلفة */
.covers { padding: 30px 0 70px; display: grid; gap: 16px; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee { overflow: hidden; }
.track { display: flex; gap: 16px; width: max-content; animation: slide 70s linear infinite; }
.marquee:nth-child(2) .track { animation-direction: reverse; animation-duration: 85s; }
.track img { width: 110px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; opacity: .85; }
@keyframes slide { to { transform: translateX(50%); } }
[dir=ltr] .track { animation-name: slide-ltr; }
@keyframes slide-ltr { to { transform: translateX(-50%); } }

/* العناوين */
section { padding: 90px 0; }
.sec-head { text-align: center; margin-bottom: 56px; }
.sec-head h2 { font-size: clamp(30px, 4.5vw, 48px); }
.sec-head .eyebrow::after { content: ''; width: 22px; height: 1px; background: currentColor; opacity: .7; }

/* القصة */
.story-grid { display: grid; gap: 40px; }
.story-phone { display: none; }
.step { padding: 26px; border-radius: var(--r1); background: var(--card); border: 1px solid var(--line); }
.step .step-phone { width: 210px; margin: 0 auto 26px; }
.tag { display: inline-flex; align-items: center; gap: 10px; color: var(--gold); font-weight: 600; margin-bottom: 8px; }
.tag b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(226, 184, 108, .45); font-size: 14px; }
.step h3 { font-size: clamp(26px, 3.2vw, 38px); }
.step p { color: var(--ink2); font-size: 18px; max-width: 460px; margin: 0; }

/* المزايا الصغيرة */
.perks { padding-top: 0; }
.grid4 { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
.perk { background: linear-gradient(180deg, var(--card), var(--surface)); border: 1px solid var(--line); border-radius: var(--r1); padding: 24px 20px; }
.perk span { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: rgba(226, 184, 108, .1); color: var(--gold); font-size: 22px; margin-bottom: 14px; }
.perk h3 { font-size: 19px; }
.perk p { color: var(--ink2); font-size: 15px; margin: 0; }

/* المكتبة */
.library { background: linear-gradient(180deg, transparent, var(--surface) 30%, var(--surface) 70%, transparent); }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 26px 18px; margin-bottom: 60px; }
.book img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; box-shadow: 0 16px 30px -12px rgba(0, 0, 0, .9); transition: transform .3s; }
.book:hover img { transform: translateY(-6px) rotate(-1deg); }
.book figcaption { margin-top: 10px; font-size: 14px; line-height: 1.5; }
.book figcaption b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book figcaption span { color: var(--ink2); font-size: 13px; }
.book { margin: 0; }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cat { position: relative; display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r2); padding: 10px 12px; transition: border-color .2s; }
.cat:hover { border-color: rgba(226, 184, 108, .5); }
.cat img { width: 40px; height: 40px; object-fit: contain; }
.cat b { font-size: 14px; line-height: 1.4; }
.cat span { position: absolute; inset-inline-end: 10px; top: 6px; font-size: 11px; color: var(--ink2); display: none; }

/* للكتّاب */
.publish-card { position: relative; display: grid; gap: 40px; padding: 44px 30px; border-radius: 28px; overflow: hidden;
  background: radial-gradient(circle at 90% 0%, rgba(226, 184, 108, .16), transparent 55%), var(--card); border: 1px solid rgba(226, 184, 108, .3); }
.publish-card h2 { font-size: clamp(30px, 4.2vw, 46px); }
.publish-card p { color: var(--ink2); font-size: 18px; max-width: 520px; }
.path { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.path li { position: relative; padding-block: 12px; padding-inline-start: 56px; }
.path li::before { content: attr(data-n); position: absolute; inset-inline-start: 0; top: 12px; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; background: var(--bg); border: 1px solid rgba(226, 184, 108, .5); color: var(--gold); font-weight: 700; }
.path li:not(:last-child)::after { content: ''; position: absolute; inset-inline-start: 19px; top: 52px; bottom: -14px; width: 1px; background: linear-gradient(var(--gold), transparent); opacity: .5; }
.path b { display: block; font-size: 18px; }
.path span { color: var(--ink2); font-size: 14px; }
.partners { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 40px; }
.partners > span { width: 100%; text-align: center; color: var(--ink2); font-size: 14px; margin-bottom: 6px; }
.partner { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px 6px 6px; }
.partner img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.partner b { font-size: 14px; font-weight: 600; }

/* الختام */
.final { position: relative; text-align: center; overflow: hidden; isolation: isolate; padding: 120px 0; }
.final .glow { inset-inline: 0; margin: auto; top: -300px; }
.final-logo { width: 84px; height: 84px; border-radius: 22px; margin: 0 auto 24px; box-shadow: 0 0 60px -10px rgba(249, 97, 97, .6); }
.final h2 { font-size: clamp(34px, 5vw, 56px); }
.final p { color: var(--ink2); font-size: 18px; }

/* التذييل */
.foot { border-top: 1px solid var(--line); padding: 40px 0 50px; color: var(--ink2); font-size: 14px; }
.foot .brand { font-size: 20px; color: var(--ink); margin-bottom: 10px; }
.foot .brand img { width: 30px; height: 30px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 16px 0; }
.foot nav a { text-decoration: none; }
.foot nav a:hover { color: var(--ink); }

/* الوثائق */
.doc { padding: 50px 0 70px; }
.doc h1 { font-size: 38px; }
.doc h2 { font-size: 24px; margin-top: 1.4em; }
.doc p, .doc li { color: var(--ink); }
.doc .note { background: var(--card); border: 1px solid var(--line); border-radius: var(--r2); padding: 12px 14px; color: var(--ink2); }

/* الظهور مع النزول */
.rv { opacity: 0; translate: 0 26px; transition: opacity .8s ease, translate .8s cubic-bezier(.2, .8, .2, 1); }
.rv.in { opacity: 1; translate: 0 0; }

@media (min-width: 700px) {
  .grid4 { grid-template-columns: repeat(4, 1fr); }
  .cat span { display: block; }
}
@media (min-width: 960px) {
  .links { display: flex; }
  .links + .lang { margin-inline-start: 0; }
  .hero-grid { grid-template-columns: 1.05fr 1fr; }
  .hero-art { height: 640px; }
  .phone.hero-phone { width: 300px; }
  .story-grid { grid-template-columns: 1fr 1fr; gap: 80px; }
  .story-phone { display: block; position: sticky; top: calc(50vh - 310px); height: 620px; }
  .phone.big { width: 285px; margin-inline: auto; }
  .story-phone .screen img { opacity: 0; transform: scale(1.04); transition: opacity .6s ease, transform .8s ease; }
  .story-phone .screen img.on { opacity: 1; transform: none; }
  .step { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; background: none; border: 0; padding: 0; opacity: .25; transition: opacity .5s; }
  .step.on { opacity: 1; }
  .step .step-phone { display: none; }
  .publish-card { grid-template-columns: 1.2fr 1fr; padding: 64px; align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rv { opacity: 1; translate: none; }
}
