@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&family=Inter:wght@400;600;700;800&display=swap');

:root {
  --bg: #070B17;
  --bg-2: #0C1224;
  --card: #111A33;
  --line: rgba(255, 255, 255, .08);
  --text: #E8EDF7;
  --muted: #94A3C2;
  --blue: #2F7BFF;
  --cyan: #22D3EE;
  --grad: linear-gradient(135deg, #2F7BFF 0%, #22D3EE 100%);
  --radius: 20px;
  --max: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Cairo', 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}
html[lang="en"] body { font-family: 'Inter', 'Cairo', system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* glow background */
.glow { position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(600px 400px at 85% -5%, rgba(47,123,255,.25), transparent 70%),
    radial-gradient(500px 400px at 5% 30%, rgba(34,211,238,.12), transparent 70%); }

/* nav */
.nav { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px);
  background: rgba(7, 11, 23, .72); border-bottom: 1px solid var(--line); }
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 20px; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 900; font-size: 22px; letter-spacing: .5px; }
.logo-mark { width: 42px; height: 42px; border-radius: 12px; background: var(--grad);
  display: grid; place-items: center; font-family: 'Inter'; font-weight: 900; color: #fff; font-size: 16px;
  box-shadow: 0 0 24px rgba(47,123,255,.5); }
.logo small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: 2px; font-family: 'Inter'; }
.links { display: flex; gap: 28px; font-weight: 700; color: var(--muted); }
.links a:hover { color: var(--text); }
.nav-actions { display: flex; gap: 12px; align-items: center; }
.lang { border: 1px solid var(--line); padding: 8px 14px; border-radius: 12px; font-weight: 700; cursor: pointer; background: transparent; color: var(--text); font-family: inherit; }

.btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 26px; border-radius: 14px; font-weight: 800; font-size: 16px; border: 0; cursor: pointer; font-family: inherit; transition: transform .2s, box-shadow .2s; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 30px rgba(47,123,255,.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(47,123,255,.5); }
.btn-ghost { border: 1px solid var(--line); color: var(--text); background: rgba(255,255,255,.03); }
.btn-ghost:hover { background: rgba(255,255,255,.07); }

