/* ==========================================================================
   Islamic Apps · Privacy Policy
   Theme: deep emerald night + burnished gold, Islamic geometric accents
   ========================================================================== */

:root {
  --emerald-950: #031a14;
  --emerald-900: #062a20;
  --emerald-800: #0a3d2e;
  --emerald-700: #0f5240;
  --emerald-500: #1f8a68;
  --gold-300: #f5d97a;
  --gold-400: #e6c35c;
  --gold-500: #d4af37;
  --gold-700: #9c7a1e;
  --cream: #f7f1e3;

  --bg: var(--emerald-950);
  --bg-alt: rgba(10, 61, 46, 0.35);
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --border: rgba(212, 175, 55, 0.18);
  --border-strong: rgba(212, 175, 55, 0.45);
  --text: #e9efe9;
  --text-soft: #a9bdb3;
  --heading: #fdf8ea;
  --accent: var(--gold-500);
  --accent-glow: rgba(212, 175, 55, 0.35);

  --radius: 18px;
  --radius-lg: 28px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --nav-h: 72px;

  --f-body: "Outfit", "Hind Siliguri", system-ui, sans-serif;
  --f-display: "Cormorant Garamond", Georgia, serif;
  --f-arabic: "Amiri", serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
  --bg: #fbf7ec;
  --bg-alt: rgba(15, 82, 64, 0.05);
  --surface: rgba(255, 255, 255, 0.75);
  --surface-2: #ffffff;
  --border: rgba(156, 122, 30, 0.22);
  --border-strong: rgba(156, 122, 30, 0.5);
  --text: #23372f;
  --text-soft: #5b7068;
  --heading: #0a3d2e;
  --accent: #a8841f;
  --accent-glow: rgba(168, 132, 31, 0.25);
  --shadow: 0 20px 45px -25px rgba(10, 61, 46, 0.35);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 20px); }
body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16.5px;
  overflow-x: hidden;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold-300); }
[data-theme="light"] a:hover { color: var(--emerald-700); }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
::selection { background: var(--gold-500); color: var(--emerald-950); }
svg.lucide { width: 1.15em; height: 1.15em; stroke-width: 1.8; flex-shrink: 0; }

.container { width: min(1200px, 92%); margin-inline: auto; position: relative; z-index: 2; }
.container--narrow { width: min(860px, 92%); }

/* ---------- Background layers ---------- */
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; transition: opacity 0.6s; }
[data-theme="light"] #sky { opacity: 0.25; }

.pattern-overlay {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23d4af37' stroke-width='1'%3E%3Cpath d='M40 4l10 26 26 10-26 10-10 26-10-26L4 40l26-10z'/%3E%3Cpath d='M40 16l7 17 17 7-17 7-7 17-7-17-17-7 17-7z'/%3E%3Ccircle cx='40' cy='40' r='5'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
}
[data-theme="light"] .pattern-overlay { opacity: 0.09; }

/* ---------- Progress bar ---------- */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 100;
  background: linear-gradient(90deg, var(--emerald-500), var(--gold-500), var(--gold-300));
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; height: var(--nav-h); z-index: 50;
  transition: background 0.4s, box-shadow 0.4s, backdrop-filter 0.4s;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 1px 0 var(--border);
}
.nav__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--heading); }
.brand:hover { color: var(--heading); }
.brand__mark { width: 34px; height: 34px; color: var(--gold-500); filter: drop-shadow(0 0 8px var(--accent-glow)); transition: transform 0.6s var(--ease); }
.brand:hover .brand__mark { transform: rotate(-20deg) scale(1.08); }
.brand__text { font-family: var(--f-display); font-size: 1.35rem; font-weight: 700; letter-spacing: 0.3px; }
.brand__text em { font-style: italic; color: var(--accent); font-weight: 500; }

