/* Mobile-first download page — builds on privacy.css */

.page-wide {
  --max: 720px;
  width: min(100% - 1rem, var(--max));
  margin: 0.75rem auto 5.5rem;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* ---- Language bar ---- */
.lang-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  padding: 0.4rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.92);
  border: 1px solid rgba(26, 36, 56, 0.1);
  box-shadow: 0 6px 18px rgba(5, 12, 26, 0.05);
}

.lang-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding-inline: 0.35rem;
}

.lang-switch {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.15rem;
  border-radius: 999px;
  background: rgba(8, 19, 41, 0.07);
}

.lang-btn {
  border: 0;
  cursor: pointer;
  min-height: 2.1rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: transparent;
  color: var(--navy-deep);
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 600;
}

.lang-btn.is-active {
  background: var(--navy);
  color: var(--gold);
}

/* ---- Hero (stacked mobile) ---- */
.hero-download {
  display: grid;
  gap: 1.15rem;
  padding: 1.35rem 1.1rem 1.25rem;
  text-align: center;
}

.hero-brand {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.hero-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  border: 1px solid rgba(212, 175, 55, 0.5);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  background: #050c1a;
}

.hero-copy {
  width: 100%;
}

.hero-download .eyebrow {
  margin: 0 0 0.45rem;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  line-height: 1.35;
}

.hero-download h1 {
  margin: 0;
  font-size: clamp(1.55rem, 6.5vw, 2.1rem);
  line-height: 1.25;
}

.tagline {
  position: relative;
  z-index: 1;
  margin: 0.55rem 0 0;
  color: rgba(247, 241, 228, 0.88);
  font-size: 0.98rem;
  line-height: 1.55;
}

.meta-chips {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.meta-chips li {
  margin: 0;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(255, 255, 255, 0.06);
  color: var(--gold-soft);
  font-size: 0.78rem;
  font-weight: 600;
}

.hero-cta {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.55rem;
}

.cta-note {
  margin: 0;
  color: rgba(247, 241, 228, 0.7);
  font-size: 0.84rem;
  line-height: 1.4;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 3.15rem;
  padding: 0.8rem 1.15rem;
  border-radius: 14px;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-lg {
  min-height: 3.4rem;
  font-size: 1.08rem;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: var(--navy);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 24px rgba(212, 175, 55, 0.3);
}

.btn-secondary {
  background: var(--navy);
  color: var(--parchment);
  border: 1px solid rgba(212, 175, 55, 0.35);
}

/* ---- Stats ---- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0.75rem 0 0;
}

.stat {
  padding: 0.7rem 0.35rem;
  text-align: center;
  border-radius: 14px;
  background: rgba(255, 252, 246, 0.95);
  border: 1px solid rgba(26, 36, 56, 0.08);
  box-shadow: 0 6px 16px rgba(5, 12, 26, 0.04);
}

.stat-value {
  display: block;
  color: var(--navy-deep);
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.15;
}

.stat-label {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.3;
}

/* ---- TOC scroll chips ---- */
.toc {
  margin: 0.75rem 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.toc-track {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.15rem 0.1rem 0.35rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.toc-track::-webkit-scrollbar {
  display: none;
}

.toc a {
  flex: 0 0 auto;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.95);
  border: 1px solid rgba(26, 36, 56, 0.1);
  color: var(--navy-deep);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.toc a:hover {
  color: #8a6b12;
  border-color: rgba(212, 175, 55, 0.5);
}

/* ---- Content ---- */
.content {
  margin-top: 0.85rem;
  padding: 0;
}

.page-wide section {
  margin: 0 0 0.85rem;
  padding: 1.1rem 1rem 1.05rem;
  border-radius: 16px;
}

.page-wide section h2 {
  font-size: 1.2rem;
}

.notice {
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  border-inline-start: 3px solid var(--gold);
  background: rgba(212, 175, 55, 0.1);
}

.feature-grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  padding: 0;
  margin: 0;
}

.feature-grid li {
  margin: 0;
  padding: 0.85rem 0.9rem;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(8, 19, 41, 0.03), transparent);
  border: 1px solid rgba(26, 36, 56, 0.08);
}

.feature-grid strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--navy-deep);
  font-family: var(--serif);
  font-size: 1.02rem;
}

.feature-grid span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.download-list {
  display: grid;
  gap: 0.75rem;
}

.dl-card {
  position: relative;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid rgba(26, 36, 56, 0.1);
  background: #fffcf6;
}

