:root {
  --bg: #070707;
  --panel: #12111a;
  --line: #26243a;
  --text: #f2f2f2;
  --muted: #9a9a9a;
  --glow: #b46bff;
  --glow2: #6be0ff;
  --radius: 18px;
  --font: "Space Grotesk", system-ui, sans-serif;
}
html[lang="ar"] { --font: "IBM Plex Sans Arabic", system-ui, sans-serif; }

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

/* language switch: show only the active language */
html[lang="en"] [lang="ar"], html[lang="ar"] [lang="en"] { display: none; }

/* nav */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; padding: 14px clamp(16px, 4vw, 48px); background: rgba(7, 7, 7, .6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.logo { direction: ltr; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 20px; letter-spacing: -0.02em; font-family: "Space Grotesk", sans-serif; }
.logo span { color: var(--glow); margin-inline-start: -4px; font-weight: 400; }
.nav nav { display: flex; gap: clamp(12px, 3vw, 28px); align-items: center; font-size: 15px; }
.nav nav a { color: var(--muted); transition: color .2s; }
.nav nav a:hover { color: var(--text); }
.lang { background: none; border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; cursor: pointer; }
.lang:hover { border-color: var(--glow); }
@media (max-width: 760px) { .nav nav a { display: none; } }

/* 3D stage */
.stage { position: relative; height: 100svh; min-height: 560px; overflow: hidden; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: pan-y; }

.intro { position: absolute; top: 84px; inset-inline-start: clamp(16px, 4vw, 48px); max-width: 600px; pointer-events: none; transition: opacity .6s; }
.stage.picked .intro { opacity: 0; }
.eyebrow { color: var(--glow); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 8px; }
h1 { font-size: clamp(28px, 3.6vw, 46px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 700; }
html[lang="ar"] h1 { line-height: 1.3; letter-spacing: 0; }
h1 em { font-style: normal; background: linear-gradient(90deg, var(--glow), var(--glow2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hint { color: var(--muted); font-size: 14px; margin-top: 12px; }

.panel { position: absolute; inset: auto 0 0 0; padding: 0 clamp(16px, 4vw, 48px) 20px; display: flex; flex-direction: column; gap: 12px; pointer-events: none; }
.panel > * { pointer-events: auto; }
.caption { max-width: 460px; background: rgba(16, 16, 16, .78); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.caption .client { color: var(--glow); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.caption h3 { font-size: 20px; margin: 2px 0 4px; }
.caption p:not(.client) { color: var(--muted); font-size: 14px; }
.caption .link { display: inline-block; margin-top: 8px; color: var(--glow); font-size: 14px; }

.chips-label { color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chip { flex: none; background: rgba(16, 16, 16, .7); border: 1px solid var(--line); border-radius: 99px; padding: 9px 16px; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: border-color .2s, background .2s; }
.chip:hover { border-color: var(--glow); }
.chip.on { background: var(--glow); color: #ffffff; border-color: var(--glow); }

.sound-btn { position: absolute; top: 76px; inset-inline-end: clamp(16px, 4vw, 48px); width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: rgba(16, 16, 16, .7); cursor: pointer; font-size: 18px; }

.fallback { display: none; }
.stage.no-webgl .fallback { display: block; position: absolute; top: 50%; inset-inline: 24px; text-align: center; color: var(--muted); }
.stage.no-webgl .panel { display: none; }

@media (max-width: 700px) {
  .intro { top: 72px; }
  /* phones: project text goes to the top (where the intro was), chips stay at the bottom */
  .panel { inset: 0; padding-top: 68px; }
  .chips-wrap { margin-top: auto; }
  .caption { padding: 12px 14px; max-width: none; }
  .caption p:not(.client) { font-size: 13px; }
  .sound-btn { top: auto; bottom: 96px; }
}

/* sections */
.section { padding: clamp(64px, 10vw, 120px) clamp(16px, 6vw, 96px); max-width: 1280px; margin: 0 auto; }
h2 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.02em; margin-bottom: 40px; }
html[lang="ar"] h2 { letter-spacing: 0; }
.lead { color: var(--muted); font-size: clamp(17px, 2vw, 20px); margin: 0 auto 32px; max-width: 600px; }

.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.svc { background: var(--bg); padding: 28px; transition: background .3s; }
.svc:hover { background: var(--panel); }
.svc h3 { font-size: 19px; margin-bottom: 8px; }
.svc p { color: var(--muted); }

.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-block; padding: 13px 22px; border-radius: 99px; border: 1px solid var(--line); font-weight: 500; transition: border-color .2s, transform .2s; }
.btn:hover { border-color: var(--glow); transform: translateY(-1px); }
.btn.primary { background: var(--glow); color: #ffffff; border-color: var(--glow); }

.contact { text-align: center; }
.contact .cta { justify-content: center; }

.foot { display: flex; justify-content: space-between; padding: 24px clamp(16px, 6vw, 96px); color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

/* titles */
:root { --title: "Julius Sans One", "Space Grotesk", sans-serif; }
html[lang="ar"] { --title: "IBM Plex Sans Arabic", sans-serif; }
h1, h2, h3 { font-family: var(--title); }
html[lang="en"] h1, html[lang="en"] h2, html[lang="en"] h3 { font-weight: 400; letter-spacing: 0.02em; }
@media (max-width: 900px) { .services { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .services { grid-template-columns: 1fr; } }

/* vision */
.vision .statement { font-family: var(--title); font-size: clamp(28px, 4.4vw, 56px); line-height: 1.2; max-width: 1000px; margin: 8px 0 24px; }
html[lang="en"] .vision .statement { letter-spacing: 0.02em; }
.vision .statement em { font-style: normal; background: linear-gradient(90deg, var(--glow), var(--glow2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.vision .lead { margin: 0 0 48px; max-width: 720px; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pillar { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; background: linear-gradient(160deg, rgba(180,107,255,.10), transparent 60%); }
.pillar .num { display: block; font-family: "Space Grotesk", sans-serif; color: var(--glow2); font-size: 14px; letter-spacing: .1em; margin-bottom: 14px; }
.pillar h3 { font-size: 21px; margin-bottom: 8px; }
.pillar p { color: var(--muted); }
@media (max-width: 820px) { .pillars { grid-template-columns: 1fr; } }

/* process (booking workflow) */
.process { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.process-head { position: sticky; top: 96px; }
.process-head h2 { margin-bottom: 16px; }
.process-head .lead { margin: 0 0 28px; }
.steps { list-style: none; padding: 0; counter-reset: step; position: relative; }
.steps::before { content: ""; position: absolute; top: 8px; bottom: 8px; inset-inline-start: 21px; width: 2px; background: linear-gradient(var(--glow), var(--glow2)); opacity: .5; }
.steps li { counter-increment: step; position: relative; padding-inline-start: 72px; padding-bottom: 36px; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before { content: counter(step, decimal-leading-zero); position: absolute; inset-inline-start: 0; top: -4px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font: 500 14px "Space Grotesk", sans-serif; color: var(--text); background: var(--bg); border: 1px solid var(--glow); box-shadow: 0 0 18px rgba(180,107,255,.35); }
.steps h3 { font-size: 21px; margin-bottom: 4px; }
.steps p { color: var(--muted); }
@media (max-width: 820px) {
  .process { grid-template-columns: 1fr; }
  .process-head { position: static; }
}

/* lab: fun things we can build */
.lab .lead { margin: 0 0 40px; max-width: 720px; }
.lab-group { font-size: 15px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; margin: 8px 0 16px; }
html[lang="ar"] .lab-group { letter-spacing: 0; }
.lab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; margin-bottom: 48px; }
.lab-card { position: relative; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 20px 22px; background: var(--panel); overflow: hidden; transition: transform .25s ease-out, border-color .25s; will-change: transform; }
.lab-card:hover { border-color: hsl(var(--h1) 80% 65% / .6); transition: transform .08s linear, border-color .25s; }
.lab-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), hsl(var(--h1) 90% 70% / .14), transparent 55%); opacity: 0; transition: opacity .3s; }
.lab-card:hover::after { opacity: 1; }
.lab-art { position: relative; height: 120px; margin: 0 -20px 16px; overflow: hidden; background: #0b0b12; }
.lab-art i { position: absolute; border-radius: 50%; filter: blur(18px); opacity: .75; animation: drift 9s ease-in-out infinite alternate; }
.lab-art i:nth-child(1) { width: 120px; height: 120px; left: 10%; top: -20%; background: hsl(var(--h1) 90% 60%); }
.lab-art i:nth-child(2) { width: 90px; height: 90px; right: 12%; top: 30%; background: hsl(var(--h2) 90% 60%); animation-duration: 11s; animation-delay: -3s; }
.lab-art i:nth-child(3) { width: 50px; height: 50px; left: 45%; top: 55%; background: #fff; opacity: .35; animation-duration: 7s; animation-delay: -5s; }
.lab-card:hover .lab-art i { animation-duration: 2.5s; }
@keyframes drift { to { transform: translate(30px, 18px) scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .lab-art i { animation: none; } }
.lab-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.lab-meta .tag, .lab-meta .badge { font-size: 11px; border-radius: 99px; padding: 2px 9px; }
.lab-meta .tag { border: 1px solid var(--line); color: var(--muted); }
.lab-meta .badge { background: rgba(107, 224, 255, .14); color: var(--glow2); border: 1px solid rgba(107, 224, 255, .35); }
.lab-card h3 { font-size: 19px; margin-bottom: 6px; }
.lab-card p { color: var(--muted); font-size: 14.5px; }

/* WhatsApp button + popup */
.wa { position: fixed; z-index: 20; bottom: 20px; inset-inline-end: 20px; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.wa-btn { width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff; background: #25d366; box-shadow: 0 6px 24px rgba(37, 211, 102, .45); transition: transform .2s; animation: wa-pulse 2.8s ease-out infinite; }
.wa-btn:hover { transform: scale(1.07); }
.wa-btn.open { animation: none; }
@keyframes wa-pulse { 0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .55), 0 6px 24px rgba(37, 211, 102, .45); } 70%, 100% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0), 0 6px 24px rgba(37, 211, 102, .45); } }
.wa-pop { width: min(320px, calc(100vw - 40px)); border-radius: 18px; overflow: hidden; background: #111; border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0, 0, 0, .6); animation: wa-in .22s ease-out; }
.wa-pop[hidden] { display: none; }
@keyframes wa-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.wa-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px; background: #075e54; color: #fff; }
.wa-head img { border-radius: 50%; background: #fff; }
.wa-head div { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.wa-head small { opacity: .8; font-size: 12px; }
.wa-x { background: none; border: 0; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.wa-body { padding: 18px 14px; background: #0b141a; }
.wa-msg { background: #202c33; color: #e9edef; padding: 10px 12px; border-radius: 0 12px 12px 12px; font-size: 14.5px; max-width: 90%; }
html[dir="rtl"] .wa-msg { border-radius: 12px 0 12px 12px; }
.wa-go { display: block; text-align: center; padding: 13px; background: #25d366; color: #fff; font-weight: 600; }
.wa-go:hover { background: #20bd5a; }
/* keep the stage buttons and sound button clear of the WhatsApp button */
.chips-wrap { margin-inline-end: 70px; }
@media (max-width: 700px) { .sound-btn { bottom: 150px; } }
