:root {
  --void: #05090a;
  --on-dark: #f2f6f4;
  --on-dark-dim: #a9c2be;
  --on-dark-faint: #6f8683;

  --brand: #2fc7c0;
  --brand-line: rgba(47,199,192,0.35);

  --charcoal: #9aa3a1;
  --whatsapp: #25d366;

  --radius: 4px;
  --font-display: 'Unbounded', sans-serif;
  --font-body: 'Work Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; overflow: hidden; }

body {
  background: var(--void);
  color: var(--on-dark);
  font-family: var(--font-body);
}

h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button { font: inherit; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Atmosphere: full-bleed glowing gradients, no boxes ---------- */
.atmosphere {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  opacity: 0; transition: opacity 1.2s ease;
}
.atmosphere.visible { opacity: 1; }
.blob {
  position: absolute; width: 62vmax; height: 62vmax; border-radius: 50%;
  filter: blur(90px); mix-blend-mode: screen; opacity: 0.65;
}
.blob-1 { top: -18%; left: -12%; animation: drift1 26s ease-in-out infinite; }
.blob-2 { bottom: -22%; right: -14%; animation: drift2 32s ease-in-out infinite; }
@keyframes drift1 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(6%, 4%) scale(1.08); } }
@keyframes drift2 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-5%, -6%) scale(1.05); } }