.nav__links { display: flex; gap: 0.3rem; }
.nav__links a {
  color: var(--text-soft); padding: 0.45rem 0.95rem; border-radius: 999px; font-size: 0.95rem; font-weight: 500;
  transition: color 0.25s, background 0.25s;
}
.nav__links a:hover, .nav__links a.is-active { color: var(--heading); background: var(--surface-2); }
.nav__actions { display: flex; gap: 0.4rem; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  color: var(--text); background: var(--surface); border: 1px solid var(--border);
  transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s;
}
.icon-btn:hover { transform: translateY(-2px); border-color: var(--border-strong); background: var(--surface-2); }
.ico-light { display: none; }
[data-theme="light"] .ico-light { display: block; }
[data-theme="light"] .ico-dark { display: none; }
.nav__burger { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.85rem 1.6rem; border-radius: 999px;
  font-weight: 600; font-size: 0.98rem; letter-spacing: 0.2px; position: relative; overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s, background 0.3s, color 0.3s, border-color 0.3s;
}
.btn--gold {
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500) 55%, var(--gold-700));
  color: var(--emerald-950); box-shadow: 0 10px 30px -10px var(--accent-glow);
}
.btn--gold::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  transition: transform 0.8s var(--ease);
}
.btn--gold:hover { color: var(--emerald-950); transform: translateY(-3px); box-shadow: 0 16px 40px -12px var(--accent-glow); }
.btn--gold:hover::after { transform: translateX(120%); }
.btn--ghost { border: 1px solid var(--border-strong); color: var(--heading); background: var(--surface); backdrop-filter: blur(6px); }
.btn--ghost:hover { color: var(--heading); transform: translateY(-3px); border-color: var(--accent); background: var(--surface-2); }
.btn--sm { padding: 0.5rem 1rem; font-size: 0.86rem; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh; display: grid; place-items: center; position: relative; text-align: center;
  padding: calc(var(--nav-h) + 40px) 0 90px; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(ellipse 60% 50% at 50% 40%, rgba(31, 138, 104, 0.35), transparent 70%),
    radial-gradient(ellipse 40% 30% at 50% 45%, rgba(212, 175, 55, 0.12), transparent 70%);
}
[data-theme="light"] .hero::before {
  background:
    radial-gradient(ellipse 60% 50% at 50% 40%, rgba(31, 138, 104, 0.15), transparent 70%),
    radial-gradient(ellipse 40% 30% at 50% 45%, rgba(212, 175, 55, 0.18), transparent 70%);
}
.mandala {
  position: absolute; width: min(760px, 130vw); aspect-ratio: 1; top: 50%; left: 50%;
  transform: translate(-50%, -50%); z-index: 1; opacity: 0.55;
  animation: spin 120s linear infinite;
  filter: drop-shadow(0 0 20px rgba(212,175,55,.25));
}
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.hero__content { z-index: 3; max-width: 880px; }
.bismillah {
  font-family: var(--f-arabic); font-size: clamp(1.9rem, 4.5vw, 3.1rem); line-height: 1.6;
  background: linear-gradient(120deg, var(--gold-300), var(--gold-500), var(--gold-300));
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 6s linear infinite; filter: drop-shadow(0 2px 14px rgba(212,175,55,.3));
}
[data-theme="light"] .bismillah { background-image: linear-gradient(120deg, var(--gold-700), var(--gold-500), var(--gold-700)); }
@keyframes shimmer { to { background-position: 200% center; } }
.hero__translation { color: var(--text-soft); font-style: italic; font-size: 0.95rem; letter-spacing: 0.4px; margin-top: 0.2rem; }
.hero__title {
  font-family: var(--f-display); font-weight: 700; color: var(--heading);
  font-size: clamp(3.2rem, 9vw, 6.5rem); line-height: 1; margin: 1.6rem 0 1.2rem; letter-spacing: -1px;
}
.shine {
  background: linear-gradient(100deg, var(--heading) 20%, var(--gold-400) 40%, var(--heading) 60%);
  background-size: 250% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 5s ease-in-out infinite;
}
.hero__lead { color: var(--text-soft); font-size: clamp(1.02rem, 1.8vw, 1.2rem); max-width: 680px; margin-inline: auto; }
.hero__lead strong { color: var(--heading); font-weight: 600; }
.hero__chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.6rem; margin: 2rem 0 2.2rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.45rem 1rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-size: 0.88rem; color: var(--text-soft);
  backdrop-filter: blur(8px);
}
.chip b { color: var(--heading); font-weight: 600; }
.chip svg { color: var(--accent); }
.hero__cta { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.9rem; }

