/* AhmeDaher Soft — Design System
   CSS Variables + Mobile-First + RTL */

/* ============================================================
   FONTS
   ============================================================ */
@font-face {
  font-family: "Plex";
  src: url("/assets/fonts/plex-arabic-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex";
  src: url("/assets/fonts/plex-arabic-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex";
  src: url("/assets/fonts/plex-arabic-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex";
  src: url("/assets/fonts/plex-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex";
  src: url("/assets/fonts/plex-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   VARIABLES
   ============================================================ */
:root {
  --font: "Plex", system-ui, -apple-system, sans-serif;
  --bg: #ffffff;
  --surface: #f5f6f8;
  --surface-alt: #ebedf0;
  --text: #1a1e2c;
  --text-secondary: #4a5060;
  --text-muted: #70768a;
  --border: #dfe1e6;
  --border-light: #ebedf0;
  --primary: #1d2d50;
  --primary-light: #2a3f6e;
  --accent: #c49320;
  --accent-light: #e8b84b;
  --accent-dark: #8a6516;
  --success: #167d3e;
  --danger: #b91c1c;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 3px rgba(26,30,44,.06);
  --shadow: 0 2px 8px rgba(26,30,44,.08);
  --shadow-lg: 0 8px 24px rgba(26,30,44,.10);
  --container: 1180px;
  --gap: 24px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 80px;
  --space-5xl: 96px;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); font-size: 16px; line-height: 1.7; color: var(--text); background: var(--bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.25; color: var(--text); }

/* ============================================================
   LAYOUT
   ============================================================ */
.container { width: min(var(--container), calc(100% - 32px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Focus visible */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }

/* Skip link */
.skip-link { position: absolute; top: -100%; left: var(--space-md); z-index: 999; background: var(--primary); color: #fff; padding: var(--space-xs) var(--space-md); border-radius: var(--radius-sm); font-size: 14px; }
.skip-link:focus { top: var(--space-sm); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--bg); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--primary); flex-shrink: 0; }
.logo-img { width: 36px; height: 36px; border-radius: var(--radius-sm); object-fit: contain; flex-shrink: 0; }
.logo-accent { color: var(--accent); font-weight: 400; }

/* Nav — horizontal scroll on mobile */
.main-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.main-nav::-webkit-scrollbar { display: none; }
.nav-link { display: flex; align-items: center; white-space: nowrap; padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-sm); font-size: 15px; font-weight: 500; color: var(--text-secondary); transition: color .15s, background .15s; }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--primary); background: var(--surface); }
.nav-link[aria-current="page"] { font-weight: 700; }

.header-cta { flex-shrink: 0; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius); font-weight: 600; font-size: 15px; line-height: 1.3; transition: background .15s, color .15s, transform .1s; min-height: 44px; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-accent { background: var(--accent); color: var(--primary); }
.btn-accent:hover { background: var(--accent-light); }
.btn-outline { border: 2px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 14px; font-size: 14px; min-height: 36px; }
.btn-lg { padding: 14px 28px; font-size: 16px; min-height: 52px; }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding: var(--space-3xl) 0 var(--space-4xl); }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 16px; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: var(--space-lg); }
.hero-badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.hero h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.2; color: var(--primary); margin-bottom: var(--space-md); max-width: 750px; }
.hero-desc { font-size: clamp(16px, 2.5vw, 19px); color: var(--text-secondary); line-height: 1.75; max-width: 620px; margin-bottom: var(--space-xl); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-bottom: var(--space-2xl); }
.hero-stats { display: flex; flex-wrap: wrap; gap: var(--space-xl); padding-top: var(--space-xl); border-top: 1px solid var(--border-light); }
.hero-stat { font-size: 14px; color: var(--text-muted); }
.hero-stat strong { display: block; font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 2px; }

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: var(--space-4xl) 0; }
.section-alt { background: var(--surface); }
.section-header { margin-bottom: var(--space-2xl); }
.section-eyebrow { display: inline-block; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-dark); margin-bottom: var(--space-xs); }
.section-title { font-size: clamp(24px, 4vw, 34px); color: var(--primary); margin-bottom: var(--space-sm); }
.section-desc { font-size: 17px; color: var(--text-secondary); max-width: 600px; }

/* ============================================================
   CARDS
   ============================================================ */
.card { background: var(--bg); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: var(--space-xl); transition: border-color .2s, box-shadow .2s; }
.card:hover { border-color: var(--accent-light); box-shadow: var(--shadow); }
.card-icon { width: 48px; height: 48px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: var(--space-md); }
.card h3 { font-size: 18px; margin-bottom: var(--space-xs); }
.card p { font-size: 15px; color: var(--text-secondary); line-height: 1.7; }

.grid-2 { display: grid; grid-template-columns: 1fr; gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: var(--gap); }
.grid-4 { display: grid; grid-template-columns: 1fr; gap: var(--gap); }

/* ============================================================
   PROJECT CARDS
   ============================================================ */
