:root {
  --paper: #F4F6FB;
  --paper-2: #E9EEF8;
  --ink: #07142E;
  --ink-soft: #4A5775;
  --navy: #050D1F;
  --navy-2: #0A1832;
  --blue: #1E7BFF;
  --blue-2: #2B9DFF;
  --line: rgba(7, 20, 46, .12);
  --line-dark: rgba(255, 255, 255, .12);
  --radius: 18px;
  --font-display: "Noto Kufi Arabic", "IBM Plex Sans Arabic", sans-serif;
  --font-body: "IBM Plex Sans Arabic", "Noto Kufi Arabic", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.85;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
.mono { font-family: var(--font-mono); direction: ltr; unicode-bidi: isolate; }
.wrap { width: min(1080px, 100% - 40px); margin-inline: auto; }

/* cursor glow */
.glow {
  position: fixed; z-index: 0; pointer-events: none;
  width: 520px; height: 520px; border-radius: 50%;
  left: 0; top: 0;
  background: radial-gradient(circle, rgba(43, 157, 255, .20), transparent 65%);
  transform: translate(-50%, -50%);
  transition: opacity .4s;
  opacity: 0;
}
main, .nav, .foot { position: relative; z-index: 1; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px max(20px, calc((100% - 1080px) / 2));
  transition: background .3s, box-shadow .3s, backdrop-filter .3s;
}
.nav.scrolled {
  background: rgba(244, 246, 251, .82);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 500; letter-spacing: .02em; }
.brand img { width: 44px; height: 44px; }
.nav nav { display: flex; align-items: center; gap: 26px; font-size: .95rem; font-weight: 500; }
.nav nav a:not(.pill) { position: relative; padding: 4px 0; }
.nav nav a:not(.pill)::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 2px;
  background: var(--blue); transform: scaleX(0); transform-origin: right; transition: transform .3s;
}
.nav nav a:not(.pill):hover::after { transform: scaleX(1); transform-origin: left; }
.pill {
  background: var(--ink); color: #fff; padding: 8px 20px; border-radius: 999px;
  transition: background .25s, transform .25s;
}
.pill:hover { background: var(--blue); transform: translateY(-2px); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  grid-template-areas: "text mark" "facts facts";
  align-items: center;
  gap: 20px 40px;
  padding: 120px max(20px, calc((100% - 1080px) / 2)) 40px;
  overflow: hidden;
}
.grid-bg {
  position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, #000 20%, transparent 75%);
}
.hero-text { grid-area: text; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .9rem; font-weight: 500; color: var(--ink-soft);
  padding: 6px 16px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 255, 255, .6);
}
.eyebrow.sec { font-size: .82rem; border: 0; background: none; padding: 0; color: var(--blue); letter-spacing: .06em; }
.eyebrow.light { color: var(--blue-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 4px rgba(34, 197, 94, .2); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } }

h1 {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(2.4rem, 6.4vw, 4.9rem);
  line-height: 1.25; margin: 22px 0 20px; letter-spacing: -.01em;
}
h1 em, h2 em {
  font-style: normal;
  background: linear-gradient(100deg, #0f2f6e 0%, var(--blue) 55%, var(--blue-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 36em; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  padding: 14px 28px; border-radius: 999px; border: 1.5px solid var(--ink);
  transition: transform .25s, background .25s, color .25s, box-shadow .25s;
}
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--blue); border-color: var(--blue); transform: translateY(-3px); box-shadow: 0 14px 30px -10px rgba(30, 123, 255, .6); }
.btn.primary span { transition: transform .25s; }
.btn.primary:hover span { transform: translateX(-5px); }
.btn.ghost:hover { background: var(--ink); color: #fff; transform: translateY(-3px); }

.hero-mark { grid-area: mark; position: relative; display: grid; place-items: center; }
.hero-mark img { position: relative; width: min(100%, 460px); animation: float 7s ease-in-out infinite; filter: drop-shadow(0 30px 40px rgba(30, 123, 255, .25)); }
.halo {
  position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(30, 123, 255, .35), rgba(43, 157, 255, 0), rgba(7, 20, 46, .25), rgba(30, 123, 255, .35));
  filter: blur(50px); animation: spin 18s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-14px) rotate(-1.2deg); } }

