/* ============================================================================
   DrAxis — Premium Landing Page Styles
   Inspired by astro.build: dark, gradient accents, clean typography.
   ========================================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans Arabic', sans-serif;
  background: #0c0d14;
  color: #e4e7eb;
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
html[dir="rtl"] body { font-family: 'Noto Sans Arabic', 'Inter', sans-serif; line-height: 1.8; }
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul, ol { list-style: none; }

/* ---------- Design Tokens ---------- */
:root {
  /* Backgrounds */
  --bg:           #0c0d14;
  --bg-elevated:  #11131c;
  --bg-card:      #161824;
  --bg-hover:     #1d2030;

  /* Text */
  --text:         #f0f2f5;
  --text-muted:   #a0a8b8;
  --text-subtle:  #6b7384;

  /* Brand — astro.build-inspired gradient */
  --accent:       #ff5d01;  /* orange */
  --accent-2:     #991b8b;  /* magenta */
  --accent-3:     #5b4eff;  /* indigo */
  --gradient:     linear-gradient(135deg, #ff5d01 0%, #991b8b 50%, #5b4eff 100%);
  --gradient-soft: linear-gradient(135deg, rgba(255,93,1,0.12) 0%, rgba(153,27,139,0.08) 50%, rgba(91,78,255,0.12) 100%);

  /* Borders */
  --border:        rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.15);

  /* Radii */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 60px rgba(255,93,1,0.15);

  /* Layout */
  --container: 1120px;
  --header-h: 68px;

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 250ms;
  --dur-slow: 500ms;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; color: #fff; }
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
p { color: var(--text-muted); }
.lead { font-size: 1.125rem; color: var(--text); line-height: 1.7; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 24px; }
.section { padding-block: 96px; }
.section-sm { padding-block: 64px; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 64px; }
.section-head .lead { margin-top: 16px; }

/* ---------- Components ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8125rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--accent); margin-bottom: 16px;
}
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 600;
  background: rgba(255,93,1,0.1); color: var(--accent);
  border: 1px solid rgba(255,93,1,0.2);
}
.badge-purple { background: rgba(91,78,255,0.1); color: var(--accent-3); border-color: rgba(91,78,255,0.2); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-full);
  font-weight: 600; font-size: 0.9375rem;
  transition: all var(--dur) var(--ease); white-space: nowrap;
}
.btn-primary { background: var(--gradient); color: #fff; box-shadow: var(--shadow-glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 80px rgba(255,93,1,0.25); }
.btn-ghost { border: 1px solid var(--border-strong); color: var(--text); backdrop-filter: blur(8px); }
.btn-ghost:hover { border-color: var(--accent); background: rgba(255,93,1,0.06); }
.btn-lg { padding: 16px 32px; font-size: 1rem; }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  transition: all var(--dur) var(--ease);
}
.card:hover { border-color: var(--border-strong); transform: translateY(-4px); box-shadow: var(--shadow-lg); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; height: var(--header-h); z-index: 100;
  background: rgba(12,13,20,0.7); backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid transparent; transition: all var(--dur) var(--ease);
}
.site-header.scrolled { background: rgba(12,13,20,0.9); border-bottom-color: var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.375rem; letter-spacing: -0.03em; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-desktop { display: flex; gap: 32px; }
.nav-link { font-size: 0.9375rem; font-weight: 500; color: var(--text-muted); transition: color 150ms; }
.nav-link:hover { color: #fff; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.lang-switcher { display: flex; gap: 2px; }
.lang-link { padding: 4px 8px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; color: var(--text-subtle); transition: all 150ms; }
.lang-link:hover { color: var(--text); background: var(--bg-hover); }
.lang-link.active { color: var(--accent); background: rgba(255,93,1,0.1); }
.nav-cta { padding: 8px 16px; font-size: 0.875rem; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all var(--dur) var(--ease); }
.nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
.nav-mobile {
  position: absolute; top: var(--header-h); left: 0; right: 0;
  background: var(--bg); border-bottom: 1px solid var(--border);
  padding: 24px; display: none; flex-direction: column; gap: 16px;
}
.nav-mobile.open { display: flex; }
.nav-mobile .nav-link { font-size: 1.125rem; padding: 8px 0; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; padding-top: var(--header-h); overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.hero-bg::before {
  content: ''; position: absolute; width: 800px; height: 800px; top: -200px; right: -200px;
  background: radial-gradient(circle, rgba(255,93,1,0.15) 0%, transparent 60%);
  border-radius: 50%; filter: blur(60px); animation: float 20s var(--ease) infinite;
}
.hero-bg::after {
  content: ''; position: absolute; width: 600px; height: 600px; bottom: -150px; left: -150px;
  background: radial-gradient(circle, rgba(91,78,255,0.12) 0%, transparent 60%);
  border-radius: 50%; filter: blur(60px); animation: float 25s var(--ease) infinite reverse;
}
.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 80%);
}
@keyframes float {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(40px,-40px) scale(1.05); }
  66% { transform: translate(-30px,30px) scale(0.95); }
}
.hero-content { text-align: center; max-width: 880px; margin: 0 auto; }
.hero-badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.hero h1 { margin-bottom: 24px; }
.hero h1 .gradient-text { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-subtitle { max-width: 60ch; margin: 0 auto; color: var(--text-muted); font-size: 1.125rem; }
.hero-cta { display: flex; justify-content: center; gap: 12px; margin-top: 40px; flex-wrap: wrap; }

/* ---------- Stats ---------- */
.stats-bar { border-block: 1px solid var(--border); background: var(--bg-elevated); padding-block: 48px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.stat-value {
  font-size: clamp(2rem, 4vw, 3rem); font-weight: 800;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: -0.03em;
}
.stat-label { color: var(--text-muted); font-size: 0.875rem; margin-top: 4px; }

/* ---------- Features ---------- */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card .feature-icon {
  font-size: 1.75rem; margin-bottom: 16px; width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient-soft); border-radius: var(--radius);
}
.feature-card h3 { margin-bottom: 8px; font-size: 1.25rem; }
.feature-card p { font-size: 0.9375rem; }

/* ---------- Security ---------- */
.section-security { background: var(--bg-elevated); }
.security-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.security-card .security-icon {
  font-size: 1.5rem; margin-bottom: 16px; width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(91,78,255,0.08); border-radius: var(--radius);
}
.security-card h3 { margin-bottom: 8px; font-size: 1.125rem; }
.security-card p { font-size: 0.9375rem; }

/* ---------- CTA ---------- */
.cta-section { padding-block: 96px; }
.cta-card {
  text-align: center; background: var(--gradient-soft);
  border: 1px solid rgba(255,93,1,0.15); border-radius: var(--radius-xl);
  padding: 64px 32px; box-shadow: var(--shadow-glow);
}
.cta-card .lead { max-width: 50ch; margin: 16px auto 0; }
.cta-buttons { display: flex; justify-content: center; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.store-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; background: var(--bg-card);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  color: #fff; transition: all var(--dur) var(--ease);
}
.store-btn:hover { border-color: var(--accent); background: var(--bg-hover); transform: translateY(-2px); }
.store-btn small { display: block; font-size: 0.875rem; font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-elevated); border-top: 1px solid var(--border); padding-top: 64px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 48px; }
.footer-brand .brand { margin-bottom: 12px; }
.footer-tagline { color: var(--text-muted); max-width: 32ch; margin-bottom: 12px; }
.footer-made { color: var(--text-subtle); font-size: 0.875rem; }
.footer-col h4 { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-subtle); margin-bottom: 16px; font-weight: 600; }
.footer-col a { display: block; color: var(--text-muted); font-size: 0.9375rem; padding: 4px 0; transition: color 150ms; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); padding-block: 24px; }
.footer-bottom p { color: var(--text-subtle); font-size: 0.875rem; }