.project-card { display: flex; flex-direction: column; gap: var(--space-md); }
.project-card-icon { width: 56px; height: 56px; border-radius: var(--radius); object-fit: cover; border: 1px solid var(--border-light); }
.project-card-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); color: var(--text-muted); }
.badge-android { border-color: #a5d6a7; color: #2e7d32; }
.badge-web { border-color: #90caf9; color: #1565c0; }
.badge-desktop { border-color: #ce93d8; color: #6a1b9a; }
.badge-custom { border-color: #ffcc80; color: #e65100; }

/* ============================================================
   PROJECT PAGE
   ============================================================ */
.project-hero { padding: var(--space-2xl) 0; border-bottom: 1px solid var(--border-light); }
.project-hero-grid { display: flex; flex-direction: column; gap: var(--space-lg); align-items: flex-start; }
.project-icon-lg { width: 80px; height: 80px; border-radius: var(--radius-lg); border: 1px solid var(--border-light); }
.project-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--space-sm); }
.project-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.project-content { padding: var(--space-2xl) 0; }
.project-content h2 { font-size: clamp(20px, 3vw, 26px); color: var(--primary); margin-bottom: var(--space-md); margin-top: var(--space-2xl); }
.project-content h2:first-child { margin-top: 0; }
.project-content p { font-size: 16px; color: var(--text-secondary); line-height: 1.8; margin-bottom: var(--space-md); }
.project-content ul { padding-inline-start: var(--space-lg); margin-bottom: var(--space-md); }
.project-content li { font-size: 16px; color: var(--text-secondary); line-height: 1.8; margin-bottom: var(--space-xs); list-style: disc; }

.feature-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-md); margin-bottom: var(--space-xl); }
.feature-item { background: var(--surface); border-radius: var(--radius); padding: var(--space-lg); }
.feature-item h3 { font-size: 16px; margin-bottom: var(--space-xs); }
.feature-item p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 0; }

.link-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.link-list a { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-md); background: var(--surface); border-radius: var(--radius); font-weight: 500; transition: background .15s; }
.link-list a:hover { background: var(--surface-alt); }

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.breadcrumbs { padding: var(--space-md) 0; font-size: 13px; color: var(--text-muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumbs li { display: flex; align-items: center; gap: 4px; }
.breadcrumbs li + li::before { content: "/"; color: var(--border); }
.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs [aria-current] { color: var(--text); font-weight: 500; }

/* ============================================================
   FAQ
   ============================================================ */
.faq-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.faq-item { border: 1px solid var(--border-light); border-radius: var(--radius); overflow: hidden; }
.faq-item summary { padding: var(--space-md) var(--space-lg); font-weight: 600; font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.faq-item summary::marker { content: ""; }
.faq-item summary::after { content: "+"; font-size: 20px; color: var(--text-muted); transition: transform .2s; flex-shrink: 0; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { padding: 0 var(--space-lg) var(--space-md); font-size: 15px; color: var(--text-secondary); line-height: 1.7; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--primary); color: #c0c8d8; padding: var(--space-3xl) 0 var(--space-xl); }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-2xl); margin-bottom: var(--space-2xl); }
.footer-brand p { font-size: 14px; line-height: 1.7; margin-top: var(--space-sm); max-width: 320px; color: #8b98b0; }
.footer-col h4 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: var(--space-md); }
.footer-links { display: flex; flex-direction: column; gap: var(--space-xs); }
.footer-links a { font-size: 14px; color: #a0aec0; transition: color .15s; padding: 2px 0; }
.footer-links a:hover { color: #ffffff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: var(--space-lg); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-sm); font-size: 13px; color: #707a90; }

/* ============================================================
   SERVICES PAGE
   ============================================================ */
.service-card { display: flex; flex-direction: column; gap: var(--space-md); }
.service-card-num { font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: var(--space-xs); }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-xl); }
.contact-method { display: flex; gap: var(--space-md); align-items: flex-start; }
.contact-method-icon { width: 44px; height: 44px; border-radius: var(--radius); background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.contact-method h3 { font-size: 15px; margin-bottom: 2px; }
.contact-method p { font-size: 14px; color: var(--text-secondary); }

/* ============================================================
   ABOUT
   ============================================================ */
.about-hero { padding: var(--space-3xl) 0 var(--space-2xl); }
.about-content h2 { font-size: clamp(22px, 3.5vw, 30px); color: var(--primary); margin-bottom: var(--space-md); margin-top: var(--space-2xl); }
.about-content h2:first-child { margin-top: 0; }
.about-content p { font-size: 16px; color: var(--text-secondary); line-height: 1.8; margin-bottom: var(--space-md); }
.about-values { display: grid; grid-template-columns: 1fr; gap: var(--space-md); }

/* ============================================================
   CTA SECTION
   ============================================================ */
.cta-section { background: var(--primary); color: #fff; padding: var(--space-3xl) 0; text-align: center; }
.cta-section h2 { color: #fff; font-size: clamp(22px, 3.5vw, 30px); margin-bottom: var(--space-md); }
.cta-section p { color: #a0aec0; font-size: 17px; margin-bottom: var(--space-xl); max-width: 500px; margin-inline: auto; }
.cta-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); justify-content: center; }

/* ============================================================
   CATEGORY HEADER
   ============================================================ */
.cat-header { padding: var(--space-2xl) 0 var(--space-xl); border-bottom: 1px solid var(--border-light); }

/* ============================================================
   RESPONSIVE — TABLET (>=640px)
   ============================================================ */
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .about-values { grid-template-columns: repeat(2, 1fr); }
  .project-hero-grid { flex-direction: row; align-items: center; }
}

/* ============================================================
   RESPONSIVE — DESKTOP (>=1024px)
   ============================================================ */
@media (min-width: 1024px) {
  .container { width: min(var(--container), calc(100% - 48px)); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
  .about-values { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .site-header, .site-footer, .skip-link { display: none; }
  body { font-size: 12pt; color: #000; }
  a { color: #000; text-decoration: underline; }
}
