:root {
  --p0: #08040a;
  --p1: #0f070f;
  --p2: #180d1a;
  --p3: #2a0b2e;
  --p4: #3d1042;
  --p5: #521558;
  --g2: #c9a03e;
  --g3: #d4a843;
  --g4: #e8c76a;
  --g5: #f5dfa0;
  --r2: #c8628a;
  --tx1: #f0e8f5;
  --tx2: #c4aed4;
  --tx3: #8a7098;
  --tx4: #5a4868;
  --border: rgba(212, 168, 67, 0.16);
  --border2: rgba(255, 255, 255, 0.055);
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--p0);
  color: var(--tx1);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.container {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 0;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}

.site-header.scrolled {
  background: rgba(8, 4, 10, 0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border2);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-link img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(212, 168, 67, 0.12);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.brand-name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-ar {
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  font-size: 0.65rem;
  color: var(--g3);
  opacity: 0.85;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-nav a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--tx3);
  transition: color 0.2s;
}

.site-nav a:hover { color: var(--g4); }

.nav-toggle {
  display: none;
  background: rgba(61, 16, 66, 0.4);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--tx1);
  padding: 0.5rem 0.65rem;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--p4), var(--p3));
  border-color: var(--border);
  color: var(--g4);
  box-shadow: 0 8px 28px rgba(61, 16, 66, 0.55);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(61, 16, 66, 0.65), 0 0 0 1px rgba(212, 168, 67, 0.15);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--tx2);
}

.btn-ghost:hover {
  background: rgba(61, 16, 66, 0.35);
  color: var(--g4);
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 7rem 0 4rem;
  overflow: hidden;
}

.hero-bg { position: absolute; inset: 0; pointer-events: none; }

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}

.orb-1 {
  width: 650px;
  height: 650px;
  top: -220px;
  right: -120px;
  background: radial-gradient(circle, rgba(61, 16, 66, 0.95) 0%, transparent 70%);
}

.orb-2 {
  width: 420px;
  height: 420px;
  bottom: -80px;
  left: -60px;
  background: radial-gradient(circle, rgba(61, 16, 66, 0.5) 0%, transparent 70%);
}

.hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image:
    repeating-linear-gradient(60deg, var(--g3) 0, var(--g3) 1px, transparent 0, transparent 50%),
    repeating-linear-gradient(-60deg, var(--g3) 0, var(--g3) 1px, transparent 0, transparent 50%);
  background-size: 36px 62px;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

.hero-content { max-width: 560px; }

.hero-eyebrow {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--tx4);
  margin-bottom: 1.25rem;
}

.hero-bismillah {
  font-family: 'Amiri Quran', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--g4);
  direction: rtl;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  animation: goldenPulse 5s ease-in-out infinite;
}

@keyframes goldenPulse {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(212, 168, 67, 0.15)); }
  50% { filter: drop-shadow(0 0 50px rgba(212, 168, 67, 0.4)); }
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero-title em {
  font-style: italic;
  color: var(--g4);
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--tx3);
  margin-bottom: 2rem;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.hero-stats {
  display: flex;
  gap: 0;
  border: 1px solid var(--border2);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(61, 16, 66, 0.15);
  max-width: 420px;
}

.stat {
  flex: 1;
  text-align: center;
  padding: 1rem 0.75rem;
  position: relative;
}

.stat:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  bottom: 20%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--border), transparent);
}

.stat-n {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--g4);
  line-height: 1;
}

.stat-l {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tx4);
  margin-top: 0.35rem;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.phone-mock {
  width: min(100%, 320px);
  background: linear-gradient(160deg, rgba(61, 16, 66, 0.55) 0%, rgba(15, 7, 15, 0.95) 100%);
  border: 1px solid var(--border);
  border-radius: 36px;
  padding: 1rem;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(212, 168, 67, 0.08);
}

.phone-screen {
  background: var(--p1);
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--border2);
}

.phone-top {
  padding: 1.25rem 1.25rem 0.75rem;
  text-align: center;
}

.phone-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.75rem;
  border-radius: 16px;
}

.phone-ar {
  font-family: 'Amiri Quran', serif;
  font-size: 1.4rem;
  color: var(--g4);
  direction: rtl;
  line-height: 1.8;
  padding: 0 1rem 0.5rem;
}

.phone-ref {
  font-size: 0.65rem;
  color: var(--tx4);
  padding-bottom: 1rem;
}

.phone-bar {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border2);
  background: rgba(61, 16, 66, 0.2);
}