/* Lanterns */
.lantern { position: absolute; top: 0; z-index: 2; transform-origin: top center; animation: swing 5s ease-in-out infinite; }
.lantern--l { left: 3%; animation-delay: -1.5s; }
.lantern--r { right: 3%; }
.lantern__chain { display: block; width: 2px; height: 120px; margin: 0 auto; background: linear-gradient(var(--gold-700), var(--gold-500)); }
.lantern--r .lantern__chain { height: 80px; }
.lantern__body {
  display: block; width: 46px; height: 74px; position: relative;
  background: radial-gradient(ellipse at center, #ffe9a8 0%, #f2b84b 45%, #a8630f 100%);
  clip-path: polygon(30% 0, 70% 0, 100% 22%, 88% 85%, 62% 100%, 38% 100%, 12% 85%, 0 22%);
  box-shadow: 0 0 40px 12px rgba(255, 196, 87, 0.45);
  filter: drop-shadow(0 0 22px rgba(255, 200, 90, 0.75));
  animation: flicker 3s ease-in-out infinite;
}
.lantern__body::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 9px, rgba(90, 50, 5, 0.45) 9px 11px);
}
@keyframes swing { 0%,100% { transform: rotate(4deg); } 50% { transform: rotate(-4deg); } }
@keyframes flicker { 0%,100% { opacity: 1; } 45% { opacity: .85; } 55% { opacity: .95; } }

