/* =========================================================
   EMD premium layer — Why-EMD bento, side navigator, hero dive
   ========================================================= */

/* ---------- hero dive ---------- */
.hero .line { will-change: transform, opacity; }
.hero__lens-img { transition: filter .3s; }

/* ---------- WHY EMD bento ---------- */
.why { padding: clamp(40px, 6vw, 90px) 0 clamp(110px, 13vw, 190px); }
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(230px, 20vw, 290px); gap: clamp(12px, 1.4vw, 18px); }
.bx { position: relative; display: flex; flex-direction: column; border-radius: 26px; overflow: hidden; isolation: isolate;
  background: linear-gradient(160deg, rgba(26,36,100,.55), rgba(8,10,34,.85)); border: 1px solid rgba(160,175,255,.14);
  transition: transform .6s var(--ease), border-color .4s, box-shadow .6s var(--ease); }
.bx:hover, .bx:focus-visible { transform: translateY(-6px); border-color: rgba(25,181,240,.45); box-shadow: 0 30px 70px -30px rgba(25,181,240,.45); }
.bx::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .4s; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(25,181,240,.16), transparent 50%); }
.bx:hover::after { opacity: 1; }
.bx--0 { grid-column: span 2; grid-row: span 2; }
.bx--5, .bx--6 { grid-column: span 2; }
.bx__vis { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.bx__txt { padding: 0 clamp(18px, 1.8vw, 26px) clamp(18px, 1.8vw, 24px); }
.bx__txt h3 { margin: 0 0 6px; font-family: var(--f-display); font-size: clamp(19px, 1.6vw, 24px); letter-spacing: -.01em; }
.bx--0 .bx__txt h3 { font-size: clamp(26px, 2.6vw, 40px); }
.bx__txt p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.bx--0 .bx__txt p { font-size: 16px; max-width: 40ch; }

/* 360 rings */
.bx-360 { position: relative; width: min(78%, 360px); aspect-ratio: 1; }
.bx-360 .r { position: absolute; border-radius: 50%; border: 1px solid rgba(143,211,255,.3); }
.bx-360 .r1 { inset: 0; border-style: dashed; animation: bxSpin 40s linear infinite; }
.bx-360 .r2 { inset: 16%; border-color: rgba(25,181,240,.45); animation: bxSpin 26s linear infinite reverse; }
.bx-360 .r3 { inset: 32%; background: radial-gradient(circle, rgba(25,181,240,.25), transparent 70%); border-color: rgba(210,87,122,.5); }
.bx-360 .r2::before, .bx-360 .r1::before { content: ""; position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: #19b5f0; box-shadow: 0 0 16px #19b5f0; }
.bx-360 .r1::before { background: #d2577a; box-shadow: 0 0 16px #d2577a; }
.bx-360 b { position: absolute; inset: 0; display: grid; place-items: center; font-family: "Syne", sans-serif; font-weight: 800; font-size: clamp(34px, 4vw, 64px); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bx-360 .n { position: absolute; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(10,14,48,.85); border: 1px solid rgba(160,175,255,.25); white-space: nowrap; animation: bxFloat 4s ease-in-out infinite; }
.bx-360 .n1 { top: 4%; left: 8%; } .bx-360 .n2 { top: 10%; right: 0; animation-delay: -1s; } .bx-360 .n3 { bottom: 14%; left: -2%; animation-delay: -2s; }
.bx-360 .n4 { bottom: 4%; right: 10%; animation-delay: -3s; } .bx-360 .n5 { top: 46%; right: -8%; animation-delay: -1.6s; border-color: rgba(210,87,122,.5); }
@keyframes bxSpin { to { transform: rotate(360deg); } }
@keyframes bxFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* REC viewfinder */
.bx-rec { position: absolute; inset: 18px 18px 6px; border-radius: 14px; background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.05), transparent 70%), url("https://images.unsplash.com/photo-1516035069371-29a1b244cc32?w=700&q=60&auto=format&fit=crop") center/cover; }
.bx-rec::before { content: ""; position: absolute; inset: 0; border-radius: 14px; background: linear-gradient(rgba(5,6,26,.35), rgba(5,6,26,.55)); }
.bx-rec .c { position: absolute; width: 18px; height: 18px; border: 2px solid #fff; }
.bx-rec .tl { top: 10px; left: 10px; border-right: 0; border-bottom: 0; } .bx-rec .tr { top: 10px; right: 10px; border-left: 0; border-bottom: 0; }
.bx-rec .bl { bottom: 10px; left: 10px; border-right: 0; border-top: 0; } .bx-rec .br { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }
.bx-rec .dot { position: absolute; top: 16px; left: 36px; width: 10px; height: 10px; border-radius: 50%; background: #ff3b4f; box-shadow: 0 0 12px #ff3b4f; animation: bxBlink 1s steps(2) infinite; }
.bx-rec .lbl { position: absolute; top: 12px; left: 52px; font: 700 12px/1 "Syne", sans-serif; letter-spacing: .1em; }
.bx-rec .tc { position: absolute; top: 12px; right: 36px; font: 600 12px/1 ui-monospace, monospace; direction: ltr; }
.bx-rec .iso { position: absolute; bottom: 14px; left: 36px; font: 600 10.5px/1 ui-monospace, monospace; opacity: .8; direction: ltr; }
.bx-rec .focus { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px; border: 1.5px solid #5ff0ff; border-radius: 6px; animation: bxFocus 3s ease-in-out infinite; }
@keyframes bxBlink { 50% { opacity: .15; } }
@keyframes bxFocus { 0%,100% { transform: scale(1); } 45% { transform: scale(.8); border-color: #3ddc97; } 55% { transform: scale(.8); border-color: #3ddc97; } }

/* client logo cells */
.bx-logos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 86%; }
.lg-cell { display: grid; place-items: center; height: clamp(54px, 5vw, 72px); border-radius: 14px; background: #fff; transition: transform .35s var(--ease), opacity .35s; }
.lg-cell img { max-width: 76%; max-height: 70%; object-fit: contain; }
.lg-cell.is-swap { transform: rotateX(90deg); opacity: 0; }

/* Riyadh map */
.bx-map { width: 88%; height: auto; overflow: visible; }
.bx-map__shape { fill: rgba(25,181,240,.06); stroke: rgba(143,211,255,.45); stroke-width: 1; }
.bx-map__dots circle { fill: rgba(143,211,255,.55); }
.bx-map__pin { fill: #d2577a; }
.bx-map__ping { fill: none; stroke: #d2577a; stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: bxPing 2.4s ease-out infinite; }
.bx-map__ping--2 { animation-delay: 1.2s; }
.bx-map__label { fill: #fff; font: 700 11px "Alexandria", "Syne", sans-serif; }
@keyframes bxPing { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }

/* isometric event grid */
.bx-iso { width: 100%; height: 100%; display: grid; place-items: center; perspective: 700px; }
.bx-iso .plane { position: relative; width: 150px; height: 150px; transform: rotateX(58deg) rotateZ(45deg); transform-style: preserve-3d;
  background-image: linear-gradient(rgba(143,211,255,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(143,211,255,.35) 1px, transparent 1px); background-size: 25px 25px; border: 1px solid rgba(143,211,255,.5); }
.bx-iso .cube { position: absolute; width: 25px; height: 25px; transform-style: preserve-3d; animation: bxRise 3.2s var(--ease) infinite; }
.bx-iso .cube b { position: absolute; inset: 0; }
.bx-iso .cube b:nth-child(1) { background: linear-gradient(135deg, #19b5f0, #1475bc); transform: translateZ(var(--h, 30px)); }
.bx-iso .cube b:nth-child(2) { background: #0e4f8a; width: var(--h, 30px); transform-origin: 0 0; transform: rotateY(-90deg); height: 25px; }
.bx-iso .cube b:nth-child(3) { background: #0a3a66; height: var(--h, 30px); transform-origin: 0 0; transform: rotateX(90deg); width: 25px; }
.bx-iso .c0 { left: 0; top: 0; --h: 40px; } .bx-iso .c1 { left: 50px; top: 25px; --h: 24px; animation-delay: .3s; } .bx-iso .c2 { left: 100px; top: 0; --h: 54px; animation-delay: .6s; }
.bx-iso .c3 { left: 25px; top: 100px; --h: 30px; animation-delay: .9s; } .bx-iso .c4 { left: 75px; top: 75px; --h: 46px; animation-delay: 1.2s; }
.bx-iso .c5 { left: 125px; top: 125px; --h: 20px; animation-delay: 1.5s; }
.bx-iso .c5 b:nth-child(1) { background: linear-gradient(135deg, #f07a9a, #d2577a); } .bx-iso .c5 b:nth-child(2) { background: #8f3550; } .bx-iso .c5 b:nth-child(3) { background: #6d2840; }
@keyframes bxRise { 0%, 100% { transform: translateZ(0) scale(1); } 50% { transform: translateZ(10px) scale(1.04); } }

/* typing */
.bx-type { display: flex; align-items: center; gap: 4px; font-family: var(--f-display); font-weight: 800; font-size: clamp(44px, 5.5vw, 92px); letter-spacing: -.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bx-type span { min-height: 1.2em; }
.bx-type .caret { width: 4px; height: .9em; background: #19b5f0; animation: bxBlink 1s steps(2) infinite; }

/* chart */
.bx-chart { width: 84%; height: auto; overflow: visible; }
.bx-chart rect { fill: rgba(25,181,240,.35); transform-box: fill-box; transform-origin: 50% 100%; animation: bxBar 3.6s var(--ease) var(--d) infinite; }
.bx-chart rect:last-of-type { fill: #19b5f0; }
.bx-chart path { fill: none; stroke: #d2577a; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 400; animation: bxLine 3.6s var(--ease) infinite; }
.bx-chart circle { fill: #fff; stroke: #d2577a; stroke-width: 3; animation: bxBlink 1.2s steps(2) infinite; }
@keyframes bxBar { 0% { transform: scaleY(.1); } 35%, 85% { transform: scaleY(1); } 100% { transform: scaleY(.1); } }
@keyframes bxLine { 0% { stroke-dashoffset: 400; } 45%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -400; } }

@media (max-width: 1080px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 250px; }
  .bx--0 { grid-column: span 2; grid-row: span 1; height: 360px; }
  .bx--5, .bx--6 { grid-column: span 1; }
}
@media (max-width: 620px) {
  .bento { grid-template-columns: 1fr; grid-auto-rows: 260px; }
  .bx--0, .bx--5, .bx--6 { grid-column: span 1; }
  .bx--0 { height: auto; grid-row: span 1; min-height: 450px; }
  .bx-360 { width: 70%; }
}

/* ---------- side navigator ---------- */
.sidenav { position: fixed; z-index: 40; top: 50%; inset-inline-end: 18px; transform: translate(0, -50%); display: flex; flex-direction: column; gap: 4px; opacity: 0; pointer-events: none; transition: opacity .5s; }
.sidenav.is-shown { opacity: 1; pointer-events: auto; }
.sidenav a { display: flex; align-items: center; justify-content: flex-end; gap: 10px; height: 26px; text-decoration: none; }
.sidenav a i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.28); transition: transform .4s var(--ease), background-color .3s, box-shadow .3s; }
.sidenav a span { font-size: 12px; font-weight: 600; color: #fff; padding: 4px 10px; border-radius: 999px; background: rgba(10,14,48,.85); border: 1px solid rgba(160,175,255,.2); opacity: 0; transform: translateX(8px); transition: opacity .3s, transform .4s var(--ease); white-space: nowrap; }
html[dir="rtl"] .sidenav a span { transform: translateX(-8px); }
.sidenav a:hover span, .sidenav a:focus-visible span { opacity: 1; transform: none; }
.sidenav a:hover i { background: #fff; }
.sidenav a.is-on i { background: #19b5f0; transform: scale(1.6); box-shadow: 0 0 0 4px rgba(25,181,240,.2); }
@media (max-width: 1080px) { .sidenav { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .bx-360 .r, .bx-360 .n, .bx-rec .dot, .bx-rec .focus, .bx-map__ping, .bx-iso .cube, .bx-chart rect, .bx-chart path, .bx-type .caret { animation: none !important; }
}

/* ---------- dive message ---------- */
.hero__dive { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; pointer-events: none; opacity: 0; padding: 0 24px; }
.hero__dive svg { width: clamp(200px, 26vw, 400px); fill: #fff; filter: drop-shadow(0 20px 50px rgba(0,0,0,.5)); overflow: visible; }
.hero__dive svg .lg-acc { fill: #ffd2de; }
.hero__dive p { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: clamp(30px, 4.4vw, 72px); line-height: 1.1; letter-spacing: -.03em; text-shadow: 0 10px 40px rgba(0,0,0,.5); max-width: 18ch; }
html[lang="ar"] .hero__dive p { letter-spacing: 0; line-height: 1.4; }
.hero__dive span { font-size: 13px; letter-spacing: .25em; text-transform: uppercase; color: rgba(255,255,255,.75); }
html[lang="ar"] .hero__dive span { letter-spacing: 0; font-size: 15px; }