.phone-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--p5);
}

.phone-dot.active { background: var(--g3); }

/* Sections */
section { padding: 5rem 0; position: relative; }

.section-head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 3rem;
}

.section-eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--g3);
  opacity: 0.75;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.section-desc {
  color: var(--tx3);
  font-size: 1rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.feature-card {
  background: linear-gradient(135deg, rgba(61, 16, 66, 0.22) 0%, rgba(12, 8, 15, 0.75) 100%);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 1.75rem;
  transition: all 0.3s ease;
}

.feature-card:hover {
  border-color: rgba(212, 168, 67, 0.22);
  transform: translateY(-4px);
  box-shadow: 0 18px 50px rgba(61, 16, 66, 0.4);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(61, 16, 66, 0.5);
  border: 1px solid var(--border);
  color: var(--g4);
  margin-bottom: 1rem;
}

.feature-icon svg { width: 20px; height: 20px; }

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--tx3);
  line-height: 1.65;
}

/* API */
.api-section {
  background: linear-gradient(180deg, transparent, rgba(61, 16, 66, 0.12), transparent);
}

.api-box {
  background: rgba(15, 7, 15, 0.85);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  max-width: 720px;
  margin: 0 auto;
}

.api-endpoint {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.method {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  background: rgba(212, 168, 67, 0.12);
  color: var(--g4);
  border: 1px solid var(--border);
}

.code {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.85rem;
  color: var(--tx2);
  word-break: break-all;
}

.api-list {
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.api-list li {
  font-size: 0.85rem;
  color: var(--tx3);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border2);
}

.api-list li:last-child { border-bottom: none; }

.api-list code {
  color: var(--g4);
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
}

/* CTA */
.cta-section { padding-bottom: 6rem; }

.cta-card {
  text-align: center;
  background: linear-gradient(138deg, rgba(61, 16, 66, 0.55) 0%, rgba(15, 7, 15, 0.9) 100%);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 3.5rem 2rem;
  position: relative;
  overflow: hidden;
}

.cta-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--g4), transparent);
}

.cta-card h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 0.75rem;
}

.cta-card p {
  color: var(--tx3);
  max-width: 480px;
  margin: 0 auto 1.75rem;
}

.cta-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border2);
  padding: 2.5rem 0;
  background: rgba(8, 4, 10, 0.6);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-brand img { width: 32px; height: 32px; border-radius: 10px; }

.footer-meta {
  font-size: 0.82rem;
  color: var(--tx4);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--tx3);
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--g4); }

/* Legal page */
.legal-page {
  padding: 7rem 0 4rem;
  min-height: 80vh;
}

.legal-card {
  max-width: 720px;
  margin: 0 auto;
  background: linear-gradient(135deg, rgba(61, 16, 66, 0.18) 0%, rgba(12, 8, 15, 0.75) 100%);
  border: 1px solid var(--border2);
  border-radius: 24px;
  padding: 2.5rem;
}

.legal-card h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.legal-meta {
  font-size: 0.85rem;
  color: var(--tx4);
  margin-bottom: 2rem;
}

.legal-card h2 {
  font-size: 1.1rem;
  color: var(--g4);
  margin: 1.75rem 0 0.75rem;
}

.legal-card p,
.legal-card li {
  color: var(--tx3);
  font-size: 0.95rem;
  line-height: 1.75;
}

.legal-card ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}

.legal-card a {
  color: var(--g4);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--tx4);
  margin-bottom: 2rem;
  transition: color 0.2s;
}

.back-link:hover { color: var(--g4); }

/* Mobile nav */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-content { max-width: none; margin: 0 auto; }
  .hero-desc { margin-inline: auto; }
  .hero-actions, .hero-stats { justify-content: center; margin-inline: auto; }
  .hero-visual { order: -1; }
  .phone-mock { width: 260px; }

  .nav-toggle { display: block; }

  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(280px, 85vw);
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 1.5rem 2rem;
    gap: 1.25rem;
    background: rgba(8, 4, 10, 0.97);
    border-left: 1px solid var(--border2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .site-nav.open { transform: translateX(0); }

  .footer-inner { flex-direction: column; text-align: center; }
  .footer-brand { justify-content: center; }
  .footer-links { justify-content: center; }
}

@media (max-width: 480px) {
  .hero-stats { flex-direction: column; }
  .stat:not(:last-child)::after { display: none; }
  .stat { border-bottom: 1px solid var(--border2); }
  .stat:last-child { border-bottom: none; }
}