/* hero */
.hero { padding: 110px 0 90px; text-align: center; }
.badge { display: inline-flex; gap: 8px; align-items: center; padding: 8px 18px; border-radius: 40px; border: 1px solid rgba(47,123,255,.4); background: rgba(47,123,255,.08); color: #9CC0FF; font-weight: 700; font-size: 14px; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.hero h1 { font-size: clamp(38px, 6vw, 72px); line-height: 1.2; font-weight: 900; margin: 26px auto 20px; max-width: 900px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: clamp(17px, 2vw, 21px); max-width: 720px; margin: 0 auto 36px; }
.hero .ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.pillars { display: flex; justify-content: center; gap: 12px; margin-top: 56px; flex-wrap: wrap; }
.pillars span { padding: 10px 18px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-weight: 700; font-size: 15px; background: rgba(255,255,255,.02); }

/* sections */
section { padding: 90px 0; }
.section-head { text-align: center; margin-bottom: 56px; }
.eyebrow { color: var(--cyan); font-weight: 800; letter-spacing: 2px; font-size: 14px; text-transform: uppercase; }
.section-head h2 { font-size: clamp(30px, 4vw, 46px); font-weight: 900; margin: 10px 0 12px; line-height: 1.3; }
.section-head p { color: var(--muted); font-size: 18px; max-width: 640px; margin: 0 auto; }

.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card { background: linear-gradient(180deg, var(--card), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; transition: transform .25s, border-color .25s; }
.card:hover { transform: translateY(-4px); border-color: rgba(47,123,255,.45); }
.icon { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 26px; background: rgba(47,123,255,.12); border: 1px solid rgba(47,123,255,.3); margin-bottom: 18px; }
.card h3 { font-size: 21px; font-weight: 800; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 15.5px; }
.price { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); font-weight: 800; color: #9CC0FF; font-size: 15px; }
.price b { font-family: 'Inter'; font-size: 20px; color: #fff; }

/* process */
.step { position: relative; }
.step .num { font-family: 'Inter'; font-size: 44px; font-weight: 900; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; margin-bottom: 14px; }

/* work */
.work { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; }
.work-card { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; }
.work-card .shot { aspect-ratio: 16/10; overflow: hidden; background: #0B1022; }
.work-card .shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .6s; }
.work-card:hover .shot img { transform: scale(1.04); }
.work-card .body { padding: 24px 26px 28px; }
.work > .work-card .shot { aspect-ratio: auto; flex: 1; min-height: 320px; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tags span { font-size: 12.5px; font-weight: 800; padding: 4px 12px; border-radius: 30px; background: rgba(34,211,238,.1); color: var(--cyan); }
.work-side { display: grid; gap: 22px; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.duo img { aspect-ratio: 9/14; object-fit: cover; object-position: top; }

/* why */
.why { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.why ul { list-style: none; display: grid; gap: 18px; }
.why li { display: flex; gap: 16px; align-items: flex-start; }
.why li .icon { flex: none; margin: 0; width: 46px; height: 46px; font-size: 20px; }
.why li b { display: block; font-size: 18px; }
.why li span { color: var(--muted); font-size: 15.5px; }
.panel { border-radius: 26px; padding: 40px; background: var(--grad); color: #fff; box-shadow: 0 30px 80px rgba(47,123,255,.3); }
.panel h3 { font-size: 30px; font-weight: 900; line-height: 1.3; margin-bottom: 14px; }
.panel p { opacity: .92; margin-bottom: 26px; }
.panel .btn { background: #fff; color: #0B1430; }

/* faq */
.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 14px; }
details { border: 1px solid var(--line); border-radius: 16px; background: var(--card); padding: 20px 24px; }
summary { cursor: pointer; font-weight: 800; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 20px; }
summary::after { content: "+"; color: var(--cyan); font-size: 22px; line-height: 1; }
details[open] summary::after { content: "−"; }
details p { color: var(--muted); margin-top: 12px; }

/* contact */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
form { display: grid; gap: 14px; }
input, select, textarea { width: 100%; padding: 15px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-family: inherit; font-size: 16px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(47,123,255,.6); border-color: transparent; }
textarea { min-height: 130px; resize: vertical; }
.contact-info { display: grid; gap: 16px; }
.contact-info a, .contact-info div { display: flex; gap: 14px; align-items: center; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); font-weight: 700; }

footer { border-top: 1px solid var(--line); padding: 36px 0; color: var(--muted); font-size: 14.5px; }
footer .container { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

.wa-float { position: fixed; bottom: 22px; inset-inline-end: 22px; width: 60px; height: 60px; border-radius: 50%; background: #25D366; display: grid; place-items: center; box-shadow: 0 10px 30px rgba(37,211,102,.45); z-index: 60; }
.wa-float svg { width: 32px; height: 32px; fill: #fff; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s, transform .7s; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 960px) {
  .links { display: none; }
  .grid-3, .grid-4, .work, .why, .contact { grid-template-columns: 1fr; }
  .hero { padding: 70px 0 60px; }
  section { padding: 64px 0; }
  .nav .btn { display: none; }
}
@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .panel { padding: 28px; }
  .card { padding: 24px; }
}

.grid-center { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; }
.grid-center > .card { flex: 0 1 calc((100% - 44px) / 3); }
.work.single { grid-template-columns: 1fr; max-width: 900px; margin: 0 auto; }
.work.single .shot { aspect-ratio: 16/9; flex: none; min-height: 0; }
@media (max-width: 960px) { .grid-center > .card { flex-basis: 100%; } }

/* ===== hero v2: copy + animated scene ===== */
.hero { text-align: start; padding: 70px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.hero-copy h1 { margin: 22px 0 18px; max-width: none; }
.hero-copy p { margin: 0 0 32px; max-width: 560px; }
.hero .ctas { justify-content: flex-start; }
.hero-art { position: relative; }
.scene { width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 30px 60px rgba(0,0,0,.35)); }
.scene * { transform-box: fill-box; }

.scene .orbit { transform-origin: center; animation: spin 50s linear infinite; }
.scene .orbit.rev { animation-direction: reverse; animation-duration: 35s; }
.scene .ln { transform-origin: left center; animation: type 6s var(--d) ease-out infinite both; }
.scene .cursor { animation: blink 1s steps(1) infinite; }
.scene .arm { transform-origin: 10% 5%; animation: tap .32s ease-in-out infinite alternate; }
.scene .head { transform-origin: 40% 90%; animation: nod 5s ease-in-out infinite; }
.scene .steam { animation: steam 2.8s ease-out infinite; }
.scene .steam.s2 { animation-delay: 1.4s; }
.scene .leaf { transform-origin: bottom center; animation: sway 4s ease-in-out infinite alternate; }
.scene .leaf.l2 { animation-duration: 5s; animation-direction: alternate-reverse; }
.scene .float { animation: bob 6s ease-in-out infinite; }
.scene .f2 { animation-duration: 7s; animation-delay: -2s; }
.scene .f3 { animation-duration: 5.5s; animation-delay: -1s; }
.scene .f4 { animation-duration: 6.5s; animation-delay: -3s; }
.scene .bar { transform-origin: bottom center; animation: grow 2.4s ease-in-out infinite alternate; }
.scene .bar:nth-of-type(2) { animation-delay: .3s; } .scene .bar:nth-of-type(3) { animation-delay: .6s; } .scene .bar:nth-of-type(4) { animation-delay: .9s; }
.scene .keys { animation: keys .32s ease-in-out infinite alternate; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes type { 0% { transform: scaleX(0); opacity: 1; } 10% { transform: scaleX(1); } 80% { opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes tap { from { transform: rotate(-2deg); } to { transform: rotate(2.5deg); } }
@keyframes nod { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(3deg); } }
@keyframes steam { 0% { transform: translateY(6px); opacity: 0; } 30% { opacity: .8; } 100% { transform: translateY(-18px); opacity: 0; } }
@keyframes sway { from { transform: rotate(-4deg); } to { transform: rotate(5deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes grow { from { transform: scaleY(.25); } to { transform: scaleY(var(--h)); } }
@keyframes keys { from { fill: #33447A; } to { fill: #3E56A0; } }

/* tech marquee */
.marquee { border-block: 1px solid var(--line); background: rgba(255,255,255,.015); overflow: hidden; padding: 18px 0; margin-top: 30px; direction: ltr; }
.marquee .track { display: flex; gap: 14px; width: max-content; animation: marquee 38s linear infinite; }
.marquee span { padding: 8px 18px; border-radius: 30px; border: 1px solid var(--line); color: var(--muted); font-family: 'Inter', sans-serif; font-weight: 700; font-size: 15px; white-space: nowrap; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* line icons */
.icon svg { width: 26px; height: 26px; color: #8DB6FF; }
.why li .icon svg { width: 22px; height: 22px; }
.card .icon { transition: box-shadow .3s, background .3s; }
.card:hover .icon { background: rgba(47,123,255,.22); box-shadow: 0 0 24px rgba(47,123,255,.45); }

/* tilt + spotlight on cards */
.card { position: relative; transform-style: preserve-3d; will-change: transform; }
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), rgba(47,123,255,.16), transparent 60%); }
.card:hover::before { opacity: 1; }

/* process steps: connecting line */
#process .grid-4 { position: relative; }
#process .grid-4::before { content: ""; position: absolute; top: 58px; inset-inline: 8%; height: 2px; background: linear-gradient(90deg, transparent, rgba(47,123,255,.6), rgba(34,211,238,.6), transparent); z-index: -1; }

/* animated grid backdrop */
.glow::after { content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 56px 56px; mask-image: radial-gradient(ellipse at 70% 0%, #000 10%, transparent 65%); -webkit-mask-image: radial-gradient(ellipse at 70% 0%, #000 10%, transparent 65%); }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero { text-align: center; padding: 48px 0 20px; }
  .hero .ctas { justify-content: center; }
  .hero-copy p { margin-inline: auto; }
  .hero-art { max-width: 460px; margin: 10px auto 0; }
  #process .grid-4::before { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

.hero-copy h1 { font-size: clamp(36px, 4.8vw, 66px); }
html[lang="en"] .hero-copy h1 { font-size: clamp(34px, 4vw, 56px); line-height: 1.15; }

/* ===== motion v3: cinematic layer (inspired by dark "stage" sites) ===== */
:root { --bg: #03050D; }
.hero-art { min-height: 520px; }
#constellation { position: absolute; inset: -40px -20px; width: calc(100% + 40px); height: calc(100% + 80px); cursor: crosshair; }
.hero-hint { position: absolute; bottom: 6px; inset-inline-start: 50%; transform: translateX(50%); color: var(--muted); font-size: 13px; letter-spacing: 1px; opacity: .7; pointer-events: none; animation: hint 3s ease-in-out infinite; }
html[dir="ltr"] .hero-hint { transform: translateX(-50%); }
@keyframes hint { 50% { opacity: .25; } }

/* word-by-word rise */
/* no overflow clipping: Arabic dots and hamza below the line must never be cut */
.hero-copy h1 .w { display: inline-block; }
.hero-copy h1 .w > span { display: inline-block; transform: translateY(45%); opacity: 0; filter: blur(8px); }
.hero-copy h1.words-in .w > span { animation: rise .9s cubic-bezier(.2, .7, .1, 1) forwards; animation-delay: calc(var(--i) * 90ms + 150ms); }
.hero-copy h1 .grad-text .w > span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes rise { to { transform: none; opacity: 1; filter: blur(0); } }
.hero-copy .badge, .hero-copy p, .hero-copy .ctas { animation: fadeUp .9s .7s cubic-bezier(.2,.7,.1,1) both; }
.hero-copy p { animation-delay: .85s; } .hero-copy .ctas { animation-delay: 1s; } .hero-copy .badge { animation-delay: 0s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } }

/* sticky scroll statement: huge metallic MBG grows and shines */
.statement { height: 220vh; padding: 0; position: relative; }
.statement-sticky { position: sticky; top: 0; height: 100vh; display: grid; place-items: center; align-content: center; gap: 10px; overflow: hidden; }
.statement-word {
  font-family: 'Inter', sans-serif; font-weight: 900; line-height: .9; letter-spacing: -.04em;
  font-size: clamp(120px, 26vw, 380px); direction: ltr;
  background: linear-gradient(100deg, #5b6478 0%, #e8edf7 calc(var(--p, 0) * 100% - 10%), #22D3EE calc(var(--p, 0) * 100%), #e8edf7 calc(var(--p, 0) * 100% + 10%), #5b6478 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  transform: scale(calc(.55 + var(--p, 0) * .6)); opacity: calc(.25 + var(--p, 0) * 1.2);
  filter: drop-shadow(0 0 calc(var(--p, 0) * 60px) rgba(47,123,255,.45));
}
.statement-line { color: var(--muted); font-size: clamp(18px, 2.2vw, 28px); font-weight: 700; letter-spacing: 2px; opacity: calc(var(--p, 0) * 2 - .6); transform: translateY(calc((1 - var(--p, 0)) * 40px)); }

/* why section with the developer scene */
.why-art { position: relative; }
.why-art .scene { max-width: 560px; margin: 0 auto; }
.cta-band { padding-top: 0; }
.panel.wide { display: grid; grid-template-columns: 1.4fr auto; align-items: center; gap: 30px; }
.panel.wide p { margin-bottom: 0; }
.panel.wide .btn { justify-self: end; }

/* top scroll progress */
.progress { position: fixed; top: 0; inset-inline: 0; height: 3px; background: var(--grad); transform-origin: right; transform: scaleX(0); z-index: 100; box-shadow: 0 0 12px rgba(34,211,238,.6); }
html[dir="ltr"] .progress { transform-origin: left; }

.btn-primary { transition: transform .25s cubic-bezier(.2,.7,.1,1), box-shadow .2s; }

@media (max-width: 960px) {
  .hero-art { min-height: 340px; }
  .panel.wide { grid-template-columns: 1fr; }
  .panel.wide .btn { justify-self: start; }
  .statement { height: 160vh; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-copy h1 .w > span { transform: none; opacity: 1; }
  .statement { height: auto; } .statement-sticky { position: static; height: 60vh; }
  .statement-word { transform: none; opacity: 1; }
}
.hero-art { width: 100%; }
/* safety net: after the intro, hero text is shown even if the browser paused animations */
.anim-done .hero-copy h1 .w > span, .anim-done .hero-copy .badge, .anim-done .hero-copy p, .anim-done .hero-copy .ctas { animation: none; opacity: 1; transform: none; filter: none; }
.panel.wide { grid-template-columns: 1fr auto; row-gap: 6px; }
.panel.wide h3, .panel.wide p { grid-column: 1; margin: 0; }
.panel.wide .btn { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
@media (max-width: 960px) { .panel.wide .btn { grid-column: 1; grid-row: auto; margin-top: 14px; } }

/* portfolio case study */
.case { display: grid; grid-template-columns: 1.25fr 1fr; gap: 40px; align-items: center; background: linear-gradient(180deg, var(--card), var(--bg-2)); border: 1px solid var(--line); border-radius: 28px; padding: 34px; }
.case-shots { position: relative; aspect-ratio: 16/11; }
.case-shots img { position: absolute; width: 82%; border-radius: 16px; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 30px 60px rgba(0,0,0,.45); transition: transform .6s cubic-bezier(.2,.7,.1,1); }
.case-shots .s1 { top: 0; inset-inline-start: 0; }
.case-shots .s2 { bottom: 0; inset-inline-end: 0; }
.case:hover .s1 { transform: translate(6px, -6px); } .case:hover .s2 { transform: translate(-6px, 6px) scale(1.02); }
.case-body h3 { font-size: 26px; font-weight: 900; line-height: 1.35; margin: 6px 0 12px; }
.case-body p { color: var(--muted); }
.case-points { list-style: none; display: grid; gap: 8px; margin: 18px 0 24px; }
.case-points li { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.case-points li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); flex: none; }
.case-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 960px) { .case { grid-template-columns: 1fr; padding: 20px; } }

.case + .case { margin-top: 26px; }
.case.flip .case-shots { order: 2; }
.case.flip .s2 { width: 46%; aspect-ratio: 1; object-fit: cover; }
@media (max-width: 960px) { .case.flip .case-shots { order: 0; } }