/* ---------- Legal pages ---------- */
.legal-index { padding-top: 96px; }
.legal-list { display: flex; flex-direction: column; gap: 12px; }
.legal-item { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px; }
.legal-item-main h2 { font-size: 1.125rem; margin-bottom: 4px; }
.legal-item-main p { font-size: 0.875rem; color: var(--text-muted); }
.legal-item-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.legal-date { font-size: 0.75rem; color: var(--text-subtle); white-space: nowrap; }
.badge-draft { background: rgba(251,191,36,0.12); color: #fbbf24; border-color: rgba(251,191,36,0.25); }

.legal-doc { padding-top: 96px; padding-bottom: 96px; }
.back-link { display: inline-block; color: var(--accent); font-size: 0.875rem; font-weight: 600; margin-bottom: 24px; transition: color 150ms; }
.back-link:hover { color: #ff7d2e; }
.legal-header { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.legal-header h1 { margin-bottom: 12px; font-size: clamp(1.75rem, 4vw, 2.5rem); }
.legal-meta { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 16px; font-size: 0.875rem; color: var(--text-muted); }
.legal-meta strong { color: var(--text); }
.draft-banner { margin-top: 16px; padding: 12px 16px; background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.25); border-radius: var(--radius); color: #fbbf24; font-size: 0.875rem; font-weight: 500; }
.legal-footer { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }

/* Prose for legal Markdown */
.prose { font-size: 0.9375rem; line-height: 1.75; max-width: 760px; }
.prose h2 { font-size: 1.5rem; margin-top: 32px; margin-bottom: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.prose h3 { font-size: 1.125rem; margin-top: 24px; margin-bottom: 8px; }
.prose h4 { font-size: 1rem; margin-top: 20px; margin-bottom: 8px; color: var(--text); }
.prose p { margin-bottom: 16px; color: var(--text-muted); }
.prose ul, .prose ol { margin: 12px 0 16px; padding-left: 20px; color: var(--text-muted); }
.prose li { margin-bottom: 8px; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose code { background: var(--bg-hover); padding: 2px 6px; border-radius: 4px; font-size: 0.85em; color: #f0f2f5; font-family: 'JetBrains Mono', monospace; }
.prose pre { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; overflow-x: auto; margin: 16px 0; }
.prose pre code { background: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.875rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.prose th { background: var(--bg-card); color: var(--text); font-weight: 600; }
.prose td { color: var(--text-muted); }
.prose blockquote { border-left: 3px solid var(--accent); padding-left: 16px; margin: 16px 0; color: var(--text-muted); font-style: italic; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: #ff7d2e; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.prose strong { color: var(--text); font-weight: 600; }
html[dir="rtl"] .prose ul, html[dir="rtl"] .prose ol { padding-left: 0; padding-right: 20px; }
html[dir="rtl"] .prose blockquote { border-left: none; border-right: 3px solid var(--accent); padding-left: 0; padding-right: 16px; }

/* ---------- 404 ---------- */
.not-found { min-height: 60vh; display: flex; align-items: center; text-align: center; }
.nf-code { font-size: clamp(5rem, 15vw, 9rem); font-weight: 800; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; margin-bottom: 16px; }

/* ---------- Animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
.reveal { opacity: 0; animation: fadeUp 600ms var(--ease) forwards; }
.reveal:nth-child(2) { animation-delay: 80ms; }
.reveal:nth-child(3) { animation-delay: 160ms; }
.reveal:nth-child(4) { animation-delay: 240ms; }
.reveal:nth-child(5) { animation-delay: 320ms; }
.reveal:nth-child(6) { animation-delay: 400ms; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }

/* ---------- Selection / Scrollbar / Focus ---------- */
::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 9999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; top: -100px; left: 0; background: var(--accent); color: #fff; padding: 8px 16px; border-radius: 0 0 8px 0; font-weight: 600; z-index: 1000; transition: top 150ms; }
.skip-link:focus { top: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .features-grid, .security-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 640px) {
  .features-grid, .security-grid { grid-template-columns: 1fr; }
  .nav-desktop, .header-actions { display: none; }
  .nav-toggle { display: flex; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .legal-item { flex-direction: column; align-items: flex-start; }
  .legal-item-meta { flex-direction: row; align-items: center; }
}