.dl-card-featured {
  border-color: rgba(212, 175, 55, 0.55);
  background:
    linear-gradient(145deg, rgba(212, 175, 55, 0.14), transparent 55%),
    #fffcf6;
  box-shadow: 0 10px 24px rgba(5, 12, 26, 0.06);
}

.dl-badge {
  display: inline-block;
  margin-bottom: 0.45rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--navy);
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 700;
}

.dl-card h3 {
  margin: 0 0 0.3rem;
  font-family: var(--serif);
  font-size: 1.12rem;
  color: var(--navy-deep);
}

.dl-file {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
  word-break: break-all;
}

.dl-meta {
  margin: 0.4rem 0 0.9rem;
  padding-inline-start: 1.1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.steps {
  margin: 0 0 0.85rem;
  padding-inline-start: 1.15rem;
}

.steps li {
  margin: 0.5rem 0;
}

.faq-list details {
  margin: 0.45rem 0;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(26, 36, 56, 0.08);
  background: rgba(255, 252, 246, 0.75);
}

.faq-list summary {
  cursor: pointer;
  color: var(--navy-deep);
  font-weight: 700;
  font-family: var(--serif);
}

.faq-list details p {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.specs {
  margin: 0;
}

.specs > div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.15rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(26, 36, 56, 0.08);
}

.specs > div:last-child {
  border-bottom: 0;
}

.specs dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.specs dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
}

/* ---- Sticky mobile CTA ---- */
.sticky-cta {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 40;
  padding: 0.65rem 0.85rem calc(0.65rem + env(safe-area-inset-bottom, 0));
  background: linear-gradient(180deg, rgba(247, 241, 228, 0), rgba(247, 241, 228, 0.96) 28%, #f7f1e4);
  box-shadow: 0 -8px 24px rgba(5, 12, 26, 0.08);
}

.sticky-cta[hidden] {
  display: none !important;
}

.sticky-cta .btn {
  max-width: 720px;
  margin-inline: auto;
}

/* ---- RTL typography ---- */
html[dir="rtl"] body {
  font-family: var(--arabic), var(--sans);
}

html[dir="rtl"] .hero h1,
html[dir="rtl"] section h2,
html[dir="rtl"] .feature-grid strong,
html[dir="rtl"] .dl-card h3,
html[dir="rtl"] .faq-list summary,
html[dir="rtl"] .stat-value,
html[dir="rtl"] .lang-btn {
  font-family: var(--arabic), var(--serif);
}

html[dir="rtl"] .notice {
  background: linear-gradient(270deg, rgba(212, 175, 55, 0.12), transparent 80%);
}

html[dir="rtl"] section h2::after {
  margin-inline-start: auto;
  margin-inline-end: 0;
  background: linear-gradient(270deg, var(--gold), transparent);
}

/* ---- Tablet / desktop ---- */
@media (min-width: 640px) {
  .page-wide {
    width: min(100% - 2rem, var(--max));
    margin: 1.5rem auto 3rem;
  }

  .hero-download {
    padding: 1.85rem 1.6rem 1.55rem;
    text-align: start;
  }

  .hero-brand {
    flex-direction: row;
    align-items: flex-start;
    gap: 1.15rem;
    text-align: start;
  }

  .hero-icon {
    width: 108px;
    height: 108px;
  }

  .hero-download h1 {
    font-size: clamp(1.9rem, 3.5vw, 2.35rem);
  }

  .meta-chips {
    justify-content: flex-start;
  }

  .hero-cta {
    justify-items: start;
  }

  .btn {
    width: auto;
    min-width: 14rem;
  }

  .btn-lg {
    min-width: 16rem;
  }

  .cta-note {
    text-align: start;
  }

  .stats-bar {
    gap: 0.7rem;
  }

  .stat {
    padding: 0.95rem 0.7rem;
  }

  .stat-value {
    font-size: 1.55rem;
  }

  .stat-label {
    font-size: 0.82rem;
  }

  .toc-track {
    flex-wrap: wrap;
    overflow: visible;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
  }

  .specs > div {
    grid-template-columns: minmax(8rem, 11rem) 1fr;
    gap: 0.35rem 1rem;
  }

  .page-wide section {
    padding: 1.3rem 1.3rem 1.2rem;
  }

  .sticky-cta {
    display: none !important;
  }
}

@media (min-width: 900px) {
  .page-wide {
    --max: 780px;
  }
}

@media (hover: hover) {
  .btn:hover {
    transform: translateY(-1px);
  }

  .btn-primary:hover {
    color: var(--navy);
    background: linear-gradient(180deg, #f0d78a, var(--gold-soft));
  }

  .btn-secondary:hover {
    color: var(--gold-soft);
  }
}
