/* =========================================================
   RAI — Design System
   Realign · Automate · Integrate
   ========================================================= */

:root {
  /* Color */
  --ink:        oklch(0.18 0.012 80);
  --ink-soft:   oklch(0.32 0.010 80);
  --ink-mute:   oklch(0.52 0.008 80);
  --line:       oklch(0.88 0.008 80);
  --line-soft:  oklch(0.93 0.006 80);
  --cream:      oklch(0.972 0.008 85);
  --cream-deep: oklch(0.945 0.012 80);
  --paper:      oklch(0.99 0.004 85);
  --copper:     oklch(0.58 0.13 55);
  --copper-deep:oklch(0.46 0.12 50);
  --copper-soft:oklch(0.92 0.04 70);

  /* Type */
  --font-display: "Instrument Serif", "Times New Roman", serif;
  --font-body:    "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, Menlo, monospace;

  /* Spacing scale (8px base) */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  --sp-9: 96px; --sp-10: 128px; --sp-11: 192px;

  /* Layout */
  --maxw: 1280px;
  --gutter: 32px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; max-width: 100%; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--copper); color: var(--cream); }

/* ---------- Typography ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.98;
  text-wrap: balance;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  font-weight: 500;
}
.lead {
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.5;
  color: var(--ink-soft);
  text-wrap: pretty;
}
.mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; }
.italic-serif { font-family: var(--font-display); font-style: italic; }

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

/* ---------- Layout ---------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section { padding: var(--sp-10) 0; }
.section-tight { padding: var(--sp-9) 0; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in oklch, var(--cream) 88%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -0.01em;
}
.logo .ar {
  font-family: "Noto Naskh Arabic", "Amiri", serif;
  font-size: 22px;
  color: var(--copper);
  transform: translateY(2px);
}
.logo .dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--copper);
  border-radius: 50%;
  transform: translateY(-2px);
}
.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
  list-style: none;
}
.nav-links a {
  font-size: 14px;
  color: var(--ink-soft);
  position: relative;
  padding: 6px 0;
  transition: color .15s ease;
}
.nav-links a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--copper);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after,
.nav-links a.is-active::after { transform: scaleX(1); }
.nav-links a.is-active { color: var(--ink); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--cream);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  transition: transform .2s ease, background .2s ease;
}
.nav-cta:hover { background: var(--copper-deep); transform: translateY(-1px); }
.nav-cta .arrow { transition: transform .25s ease; }
.nav-cta:hover .arrow { transform: translateX(3px); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px; height: 32px;
  align-items: center;
  justify-content: center;
}
.nav-toggle span {
  display: block;
  width: 20px; height: 1.5px;
  background: var(--ink);
  position: relative;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: var(--ink);
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  font-family: var(--font-body);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: var(--cream);
}
.btn-primary:hover { background: var(--copper-deep); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--ink); }
.btn .arrow { display: inline-block; transition: transform .25s ease; }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- Page Header (used on inner pages) ---------- */
.page-head {
  padding: var(--sp-9) 0 var(--sp-7);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--paper) 0%, var(--cream) 100%);
}
.page-head .display { font-size: clamp(44px, 6vw, 84px); }
.page-head .lead { max-width: 640px; margin-top: var(--sp-4); }
.page-head .crumb {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--sp-5);
}
.page-head .crumb .bar { width: 32px; height: 1px; background: var(--copper); }

/* ---------- Footer ---------- */
.footer {
  background: var(--ink);
  color: oklch(0.85 0.008 80);
  padding: var(--sp-9) 0 var(--sp-6);
  margin-top: var(--sp-10);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
}
.footer h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: oklch(0.65 0.008 80);
  margin-bottom: var(--sp-4);
  font-weight: 500;
}
.footer .display {
  color: var(--cream);
  font-size: 42px;
  margin-bottom: var(--sp-3);
}
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 10px; font-size: 14px; }
.footer ul li a:hover { color: var(--copper); }
.footer .office {
  font-size: 14px;
  line-height: 1.6;
  color: oklch(0.75 0.008 80);
}
.footer .office strong { color: var(--cream); font-weight: 500; display: block; margin-bottom: 4px; }
.footer-bottom {
  margin-top: var(--sp-8);
  padding-top: var(--sp-5);
  border-top: 1px solid oklch(0.30 0.01 80);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: oklch(0.6 0.008 80);
  font-family: var(--font-mono);
}

/* ---------- Cards ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: var(--sp-6);
  transition: transform .35s cubic-bezier(.2,.7,.2,1), border-color .25s ease, box-shadow .35s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--ink);
  box-shadow: 0 24px 60px -28px oklch(0.18 0.012 80 / 0.18);
}

/* ---------- Reveal animation (scroll) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1);
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
  background: var(--paper);
}
.marquee-track {
  display: flex;
  gap: 64px;
  white-space: nowrap;
  animation: marquee 38s linear infinite;
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--ink-soft);
}
.marquee-track span { display: inline-flex; align-items: center; gap: 64px; }
.marquee-track .dot {
  width: 6px; height: 6px; background: var(--copper); border-radius: 50%;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  :root { --gutter: 20px; --sp-9: 64px; --sp-10: 80px; --sp-11: 120px; }
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: inline-flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px 32px; }
  .footer-bottom { flex-direction: column; gap: 12px; align-items: flex-start; }
}
@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- Mobile menu drawer ---------- */
.mobile-menu {
  position: absolute;
  top: 100%; left: 0; right: 0;
  height: calc(100vh - 72px);
  height: calc(100dvh - 72px);
  overflow-y: auto;
  background: var(--cream);
  z-index: 99;
  padding: 32px var(--gutter);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
  display: none;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; }
.mobile-menu ul { list-style: none; }
.mobile-menu ul li {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.mobile-menu ul li a {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--ink);
}
.mobile-menu .btn { margin-top: 32px; width: 100%; justify-content: center; }
@media (max-width: 880px) {
  .mobile-menu { display: block; }
}
