@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Source+Sans+3:wght@400;500;600;700&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

:root {
  --color-bg: #f1f5f9;
  --color-fg: #0f172a;
  --color-muted: #475569;
  --color-brand: #0284c7;
  --color-brand-dark: #0369a1;
  --color-accent: #0e7490;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --font-display: "Fraunces", Georgia, serif;
  --font-sans: "Source Sans 3", "Segoe UI", sans-serif;
  --font-arabic: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --max: 72rem;
}

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

html {
  scroll-behavior: smooth;
  /* Exact sticky header clearance: ~72px header + 4px — ids on h2 titles */
  scroll-padding-top: 4.75rem;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--color-fg);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 520px at 0% -8%, #e0f2fe 0%, transparent 55%),
    radial-gradient(900px 480px at 100% 0%, #ccfbf1 0%, transparent 48%),
    var(--color-bg);
}

html[dir="rtl"] body {
  font-family: var(--font-arabic);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.brand-display {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(241, 245, 249, 0.85);
  border-bottom: 1px solid var(--color-border);
}

.site-header-inner {
  display: flex;
  justify-content: flex-start; /* pack logo + actions — no empty middle */
  align-items: center;
  gap: 0.75rem; /* 12px */
  padding: 0.85rem 1.5rem;
  max-width: var(--max);
  margin: 0 auto;
  flex-wrap: nowrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: inherit;
  min-width: 2.75rem;
  min-height: 2.75rem;
}

.brand img {
  height: 2.75rem; /* 44px — locked family mark size */
  width: 2.75rem;
  object-fit: contain;
}

.nav-user {
  /* Greeting kept in DOM for title tooltip; never shown in the bar */
  display: none;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.15;
  white-space: nowrap;
}

.brand-tag {
  display: block;
  color: var(--color-muted);
  font-size: 0.75rem;
  margin-top: 0.1rem;
  white-space: nowrap;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem; /* 8px — min between tap targets */
  flex-wrap: nowrap;
  min-width: 0;
}

[data-auth-slot] {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  flex-wrap: nowrap;
}

.nav-links a {
  color: var(--color-muted);
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem; /* 44px */
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

html[lang="ar"] .nav-links a {
  padding: 0.4rem 0.45rem;
  font-size: 0.85rem;
}

.nav-links a:hover {
  color: var(--color-fg);
  background: rgba(255, 255, 255, 0.7);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.65rem;
  padding: 0.75rem 1.35rem;
  font-weight: 600;
  font-size: 1rem;
  border: 0;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

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

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

.btn-primary:hover { background: var(--color-brand-dark); }

.btn-ghost {
  background: transparent;
  color: var(--color-fg);
  border: 1px solid #cbd5e1;
}

.btn-sm {
  min-height: 2.75rem; /* 44px touch */
  padding: 0.5rem 0.9rem;
  font-size: 0.875rem;
}

.hero-plane {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
  background:
    radial-gradient(ellipse 80% 70% at 85% 40%, #bae6fd 0%, transparent 55%),
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.hero-plane::after {
  content: "";
  position: absolute;
  inset: auto -5% -35% 40%;
  height: 70%;
  background: radial-gradient(ellipse at center, rgba(14, 116, 144, 0.12), transparent 65%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2.5rem;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 3.75rem;
}

@media (min-width: 768px) {
  .hero-inner {
    grid-template-columns: 1.15fr 0.85fr;
    padding: 5rem 1.5rem;
  }
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.15rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 1rem;
  max-width: 20ch;
}

.hero-copy p {
  color: var(--color-muted);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.55;
  margin: 0 0 1.5rem;
  max-width: 38rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}

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

.hero-mark {
  width: min(100%, 18rem);
  height: auto;
  filter: drop-shadow(0 24px 48px rgba(3, 105, 161, 0.18));
}

.reveal {
  animation: reveal-up 0.7s ease both;
}

.reveal-delay-1 { animation-delay: 0.08s; }
.reveal-delay-2 { animation-delay: 0.16s; }

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-rule {
  border-top: 1px solid var(--color-border);
}

.section-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
}

.section-alt {
  background: rgba(255, 255, 255, 0.55);
}

.section-inner h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 0 0 0.75rem;
  overflow: visible;
}

/* Fraunces clips Arabic glyphs — use the Arabic family for section titles */
html[dir="rtl"] .section-inner h2,
html[dir="rtl"] .cta-inner h2,
html[dir="rtl"] .feature-item h3 {
  font-family: var(--font-arabic);
  letter-spacing: 0;
  line-height: 1.45;
}

.section-lead {
  color: var(--color-muted);
  margin: 0 0 2rem;
  max-width: 36rem;
  font-size: 1.05rem;
}

.feature-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
  .feature-grid-2 { grid-template-columns: repeat(2, 1fr); }
}

.feature-item h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: #075985;
  margin: 0 0 0.5rem;
}

.feature-item p {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.6;
}

.feature-item a {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--color-brand);
  font-weight: 600;
}

.feature-item a:hover { color: var(--color-brand-dark); }

.stats-bar {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem 2.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.25rem;
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 1.15rem;
  padding: 1.5rem 1rem;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--color-brand);
  line-height: 1.2;
}

.stat-label {
  color: var(--color-muted);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.cta-band {
  border-top: 1px solid var(--color-border);
  background:
    radial-gradient(ellipse 70% 80% at 50% 0%, #e0f2fe 0%, transparent 60%),
    #f8fafc;
}

.cta-inner {
  max-width: 40rem;
  margin: 0 auto;
  padding: 4rem 1.5rem;
  text-align: center;
}

.cta-inner h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.85rem;
  overflow: visible;
}

.cta-inner p {
  color: var(--color-muted);
  margin: 0 0 1.75rem;
  font-size: 1.05rem;
}

.cta-inner .hero-actions {
  justify-content: center;
}

.contact-page h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

html[dir="rtl"] .contact-page h1 {
  font-family: var(--font-arabic);
  letter-spacing: 0;
}

.contact-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  max-width: 28rem;
  display: grid;
  gap: 1.25rem;
}

.contact-list li {
  display: grid;
  gap: 0.25rem;
}

.contact-list strong {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
}

html[dir="rtl"] .contact-list strong {
  text-transform: none;
  letter-spacing: 0;
}

.contact-list a {
  color: var(--color-brand);
  font-size: 1.05rem;
  text-decoration: none;
}

.contact-list a:hover {
  text-decoration: underline;
}

.site-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--color-muted);
  font-size: 0.8125rem;
  border-top: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.45);
}

.site-footer a { color: var(--color-muted); }
.site-footer a:hover { color: var(--color-brand); }

@media (max-width: 640px) {
  .site-header-inner { padding: 0.65rem 1rem; gap: 0.5rem; }
  .brand img { height: 2.75rem; width: 2.75rem; } /* keep mark size identical */
  .nav-links { display: none; }
  .nav-actions { gap: 0.5rem; }
  .btn-sm { min-height: 2.75rem; padding: 0.5rem 0.85rem; font-size: 0.875rem; }
  .hero-inner { padding: 2.5rem 1rem 2.75rem; }
  .section-inner { padding: 2.75rem 1rem; }
}

/* AR mid-nav is long — keep one-row family header until desktop width */
@media (max-width: 900px) {
  html[lang="ar"] .nav-links { display: none; }
}
