/* Fonts */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;600;700&display=swap");

:root {
  /* Colors */
  --bg: #ffffff;
  --fg: #0f172a;
  --fg-muted: #475569;
  --card: #f9fafb;
  --accent: #14b8a6;
  --accent-hover: #0f766e;
  --secondary: #e2b81a;

  /* Typography */
  --font-size-base: 16px;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: clamp(32px, 5vw, 48px);
  --line-height-base: 1.6;
  --line-height-tight: 1.4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0e27;
    --fg: #f1f5f9;
    --fg-muted: #94a3b8;
    --card: #111c2e;
  }
}

/* Base typography */
body {
  margin: 0;
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  background: var(--bg);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  font-feature-settings:
    "liga" 1,
    "calt" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  text-align: start;
}

/* Arabic adjustments */
html[lang="ar"] body {
  font-family: "Tajawal", "Inter", sans-serif;
  line-height: 1.7;
  letter-spacing: -0.01em;
  text-align: right;
}

/* Responsive font scaling */
@media (max-width: 768px) {
  :root {
    --font-size-base: 15px;
    --font-size-lg: 1.0625rem;
    --font-size-xl: 1.125rem;
    --font-size-2xl: 1.375rem;
  }

  html[lang="ar"] body {
    line-height: 1.75;
  }
}

/* Container */
.container {
  flex: 1;
  max-width: 1140px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Header */
header {
  text-align: center;
  padding: 1rem 0;
}

.site-name {
  font-weight: 700;
  font-size: var(--font-size-2xl);
  color: var(--fg);
  letter-spacing: -0.025em;
}

html[lang="ar"] .site-name {
  font-weight: 800;
  letter-spacing: normal;
}

.tagline {
  color: var(--fg-muted);
  margin-top: 0.25rem;
  font-size: var(--font-size-lg);
  font-weight: 500;
  line-height: var(--line-height-tight);
}

html[lang="ar"] .tagline {
  font-weight: 600;
  line-height: 1.6;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 80px 0;
}

.hero-title {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  margin: 0;
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
}

html[lang="ar"] .hero-title {
  line-height: 1.3;
  letter-spacing: normal;
}

.hero-subtitle {
  color: var(--fg-muted);
  font-size: clamp(1rem, 2vw, 1.125rem);
  max-width: 600px;
  margin: 1rem auto 0;
  font-weight: 400;
  line-height: var(--line-height-base);
}

html[lang="ar"] .hero-subtitle {
  line-height: 1.7;
}

/* CTA Buttons */
.cta-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: var(--font-size-base);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  line-height: var(--line-height-tight);
}

html[lang="ar"] .btn {
  font-weight: 700;
  padding: 15px 24px;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-secondary {
  background: var(--secondary);
  color: var(--fg);
}

.install-icon {
  width: 20px;
  height: 20px;
  margin-inline-end: 5px;
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.feature-card {
  background: var(--card);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.feature-card h3 {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: var(--font-size-xl);
  font-weight: 600;
  line-height: var(--line-height-tight);
}

html[lang="ar"] .feature-card h3 {
  font-weight: 700;
  font-size: 1.0625rem;
}

.feature-card svg {
  width: clamp(20px, 2vw, 32px);
  height: clamp(20px, 2vw, 32px);
  fill: currentColor;
}

.feature-card p {
  color: var(--fg-muted);
  margin: 0;
  line-height: 1.65;
  font-size: 0.9375rem;
}

html[lang="ar"] .feature-card p {
  line-height: 1.8;
  font-size: 0.875rem;
}

/* Footer */
.footer {
  text-align: center;
  padding: 1.5rem 0;
  background: var(--card);
  color: var(--fg-muted);
  border-top: 1px solid var(--fg-muted);
  font-size: 0.9rem;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.footer-lang a {
  color: var(--fg);
  font-weight: 500;
  transition: color 0.2s ease;
}

.footer-lang a:hover,
.footer-links a:hover {
  color: var(--accent);
}

.footer-lang a.active {
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  padding: 4px 8px;
}

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

.footer-links a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--fg-muted);
  text-decoration: none;
}

/* RTL & Arabic adjustments */
html[lang="ar"] {
  text-rendering: optimizeLegibility;
  -webkit-font-feature-settings:
    "liga" on,
    "calt" on;
  font-feature-settings:
    "liga" on,
    "calt" on;
}

html[lang="ar"] .hero-title,
html[lang="ar"] .site-name {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Responsive */
@media (max-width: 480px) {
  html[lang="ar"] .hero-title {
    font-size: clamp(28px, 6vw, 36px);
  }

  html[lang="ar"] .site-name {
    font-size: 1.25rem;
  }

  html[lang="ar"] .tagline {
    font-size: 0.9375rem;
  }

  .cta-group {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* High contrast */
@media (prefers-contrast: high) {
  :root {
    --fg-muted: #000;
    --accent: #0066cc;
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --fg-muted: #fff;
      --accent: #66ccff;
    }
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .btn,
  .btn:hover,
  .feature-card {
    transition: none !important;
    transform: none !important;
  }
}
