/* ===== Custom Properties ===== */
:root {
  --color-primary: #1B4332;
  --color-primary-light: #2D6A4F;
  --color-gold: #C9A84C;
  --color-gold-light: #D4B96A;
  --color-bg: #FAFAF8;
  --color-bg-alt: #F0EFEB;
  --color-text: #1A1A1A;
  --color-text-secondary: #555;
  --color-card-bg: #FFFFFF;
  --color-card-border: rgba(0, 0, 0, 0.06);
  --color-nav-bg: rgba(250, 250, 248, 0.85);
  --phone-bg: #f5f5f3;
  --phone-frame: #1A1A1A;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.10);
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-arabic: 'Amiri', serif;
}

[data-theme="dark"] {
  --color-bg: #121212;
  --color-bg-alt: #1A1A1A;
  --color-text: #E8E6E1;
  --color-text-secondary: #999;
  --color-card-bg: #1E1E1E;
  --color-card-border: rgba(255, 255, 255, 0.08);
  --color-nav-bg: rgba(18, 18, 18, 0.9);
  --phone-bg: #252525;
  --phone-frame: #E8E6E1;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

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

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

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--color-nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-card-border);
  transition: background-color 0.3s ease;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-primary);
}

[data-theme="dark"] .nav-logo {
  color: var(--color-gold);
}

.nav-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--color-card-border);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background: var(--color-bg-alt);
}

.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 100px 24px 40px;
  position: relative;
}

.hero-content {
  max-width: 1100px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 60px;
}

.hero-text {
  flex: 1;
  max-width: 520px;
}

.hero-app-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-md);
}

.hero-arabic {
  font-family: var(--font-arabic);
  font-size: clamp(3rem, 6vw, 4.5rem);
  color: var(--color-gold);
  line-height: 1.2;
  margin-bottom: 4px;
  direction: ltr;
  text-align: left;
}

.hero-brand {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

[data-theme="dark"] .hero-brand {
  color: var(--color-gold);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.15;
  margin-bottom: 20px;
}

[data-theme="dark"] .hero-title {
  color: var(--color-gold);
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 440px;
}

.app-store-badge {
  display: inline-block;
  color: var(--color-text);
  transition: opacity 0.2s ease;
}

.app-store-badge:hover {
  opacity: 0.8;
}

.hero-phone {
  flex-shrink: 0;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 30px;
  color: var(--color-text-secondary);
  opacity: 0.5;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ===== Phone Mockup ===== */
.phone-frame {
  width: 260px;
  height: 486px;
  background: var(--phone-frame);
  border-radius: 40px;
  padding: 12px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.phone-frame::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 24px;
  background: var(--phone-frame);
  border-radius: 0 0 16px 16px;
  z-index: 2;
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: var(--phone-bg);
  border-radius: 30px;
  overflow: hidden;
}

.placeholder-screen {
  padding: 48px 20px 20px;
}

.placeholder-screen.alt {
  padding: 48px 20px 20px;
}

.placeholder-screen.alt2 {
  padding: 48px 20px 20px;
}

.placeholder-header {
  height: 24px;
  width: 60%;
  background: var(--color-primary);
  border-radius: 6px;
  margin-bottom: 20px;
  opacity: 0.7;
}

.placeholder-header.gold {
  background: var(--color-gold);
}

.placeholder-header.green {
  background: var(--color-primary);
}

.placeholder-card {
  height: 80px;
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: 12px;
  margin-bottom: 12px;
}

.placeholder-card.short {
  height: 56px;
}

.placeholder-text {
  height: 12px;
  width: 90%;
  background: var(--color-text);
  opacity: 0.1;
  border-radius: 4px;
  margin-bottom: 10px;
}

.placeholder-text.short {
  width: 60%;
}

.placeholder-quiz-option {
  height: 48px;
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: 10px;
  margin-bottom: 10px;
}

/* ===== Phone Screenshot ===== */
.phone-screenshot {
  width: 100%;
  height: 100%;
  object-fit: fill;
  border-radius: 30px;
  display: block;
}

.phone-frame.small .phone-screenshot {
  border-radius: 24px;
}

/* ===== Showcase Sections ===== */
.showcase {
  padding: 100px 0;
  overflow: hidden;
}

.showcase-alt {
  background: var(--color-bg-alt);
}

.showcase-dark {
  background: #0F1628;
  color: #fff;
}

.showcase-inner {
  display: flex;
  align-items: center;
  gap: 60px;
}

.showcase-reverse {
  flex-direction: row-reverse;
}

.showcase-text {
  flex: 1;
}

.showcase-label {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 12px;
}

.showcase-label-green {
  color: #4ADE80;
}

.showcase-label-yellow {
  color: #FACC15;
}

.showcase-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 20px;
}

.showcase-dark .showcase-title {
  color: #fff;
}

.showcase-desc {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
  max-width: 420px;
}

.showcase-dark .showcase-desc {
  color: rgba(255, 255, 255, 0.6);
}

.showcase-phone {
  flex-shrink: 0;
}

.phone-frame-gold {
  background: #C9A84C !important;
}

.phone-frame-gold::before {
  background: #C9A84C !important;
}

/* ===== Features ===== */
.features {
  padding: 100px 0;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 600;
  text-align: center;
  margin-bottom: 56px;
  color: var(--color-text);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: 16px;
  padding: 32px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 52px;
  height: 52px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

[data-theme="dark"] .feature-icon {
  background: var(--color-primary-light);
}

.feature-card h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}


/* ===== Trust ===== */
.trust {
  padding: 100px 0;
}

.trust-content {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.trust-icon {
  color: var(--color-gold);
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.trust .section-title {
  margin-bottom: 20px;
}

.trust-text {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
}

/* ===== CTA ===== */
.cta {
  padding: 80px 0 100px;
  background: var(--color-primary);
  color: #fff;
  text-align: center;
}

.cta-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cta-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 600;
  margin-bottom: 32px;
}

.cta-badge {
  color: #fff;
  margin-bottom: 16px;
}

.cta-badge svg rect {
  fill: #fff;
}

.cta-badge svg text {
  fill: var(--color-primary);
}

.cta-note {
  font-size: 0.9rem;
  opacity: 0.7;
}

/* ===== Footer ===== */
.footer {
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--color-card-border);
}

.footer-company {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.85rem;
}

.footer-links a {
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
}

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

.footer-sep {
  color: var(--color-text-secondary);
  opacity: 0.4;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  opacity: 0.6;
}

/* ===== Animations ===== */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.features-grid .fade-up:nth-child(2) { transition-delay: 0.1s; }
.features-grid .fade-up:nth-child(3) { transition-delay: 0.2s; }
.features-grid .fade-up:nth-child(4) { transition-delay: 0.3s; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 48px;
  }

  .hero-text {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-subtitle {
    max-width: 100%;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .phone-frame {
    width: 220px;
    height: 411px;
  }

  .showcase {
    padding: 60px 0;
  }

  .showcase-inner,
  .showcase-reverse {
    flex-direction: column;
    text-align: center;
    gap: 40px;
  }

  .showcase-desc {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 80px 20px 40px;
  }

  .phone-frame {
    width: 200px;
    height: 374px;
    border-radius: 32px;
  }

  .feature-card {
    padding: 24px;
  }

  .showcase {
    padding: 48px 0;
  }
}
