:root {
  --bg: #f8fafc;
  --text: #0f172a;
  --muted: #475569;
  --primary: #0b3a62;
  --surface: #ffffff;
  --line: #e2e8f0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Tajawal", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  opacity: 1;
  transition: opacity 260ms ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(120deg, #e2e8f0 0%, #0b3a62 100%);
  transform: perspective(1200px) rotateY(0deg) scaleX(0);
  transform-origin: left center;
  transition: transform 460ms ease;
  z-index: 9999;
  pointer-events: none;
}

body.page-transitioning {
  opacity: 0.75;
}

body.page-transitioning::before {
  transform: perspective(1200px) rotateY(-8deg) scaleX(1);
}

body.page-transitioning.to-ar::before {
  transform-origin: right center;
  transform: perspective(1200px) rotateY(8deg) scaleX(1);
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.top-bar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  direction: ltr;
}

.brand-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
}

.brand-title {
  margin: 0;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

[dir="rtl"] .brand-title {
  flex-direction: row-reverse;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-switch a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.85rem;
}

.lang-switch a.is-active {
  color: var(--primary);
  border-color: rgba(11, 58, 98, 0.35);
  background: rgba(11, 58, 98, 0.06);
}

@media (prefers-reduced-motion: reduce) {
  body,
  body::before {
    transition: none;
  }
}

.hero {
  padding: 2.2rem 0 2.8rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

.eyebrow {
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin-top: 0;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.lead {
  color: var(--muted);
  max-width: 60ch;
}

.hero-card,
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 1rem;
}

.section {
  padding: 3rem 0;
}

.section.alt {
  background: #eef2f7;
}

.expand-cards {
  margin-top: 1rem;
  display: flex;
  gap: 0.8rem;
  min-height: 460px;
}

.expand-card {
  flex: 1;
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: flex 280ms ease, transform 280ms ease;
  display: flex;
  align-items: flex-end;
}

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

.expand-card.is-active {
  flex: 3.6;
}

.expand-overlay {
  width: 100%;
  padding: 1rem;
  color: #fff;
  background: linear-gradient(
    to top,
    rgba(2, 6, 23, 0.82),
    rgba(2, 6, 23, 0.36),
    rgba(2, 6, 23, 0.04)
  );
}

.expand-overlay h3 {
  margin-bottom: 0.2rem;
}

.expand-overlay p {
  margin: 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 1rem 0;
  color: var(--muted);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
}

[dir="rtl"] .footer-content {
  flex-direction: row-reverse;
}

.footer-contacts {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.footer-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}

.footer-contact-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
  font-weight: 500;
  margin: 0;
}

.footer-contact-link img,
.footer-contact-item img {
  width: 16px;
  height: 16px;
}

@media (max-width: 840px) {
  .hero-grid,
  .cards {
    grid-template-columns: 1fr;
  }

  .expand-cards {
    min-height: 0;
    flex-direction: column;
  }

  .expand-card {
    min-height: 210px;
  }

  .expand-card.is-active {
    min-height: 320px;
  }

  .hero {
    padding-top: 1.5rem;
  }

  .footer-content {
    align-items: flex-start;
    flex-direction: column;
  }
}