.facts {
  grid-area: facts; display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line); margin-top: 20px;
}
.facts li { padding: 22px 8px; display: flex; flex-direction: column; }
.facts li + li { border-inline-start: 1px solid var(--line); padding-inline-start: 28px; }
.facts b { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.facts span { color: var(--ink-soft); font-size: .92rem; }

/* ---------- section heads ---------- */
.sec-head { margin-bottom: 56px; }
h2 {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.3; margin-top: 14px;
}

/* ---------- works (dark) ---------- */
.works {
  position: relative;
  background: var(--navy);
  color: #E7EEFF;
  padding: 120px 0;
  border-radius: 40px 40px 0 0;
  overflow: hidden;
}
.works::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 70%; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(30, 123, 255, .22), transparent 62%);
  pointer-events: none;
}
.works .wrap { position: relative; }
.works h2 { color: #fff; }
.project {
  display: grid; grid-template-columns: 90px 1fr; gap: 24px;
  padding: 36px 0; border-top: 1px solid var(--line-dark);
  transition: background .35s, padding .35s;
}
.project:last-child { border-bottom: 1px solid var(--line-dark); }
.project:hover { background: linear-gradient(90deg, transparent, rgba(30, 123, 255, .08)); padding-inline: 18px; }
.num { font-size: 1.1rem; color: var(--blue-2); padding-top: 10px; opacity: .8; transition: opacity .3s, transform .3s; }
.project:hover .num { opacity: 1; transform: translateX(-4px); }
.project .top { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 10px; }
.project h3 { font-family: var(--font-display); font-size: clamp(1.6rem, 3.2vw, 2.3rem); font-weight: 700; color: #fff; }
.status {
  font-size: .8rem; padding: 3px 14px; border-radius: 999px; font-weight: 500;
  border: 1px solid var(--line-dark); color: #A8B7D6;
}
.status.live { color: #6EE7A0; border-color: rgba(110, 231, 160, .4); background: rgba(34, 197, 94, .08); }
.status.wip { color: #FFD479; border-color: rgba(255, 212, 121, .35); background: rgba(255, 212, 121, .06); }
.what { color: #D5E0F7; max-width: 46em; }
.problem { color: #94A5C7; font-size: .97rem; margin-top: 8px; max-width: 46em; }
.problem b { color: #C9D6F2; font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tags li { font-size: .78rem; padding: 4px 12px; border-radius: 8px; background: rgba(255, 255, 255, .06); color: #BFD0F5; }
.visit {
  display: inline-block; margin-top: 18px; font-family: var(--font-display); font-weight: 700; font-size: .95rem;
  color: var(--blue-2); border-bottom: 1.5px solid currentColor; padding-bottom: 2px; transition: color .2s;
}
.visit:hover { color: #fff; }

/* ---------- how ---------- */
.how { padding: 120px 0; background: var(--paper); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 28px; transition: transform .3s, box-shadow .3s, border-color .3s;
}
.step:hover { transform: translateY(-6px); border-color: var(--blue); box-shadow: 0 24px 40px -24px rgba(30, 123, 255, .5); }
.step .n {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--ink); color: #fff; font-weight: 500; margin-bottom: 18px;
}
.step h3 { font-family: var(--font-display); font-size: 1.25rem; margin-bottom: 8px; }
.step p { color: var(--ink-soft); font-size: .98rem; }
.about {
  margin-top: 48px; padding: 28px 32px; border-inline-start: 4px solid var(--blue);
  background: var(--paper-2); border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1.08rem; max-width: 52em;
}

/* ---------- contact ---------- */
.contact { padding: 120px 0 130px; text-align: center; background: linear-gradient(180deg, var(--paper), var(--paper-2)); }
.contact .eyebrow { margin-bottom: 8px; }
.contact h2 { font-size: clamp(2.2rem, 6vw, 4.4rem); }
.contact .lead { margin: 18px auto 0; }
.channels { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 40px; }
.channels .note { color: var(--ink-soft); font-size: .95rem; }

/* ---------- footer ---------- */
.foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px;
  padding: 28px 20px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: .9rem;
  background: var(--paper-2);
}

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
.hero .reveal:nth-child(2) { transition-delay: .08s; }
.hero .reveal:nth-child(3) { transition-delay: .16s; }
.hero .reveal:nth-child(4) { transition-delay: .24s; }
.steps .step:nth-child(2) { transition-delay: .1s; }
.steps .step:nth-child(3) { transition-delay: .2s; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; grid-template-areas: "mark" "text" "facts"; padding-top: 96px; text-align: start; }
  .hero-mark img { width: min(62%, 260px); }
  .facts { grid-template-columns: 1fr; }
  .facts li + li { border-inline-start: 0; border-top: 1px solid var(--line); padding-inline-start: 8px; }
  .steps { grid-template-columns: 1fr; }
  .project { grid-template-columns: 1fr; gap: 6px; }
  .project:hover { padding-inline: 0; }
  .works { border-radius: 28px 28px 0 0; padding: 80px 0; }
  .how, .contact { padding: 80px 0; }
  .nav nav a:not(.pill) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