.scroll-cue { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 3; width: 26px; height: 42px; border: 2px solid var(--border-strong); border-radius: 20px; }
.scroll-cue span { position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px; border-radius: 4px; background: var(--accent); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Sections ---------- */
.section { padding: clamp(70px, 10vw, 120px) 0; position: relative; }
.section--alt { background: var(--bg-alt); }
.section--alt::before, .section--alt::after {
  content: ""; position: absolute; left: 0; right: 0; height: 14px; z-index: 2; opacity: 0.6;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14'%3E%3Cpath d='M0 7 L7 0 L14 7 L21 0 L28 7 L21 14 L14 7 L7 14 Z' fill='none' stroke='%23d4af37' stroke-width='1'/%3E%3C/svg%3E") repeat-x center;
}
.section--alt::before { top: 0; }
.section--alt::after { bottom: 0; }

.section__head { text-align: center; max-width: 680px; margin: 0 auto clamp(40px, 6vw, 64px); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.7rem; text-transform: uppercase; letter-spacing: 3px;
  font-size: 0.78rem; font-weight: 600; color: var(--accent);
}
.eyebrow::before, .eyebrow::after { content: ""; width: 26px; height: 1px; background: currentColor; opacity: 0.6; }
.section__head h2 {
  font-family: var(--f-display); font-size: clamp(2.3rem, 5vw, 3.5rem); line-height: 1.1;
  color: var(--heading); margin: 0.6rem 0 0.8rem; font-weight: 700;
}
.section__head p { color: var(--text-soft); }
.section__head p b { color: var(--heading); font-weight: 600; }

/* ---------- Glance cards ---------- */
.glance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.3rem; }
.glance {
  position: relative; padding: 2rem 1.8rem; border-radius: var(--radius-lg); background: var(--surface);
  border: 1px solid var(--border); backdrop-filter: blur(10px); overflow: hidden;
  transition: transform 0.5s var(--ease), border-color 0.4s, box-shadow 0.5s;
}
.glance::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; opacity: 0;
  background: conic-gradient(from var(--a, 0deg), transparent 0 70%, var(--gold-400), transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  transition: opacity 0.4s;
}
.glance:hover { transform: translateY(-8px); box-shadow: var(--shadow); border-color: transparent; }
.glance:hover::before { opacity: 1; animation: rotateBorder 3s linear infinite; }
@property --a { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes rotateBorder { to { --a: 360deg; } }
.glance__icon {
  width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 1.2rem; font-size: 1.5rem;
  color: var(--gold-300); position: relative;
}
.glance__icon::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(135deg, var(--emerald-700), var(--emerald-900));
  clip-path: polygon(50% 0, 64% 15%, 85% 15%, 85% 36%, 100% 50%, 85% 64%, 85% 85%, 64% 85%, 50% 100%, 36% 85%, 15% 85%, 15% 64%, 0 50%, 15% 36%, 15% 15%, 36% 15%);
  transition: transform 0.8s var(--ease);
}
.glance:hover .glance__icon::before { transform: rotate(45deg); }
.glance h3 { font-family: var(--f-display); font-size: 1.55rem; color: var(--heading); margin-bottom: 0.4rem; font-weight: 700; }
.glance p { color: var(--text-soft); font-size: 0.97rem; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.search {
  flex: 1 1 320px; display: flex; align-items: center; gap: 0.7rem; padding: 0 1.1rem; height: 54px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(8px);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }
.search svg { color: var(--accent); }
.search input { flex: 1; background: none; border: 0; outline: 0; color: var(--heading); font: inherit; min-width: 0; }
.search input::placeholder { color: var(--text-soft); opacity: 0.8; }
.search kbd { font-family: inherit; font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 6px; border: 1px solid var(--border); color: var(--text-soft); }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.35rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.filter { padding: 0.55rem 1.1rem; border-radius: 999px; font-size: 0.9rem; font-weight: 500; color: var(--text-soft); transition: all 0.3s var(--ease); display: inline-flex; gap: 0.4rem; align-items: center; }
.filter:hover { color: var(--heading); }
.filter.is-active { background: linear-gradient(135deg, var(--gold-400), var(--gold-700)); color: var(--emerald-950); box-shadow: 0 6px 18px -8px var(--accent-glow); }
.filter__n { font-size: 0.75rem; padding: 0 0.45rem; border-radius: 999px; background: rgba(0,0,0,.15); }

/* ---------- App cards ---------- */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.1rem; }
.app-card {
  position: relative; display: flex; flex-direction: column; gap: 0.9rem; padding: 1.3rem; text-align: left;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(10px);
  transition: transform 0.45s var(--ease), border-color 0.3s, box-shadow 0.45s, opacity 0.4s;
  animation: cardIn 0.6s var(--ease) both; animation-delay: calc(var(--i) * 40ms);
  transform-style: preserve-3d;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(24px) scale(.97); } }