.atmosphere[data-mood="home"] .blob-1 { background: radial-gradient(circle, #2fc7c0, transparent 70%); }
.atmosphere[data-mood="home"] .blob-2 { background: radial-gradient(circle, #14324a, transparent 70%); }

.atmosphere[data-mood="about"] .blob-1 { background: radial-gradient(circle, #d9a441, transparent 70%); }
.atmosphere[data-mood="about"] .blob-2 { background: radial-gradient(circle, #1c9b95, transparent 70%); }

.atmosphere[data-mood="services"] .blob-1 { background: radial-gradient(circle, #2fc7c0, transparent 70%); }
.atmosphere[data-mood="services"] .blob-2 { background: radial-gradient(circle, #2a2f6b, transparent 70%); }

.atmosphere[data-mood="services-erp"] .blob-1 { background: radial-gradient(circle, #2f7ec7, transparent 70%); }
.atmosphere[data-mood="services-erp"] .blob-2 { background: radial-gradient(circle, #14324a, transparent 70%); }

.atmosphere[data-mood="services-ai"] .blob-1 { background: radial-gradient(circle, #7a5fd9, transparent 70%); }
.atmosphere[data-mood="services-ai"] .blob-2 { background: radial-gradient(circle, #1c9b95, transparent 70%); }

.atmosphere[data-mood="services-app"] .blob-1 { background: radial-gradient(circle, #2fc7c0, transparent 70%); }
.atmosphere[data-mood="services-app"] .blob-2 { background: radial-gradient(circle, #2a6b6b, transparent 70%); }

.atmosphere[data-mood="services-web"] .blob-1 { background: radial-gradient(circle, #3f9ad9, transparent 70%); }
.atmosphere[data-mood="services-web"] .blob-2 { background: radial-gradient(circle, #123a55, transparent 70%); }

.atmosphere[data-mood="services-ecom"] .blob-1 { background: radial-gradient(circle, #d9772e, transparent 70%); }
.atmosphere[data-mood="services-ecom"] .blob-2 { background: radial-gradient(circle, #1c9b95, transparent 70%); }

.atmosphere[data-mood="contact"] .blob-1 { background: radial-gradient(circle, #d9a441, transparent 70%); }
.atmosphere[data-mood="contact"] .blob-2 { background: radial-gradient(circle, #2fc7c0, transparent 70%); }

.grain-overlay {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.vignette {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 38%, rgba(2,4,4,0.75) 100%);
}

/* ---------- Preloader ---------- */
#preloader {
  position: fixed; inset: 0; background: var(--void); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .5s ease, visibility .5s ease;
}
#preloader.hidden { opacity: 0; visibility: hidden; }
.loader-logo { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: pulse 1.6s ease-in-out infinite; }
.loader-name { font-family: var(--font-display); font-size: 32px; font-weight: 800; color: var(--on-dark); }
.loader-name-ar { font-size: 20px; font-weight: 600; color: var(--brand); }
@keyframes pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

/* ---------- Header ---------- */
#site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  backdrop-filter: blur(10px); background: rgba(5,9,10,0.35);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav-wrap { max-width: 1180px; margin: 0 auto; padding: 18px 28px; display: flex; align-items: center; justify-content: space-between; }

.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 38px; height: 38px; border: 1px solid var(--brand-line); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 13px; color: var(--brand); font-weight: 600;
}
.logo-wordmark { display: flex; flex-direction: column; line-height: 1.05; }
.logo-text { font-family: var(--font-display); font-size: 23px; font-weight: 800; color: var(--on-dark); }
.logo-text-ar { font-size: 14px; font-weight: 600; color: var(--brand); }

.nav-links { display: flex; gap: 30px; }
.nav-links a { font-size: 14.5px; color: var(--on-dark-dim); font-weight: 500; transition: color .2s ease; display: flex; align-items: baseline; gap: 6px; }
.nav-links a:hover { color: var(--on-dark); }
.nav-links a.active { color: var(--on-dark); }
.nav-links a.active .nav-idx { color: var(--brand); }
.nav-idx { font-family: var(--font-mono); font-size: 10.5px; color: rgba(47,199,192,0.5); transition: color .2s ease; }

.nav-actions { display: flex; align-items: center; gap: 18px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: var(--radius); font-weight: 600; font-size: 14.5px;
  transition: transform .35s var(--ease-premium), box-shadow .3s ease; will-change: transform;
  white-space: nowrap; border: none; cursor: pointer;
}
.btn-primary {
  background: var(--brand); color: #04211f;
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 4px 0 rgba(4,33,31,0.28), 0 16px 34px rgba(47,199,192,0.35);
}
.btn-primary:active { box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 1px 0 rgba(4,33,31,0.28), 0 6px 16px rgba(47,199,192,0.3); }
.btn-ghost {
  border: 1px solid rgba(255,255,255,0.25); color: var(--on-dark); background: rgba(255,255,255,0.04);
}
.btn-ghost:hover { border-color: var(--brand-line); background: rgba(47,199,192,0.08); }
.btn-whatsapp {
  background: var(--whatsapp); color: #06210f; padding: 10px 20px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 4px 0 rgba(6,33,15,0.25), 0 10px 22px rgba(37,211,102,0.3);
}
.btn.small { padding: 11px 22px; font-size: 13.5px; }

#hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
#hamburger span { width: 22px; height: 1.5px; background: var(--on-dark); }

/* ---------- The slide: full-bleed, boxless, giant type ---------- */
.slide-wrap {
  position: fixed; inset: 0; z-index: 3; perspective: 1600px;
  display: flex; align-items: center; justify-content: center;
  padding: 120px 32px 90px;
}
.slide {
  max-width: 780px; width: 100%; text-align: center;
  transform-style: preserve-3d;
  opacity: 0; transform: rotateX(-14deg) translateY(30px) translateZ(-80px);
  transition: opacity .6s var(--ease-premium), transform .6s var(--ease-premium);
}
.slide.visible { opacity: 1; transform: rotateX(0) translateY(0) translateZ(0); }

.slide-eyebrow {
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 3px; color: var(--brand);
  margin-bottom: 20px; text-transform: uppercase;
}
.slide-title {
  font-size: clamp(2.6rem, 7vw, 5.2rem); font-weight: 800; line-height: 1.02;
  letter-spacing: -1px; margin-bottom: 26px;
  text-shadow: 0 2px 24px rgba(0,0,0,0.55), 0 4px 60px rgba(47,199,192,0.3);
}
.slide-text {
  font-size: 16.5px; line-height: 1.75; color: var(--on-dark-dim);
  max-width: 560px; margin: 0 auto 30px;
}
.slide-text strong { color: var(--on-dark); font-weight: 600; }
.slide-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

.chip-list { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }
.chip-list span {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--on-dark-dim);
  border: 1px solid rgba(255,255,255,0.18); padding: 5px 12px; border-radius: 999px;
}

/* ---------- About pillars — plain, no boxes ---------- */
.about-pillars { display: flex; justify-content: center; gap: 36px; margin-top: 40px; flex-wrap: wrap; }
.pillar { max-width: 190px; }
.pillar-tag {
  display: inline-block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 1px;
  color: var(--brand); margin-bottom: 10px;
}
.pillar h3 { font-family: var(--font-body); font-size: 15px; font-weight: 600; margin-bottom: 6px; color: var(--on-dark); }
.pillar p { color: var(--on-dark-faint); font-size: 13px; line-height: 1.55; }

/* ---------- Services menu — click a name to open its 3D frame ---------- */
.service-list { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 36px; }
.service-item {
  display: flex; align-items: baseline; gap: 14px;
  font-family: var(--font-display); font-size: clamp(1.2rem, 3vw, 1.7rem); font-weight: 700;
  color: var(--on-dark-dim); background: none; border: none; cursor: pointer; padding: 10px 18px;
  transition: color .25s ease, transform .25s var(--ease-premium);
}
.service-item:hover, .service-item:focus-visible { color: var(--on-dark); transform: translateX(6px); }
.service-item .item-index { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--brand); }

/* ---------- The 3D frame — a real bordered box that opens with depth ---------- */
.frame-overlay {
  position: fixed; inset: 0; z-index: 500; perspective: 1400px;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s ease;
}
.frame-overlay.open { opacity: 1; visibility: visible; }
.frame-backdrop { position: absolute; inset: 0; background: rgba(2,4,4,0.32); backdrop-filter: blur(3px); }
.frame-box {
  position: relative; z-index: 1; max-width: 560px; width: 100%; max-height: 82vh; overflow-y: auto;
  background: rgba(6,12,12,0.4); backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255,255,255,0.18); padding: 46px 42px 40px;
  color: var(--on-dark);
  transform: rotateY(-90deg) translateZ(-60px); opacity: 0;
  transition: transform .5s var(--ease-premium), opacity .4s ease, box-shadow .4s ease;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.15) inset,
    0 40px 100px rgba(0,0,0,0.6),
    0 0 70px var(--frame-glow, rgba(47,199,192,0.2));
}
.frame-title, .frame-index, .frame-desc, .frame-box .chip-list span {
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}
.frame-overlay.open .frame-box { transform: rotateY(0) translateZ(0); opacity: 1; }
.frame-corner { position: absolute; width: 18px; height: 18px; border: 2px solid var(--brand); z-index: 2; }
.frame-corner.tl { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.frame-corner.tr { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.frame-corner.bl { bottom: -1px; left: -1px; border-right: none; border-top: none; }
.frame-corner.br { bottom: -1px; right: -1px; border-left: none; border-top: none; }
.frame-close {
  position: absolute; top: 16px; right: 16px; width: 32px; height: 32px;
  border: 1px solid rgba(255,255,255,0.2); background: transparent; color: var(--on-dark);
  cursor: pointer; font-size: 14px; transition: border-color .2s ease, color .2s ease;
}
.frame-close:hover { border-color: var(--brand); color: var(--brand); }
.frame-index { display: block; font-family: var(--font-mono); font-size: 12px; color: var(--brand); letter-spacing: 1px; margin-bottom: 16px; }
.frame-title { font-size: clamp(1.5rem, 4vw, 2.1rem); margin-bottom: 18px; }
.frame-desc { color: var(--on-dark-dim); font-size: 15.5px; line-height: 1.75; margin-bottom: 22px; }
.frame-desc strong { color: var(--on-dark); font-weight: 600; }
.frame-box .chip-list { justify-content: flex-start; }

/* ---------- Contact links — minimal, no cards ---------- */
.contact-links { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-top: 10px; }
.contact-link {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 17px; font-weight: 600; color: var(--on-dark);
  padding-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,0.2);
  transition: border-color .2s ease, color .2s ease;
}
.contact-link:hover { border-color: var(--brand); color: var(--brand); }
.contact-link svg { color: var(--brand); }
.contact-link.highlight svg { color: var(--whatsapp); }

/* ---------- Footer ---------- */
.mini-footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 20px; text-align: center;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--on-dark-dim);
  background: rgba(5,9,10,0.4); backdrop-filter: blur(8px); border-top: 1px solid rgba(255,255,255,0.06);
}
.footer-name { color: var(--on-dark); font-weight: 600; }
.footer-name-ar { color: var(--brand); }
.footer-sep { opacity: 0.4; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav-links {
    position: fixed; top: 66px; left: 0; right: 0; bottom: 0;
    background: var(--void); flex-direction: column; align-items: center; justify-content: center;
    gap: 36px; font-size: 20px;
    transform: translateX(100%); transition: transform .3s ease; z-index: 90;
  }
  .nav-links.open { transform: translateX(0); }
  #hamburger { display: flex; }
  .nav-actions .btn-whatsapp span { display: none; }
  .nav-actions .btn-whatsapp { padding: 11px; }
  .slide-wrap { padding: 100px 20px 76px; }
  .about-pillars { gap: 24px; }
  .mini-footer { font-size: 10.5px; padding: 10px 14px; }
}
