: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 { 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: 560px) { .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; } }