.app-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow), 0 0 0 1px var(--border-strong); }
.app-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 18px 40px -18px var(--accent-glow); }
.app-card.is-selected::after {
  content: "✓"; position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.8rem; font-weight: 700;
  background: var(--accent); color: var(--emerald-950);
}
.app-card__top { display: flex; gap: 0.95rem; align-items: center; }
.app-card__icon {
  width: 62px; height: 62px; border-radius: 16px; flex-shrink: 0; object-fit: cover;
  box-shadow: 0 8px 20px -8px rgba(0,0,0,.6); background: var(--surface-2);
  transition: transform 0.5s var(--ease);
}
.app-card:hover .app-card__icon { transform: scale(1.08) rotate(-3deg); }
.app-card__name { font-weight: 600; color: var(--heading); line-height: 1.35; font-size: 1rem; }
.app-card__bn { font-family: "Hind Siliguri", var(--f-body); font-size: 0.85rem; color: var(--accent); line-height: 1.35; margin: 0.1rem 0 0.15rem; }
.app-card__pkg { font-size: 0.72rem; color: var(--text-soft); word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; opacity: 0.85; }
.app-card__tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag { font-size: 0.72rem; padding: 0.2rem 0.6rem; border-radius: 999px; background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border); display: inline-flex; align-items: center; gap: 0.25rem; }
.tag--gold { color: var(--accent); border-color: var(--border-strong); }
.tag svg { width: 0.9em; height: 0.9em; }
.app-card__foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 0.8rem; border-top: 1px dashed var(--border); font-size: 0.85rem; }
.app-card__view { color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 0.3rem; }
.app-card__view svg { transition: transform 0.3s var(--ease); }
.app-card:hover .app-card__view svg { transform: translateX(4px); }
.app-card__play { color: var(--text-soft); display: inline-flex; padding: 0.3rem; border-radius: 8px; }
.app-card__play:hover { color: var(--heading); background: var(--surface-2); }
.select {
  position: relative; display: flex; align-items: center; gap: 0.5rem; height: 48px; padding: 0 2.4rem 0 1rem;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-soft);
  transition: border-color 0.3s;
}
.select:focus-within { border-color: var(--accent); }
.select svg { color: var(--accent); }
.select select { appearance: none; -webkit-appearance: none; background: none; border: 0; outline: 0; color: var(--heading); font: inherit; font-size: 0.9rem; cursor: pointer; }
.select select option, .select select optgroup { background: var(--emerald-900); color: #fff; }
.select select { max-width: 240px; text-overflow: ellipsis; }
[data-theme="light"] .select select option { background: #fff; color: #23372f; }
.select__chev { position: absolute; right: 0.9rem; pointer-events: none; }
.result-meta { color: var(--text-soft); font-size: 0.9rem; margin: -0.8rem 0 1.2rem; }
.result-meta b { color: var(--heading); }
.more-wrap { display: flex; justify-content: center; margin-top: 2rem; }
.empty { text-align: center; color: var(--text-soft); padding: 3rem 0; display: flex; gap: 0.5rem; justify-content: center; align-items: center; }

/* ---------- Selected banner ---------- */
.selected {
  position: relative; z-index: 20; margin-bottom: 2rem;
  display: flex; align-items: center; gap: 1rem; padding: 0.9rem 1.1rem; border-radius: var(--radius);
  background: color-mix(in srgb, var(--emerald-800) 88%, transparent); border: 1px solid var(--border-strong);
  backdrop-filter: blur(14px); box-shadow: var(--shadow); animation: slideDown 0.5s var(--ease);
}
[data-theme="light"] .selected { background: color-mix(in srgb, #ffffff 92%, transparent); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-14px); } }
.selected__icon { width: 52px; height: 52px; border-radius: 14px; }
.selected__info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.selected__label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--accent); }
.selected__name { color: var(--heading); font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selected__pkg { font-size: 0.75rem; align-self: flex-start; white-space: normal; word-break: break-all; margin-top: 0.2rem; }
.selected__actions { display: flex; gap: 0.5rem; align-items: center; }

/* ---------- Policy layout ---------- */
.policy-layout { display: grid; grid-template-columns: 270px 1fr; gap: 2.5rem; align-items: start; }
.toc { position: sticky; top: calc(var(--nav-h) + 24px); }
.toc__inner { padding: 1.4rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(10px); max-height: calc(100vh - var(--nav-h) - 60px); overflow: auto; }
.toc__title { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; color: var(--heading); margin-bottom: 0.8rem; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 2px; }
.toc__title svg { color: var(--accent); }
.toc ol { list-style: none; counter-reset: toc; display: flex; flex-direction: column; gap: 2px; }
.toc li { counter-increment: toc; }
.toc a {
  display: flex; gap: 0.6rem; padding: 0.42rem 0.6rem; border-radius: 10px; font-size: 0.88rem; color: var(--text-soft);
  border-left: 2px solid transparent; transition: all 0.25s var(--ease); line-height: 1.4;
}
.toc a::before { content: counter(toc, decimal-leading-zero); font-size: 0.75rem; color: var(--accent); opacity: 0.7; font-variant-numeric: tabular-nums; padding-top: 1px; }
.toc a:hover { color: var(--heading); background: var(--surface-2); }
.toc a.is-active { color: var(--heading); background: var(--surface-2); border-left-color: var(--accent); }
.toc__print { width: 100%; justify-content: center; margin-top: 1rem; }

.policy { display: flex; flex-direction: column; gap: 1.3rem; counter-reset: sec; }
.p-sec {
  counter-increment: sec; position: relative; padding: 2rem 2.2rem 2rem 2.2rem; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(10px);
  transition: border-color 0.4s, box-shadow 0.4s;
}
.p-sec:hover { border-color: var(--border-strong); }
.p-sec.is-current { border-color: var(--border-strong); box-shadow: 0 0 0 1px var(--border-strong), var(--shadow); }
.p-sec h3 {
  font-family: var(--f-display); font-size: clamp(1.6rem, 3vw, 2rem); color: var(--heading); font-weight: 700;
  display: flex; align-items: center; gap: 0.85rem; margin-bottom: 1rem; line-height: 1.2;
}
.p-sec h3 .sec-ico {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; font-size: 1.15rem;
  background: linear-gradient(135deg, var(--emerald-700), var(--emerald-900)); color: var(--gold-300);
  border: 1px solid var(--border-strong);
}
.p-sec h3 .sec-num { font-family: var(--f-body); font-size: 0.8rem; color: var(--accent); font-weight: 600; letter-spacing: 1px; margin-left: auto; opacity: 0.7; }
.p-sec h4 { color: var(--heading); font-weight: 600; margin: 1.3rem 0 0.4rem; font-size: 1.05rem; }
.p-sec p { margin-bottom: 0.9rem; }
.p-sec p:last-child { margin-bottom: 0; }
.p-sec b { color: var(--heading); font-weight: 600; }
.muted { color: var(--text-soft); font-size: 0.93rem; }
.js-app.is-personal { color: var(--accent); background: var(--accent-glow); padding: 0 0.35rem; border-radius: 6px; transition: background 0.3s; }

.list-check { list-style: none; display: grid; gap: 0.55rem; margin: 0.6rem 0 1rem; }
.list-check li { position: relative; padding-left: 1.9rem; }
.list-check li::before {
  content: ""; position: absolute; left: 0; top: 0.42em; width: 16px; height: 16px;
  background: var(--accent);
  clip-path: polygon(50% 0, 61% 35%, 100% 50%, 61% 65%, 50% 100%, 39% 65%, 0 50%, 39% 35%);
}

.table-wrap { overflow-x: auto; margin: 0.8rem 0 1rem; border-radius: 14px; border: 1px solid var(--border); }
.perm-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.perm-table th, .perm-table td { padding: 0.85rem 1rem; text-align: left; vertical-align: top; }
.perm-table thead { background: var(--surface-2); }
.perm-table th { color: var(--heading); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 1px; }
.perm-table tbody tr { border-top: 1px solid var(--border); transition: background 0.2s; }
.perm-table tbody tr:hover { background: var(--surface); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82em; padding: 0.15rem 0.45rem; border-radius: 6px; background: var(--surface-2); color: var(--accent); border: 1px solid var(--border); white-space: nowrap; }

.partners { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.8rem; margin: 1rem 0; }
.partner {
  display: flex; align-items: center; gap: 0.85rem; padding: 0.95rem 1.1rem; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); transition: all 0.3s var(--ease);
}
.partner:hover { color: var(--text); border-color: var(--accent); transform: translateY(-3px); }
.partner > svg:first-child { color: var(--accent); font-size: 1.3rem; }
.partner span { display: flex; flex-direction: column; flex: 1; line-height: 1.3; }
.partner b { font-size: 0.93rem; }
.partner small { color: var(--text-soft); font-size: 0.78rem; }
.partner__ext { opacity: 0.4; font-size: 0.85rem; }

.callout {
  display: flex; gap: 1rem; padding: 1.2rem 1.3rem; border-radius: 16px; margin: 1rem 0;
  background: linear-gradient(135deg, rgba(212,175,55,.12), rgba(212,175,55,.03)); border: 1px solid var(--border-strong);
}
.callout > svg { color: var(--accent); font-size: 1.4rem; margin-top: 0.15rem; }
.callout b { color: var(--heading); }
.callout > div > b:first-child { display: block; margin-bottom: 0.25rem; }
.callout p { font-size: 0.94rem; color: var(--text-soft); margin: 0; }
.callout--soft { background: linear-gradient(135deg, rgba(31,138,104,.18), rgba(31,138,104,.04)); border-color: rgba(31,138,104,.4); }

.rights { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0 1.2rem; }
.rights span { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.55rem 0.95rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 0.9rem; transition: all 0.3s; }
.rights span:hover { border-color: var(--accent); color: var(--heading); }
.rights svg { color: var(--accent); }

.covered {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.55rem; margin: 1rem 0;
  max-height: 440px; overflow-y: auto; padding: 0.2rem 0.6rem 0.8rem 0.2rem;
  mask-image: linear-gradient(#000 92%, transparent); -webkit-mask-image: linear-gradient(#000 92%, transparent);
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.covered__item {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.7rem; border-radius: 12px; font-size: 0.86rem;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); text-align: left; transition: all 0.25s var(--ease);
}
.covered__item:hover { border-color: var(--accent); transform: translateX(3px); }
.covered__item.is-selected { border-color: var(--accent); background: var(--accent-glow); }
.covered__item img { width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; }
.covered__item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.covered__group { grid-column: 1 / -1; position: sticky; top: -0.2rem; z-index: 1; padding: 0.35rem 0; background: color-mix(in srgb, var(--bg) 92%, transparent); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 2px; color: var(--accent); margin-top: 0.6rem; font-weight: 600; }

.contact-list { list-style: none; display: grid; gap: 0.6rem; margin-top: 0.8rem; }
.contact-list li { display: flex; align-items: center; gap: 0.7rem; }
.contact-list svg { color: var(--accent); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 0.8rem; }
.faq__item { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(10px); overflow: hidden; transition: border-color 0.3s; }
.faq__item[open] { border-color: var(--border-strong); }
.faq__item summary {
  list-style: none; cursor: pointer; padding: 1.2rem 1.4rem; font-weight: 600; color: var(--heading);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary svg { color: var(--accent); transition: transform 0.4s var(--ease); }
.faq__item[open] summary svg { transform: rotate(135deg); }
.faq__item p { padding: 0 1.4rem 1.3rem; color: var(--text-soft); animation: fadeIn 0.4s var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- Contact card ---------- */
.contact-card {
  position: relative; text-align: center; padding: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 5vw, 3.5rem);
  border-radius: 32px; overflow: hidden; border: 1px solid var(--border-strong);
  background: linear-gradient(145deg, var(--emerald-800), var(--emerald-950));
}
[data-theme="light"] .contact-card { background: linear-gradient(145deg, #0f5240, #062a20); }
.contact-card__glow { position: absolute; width: 420px; height: 420px; top: -200px; left: 50%; transform: translateX(-50%); background: radial-gradient(circle, rgba(212,175,55,.35), transparent 65%); pointer-events: none; }
.contact-card::after { content: ""; position: absolute; inset: 0; opacity: 0.08; pointer-events: none; background: inherit; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M30 2l8 20 20 8-20 8-8 20-8-20-20-8 20-8z' fill='none' stroke='%23d4af37'/%3E%3C/svg%3E"); }
.contact-card > *:not(.contact-card__glow) { position: relative; z-index: 1; }
.contact-card__icon { font-size: 2.6rem; color: var(--gold-300); margin-bottom: 1rem; }
.contact-card h2 { font-family: var(--f-display); font-size: clamp(2rem, 4.5vw, 3rem); color: #fdf8ea; margin-bottom: 0.5rem; }
.contact-card p { color: #b8cbc1; margin-bottom: 1.8rem; }
.contact-card .btn--ghost { color: #fdf8ea; border-color: rgba(212,175,55,.5); background: rgba(255,255,255,.05); }
.contact-card__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.8rem; }

/* ---------- Footer ---------- */
.footer { position: relative; z-index: 2; padding: 4rem 0 2.5rem; text-align: center; background: linear-gradient(transparent, rgba(0,0,0,.25)); }
[data-theme="light"] .footer { background: linear-gradient(transparent, rgba(15,82,64,.06)); }
.footer__border { height: 20px; margin-bottom: 3rem; opacity: 0.5; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20'%3E%3Cpath d='M0 10 Q10 0 20 10 T40 10' fill='none' stroke='%23d4af37'/%3E%3Ccircle cx='20' cy='10' r='2' fill='%23d4af37'/%3E%3C/svg%3E") repeat-x center; }
.footer__ayah { font-family: var(--f-arabic); font-size: clamp(1.5rem, 3.5vw, 2.1rem); color: var(--accent); line-height: 1.8; }
.footer__ayah-tr { color: var(--text-soft); font-style: italic; max-width: 600px; margin: 0.4rem auto 1.8rem; font-size: 0.95rem; }
.footer__links { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.7rem; color: var(--text-soft); margin-bottom: 1rem; }
.footer__links a { color: var(--text); }
.footer__links a:hover { color: var(--accent); }
.footer__copy { color: var(--text-soft); font-size: 0.85rem; opacity: 0.8; }

/* ---------- Floating UI ---------- */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 40; width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center; color: var(--emerald-950);
  background: linear-gradient(135deg, var(--gold-300), var(--gold-700)); box-shadow: 0 10px 30px -8px var(--accent-glow);
  opacity: 0; transform: translateY(20px) scale(.8); pointer-events: none; transition: all 0.4s var(--ease);
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { transform: translateY(-4px); }
.toast {
  position: fixed; left: 50%; bottom: 30px; z-index: 60; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  padding: 0.8rem 1.4rem; border-radius: 999px; background: var(--heading); color: var(--bg); font-weight: 500; font-size: 0.92rem;
  box-shadow: var(--shadow); transition: all 0.4s var(--ease); display: flex; align-items: center; gap: 0.5rem;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .policy-layout { grid-template-columns: 1fr; }
  .toc { position: static; }
  .toc__inner { max-height: none; }
  .toc ol { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .lantern { display: none; }
}
@media (max-width: 820px) {
  .nav__burger { display: grid; }
  .nav__links {
    position: fixed; top: var(--nav-h); left: 4%; right: 4%; flex-direction: column; padding: 0.8rem;
    border-radius: var(--radius); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(18px);
    border: 1px solid var(--border); box-shadow: var(--shadow);
    opacity: 0; transform: translateY(-12px); pointer-events: none; transition: all 0.35s var(--ease);
  }
  .nav__links.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav__links a { padding: 0.8rem 1rem; }
  .selected { flex-wrap: wrap; }
  .selected__actions { width: 100%; justify-content: flex-end; }
  .p-sec { padding: 1.5rem 1.3rem; }
  .p-sec h3 .sec-num { display: none; }
}
@media (max-width: 520px) {
  body { font-size: 15.5px; }
  .brand__text { font-size: 1.15rem; }
  .filters { width: 100%; justify-content: center; border-radius: 20px; }
  .glance-grid { grid-template-columns: 1fr; }
  .hero__cta .btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Print ---------- */
@media print {
  #sky, .pattern-overlay, .nav, .hero, #glance, #apps, #faq, #contact, .toc, .to-top, .toast, .progress, .selected__actions, .footer__border { display: none !important; }
  body { background: #fff; color: #111; font-size: 12pt; }
  .policy-layout { display: block; }
  .p-sec { background: none; border: 0; padding: 0 0 1rem; break-inside: avoid; }
  .p-sec h3, .p-sec b, .section__head h2 { color: #000; }
  .p-sec h3 .sec-ico { display: none; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .covered { max-height: none; overflow: visible; mask-image: none; -webkit-mask-image: none; }
  .selected { position: static; background: none; box-shadow: none; border: 1px solid #ccc; }
  a { color: #0a3d2e; }
}
