:root {
  --primary-color: #8052ff;
  --secondary-color: #000;
  --helper-color: #fff;
  --max-width: 1440px;
}

/* base */
html {
  color-scheme: dark;
  box-sizing: border-box;
  background-color: var(--secondary-color);
  scroll-behavior: smooth;
  scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 4rem);
  overflow-x: clip;
  font-family: "Cairo", "Tajawal", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--secondary-color);
  color: var(--helper-color);
  font-size: clamp(0.95rem, 0.9rem + 0.25vw, 1.125rem);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--helper-color);
  outline-offset: 4px;
  border-radius: 0.4em;
}

h1,
h2,
h3,
p,
ul,
figure,
hr {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

p {
  font-size: clamp(0.95rem, 0.9rem + 0.25vw, 1.125rem);
  font-weight: 300;
  line-height: 1.6;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* main */
main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5em;
}

/* section master and inner containers */
[class*="efgmaster"] {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  background-color: transparent;
}

[class*="efginner"] {
  width: calc(100% - 2em);
  max-width: var(--max-width);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2em;
  text-align: center;
  background-color: transparent;
}

/* section head */
[class*="efghead"] {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 3vw, 2.5rem);
  text-align: start;
}

[class*="efgcaption"] {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6em;
}

[class*="efgslot"] {
  flex: 0 0 auto;
  width: clamp(4.5rem, 18vw, 10rem);
  aspect-ratio: 1 / 1;
}

[class*="efglabel"] {
  display: block;
  font-size: clamp(0.75rem, 0.72rem + 0.15vw, 0.875rem);
  font-weight: 600;
  line-height: 1.2;
  color: color-mix(in srgb, var(--primary-color) 70%, var(--helper-color));
}

[class*="efgtitle"] {
  max-width: 20em;
  font-size: clamp(1.75rem, 1.2rem + 2.6vw, 3.5rem);
  font-weight: 400;
  line-height: 1.1;
}

[class*="efgdisplay"] {
  font-size: clamp(2.25rem, 1.5rem + 3.6vw, 4.5rem);
  font-weight: 400;
  line-height: 1.05;
}

/* shared icon tile */
[class*="efgicon"] {
  display: grid;
  place-items: center;
  width: clamp(3rem, 2.6rem + 1vw, 3.75rem);
  aspect-ratio: 1 / 1;
  border: 1px solid color-mix(in srgb, var(--primary-color) 45%, transparent);
  border-radius: 1.1em;
  color: var(--primary-color);
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.6rem);
  transition: border-color 0.3s;
}

/* shared carousel arrows */
[class*="efgnav"] {
  display: none;
  place-items: center;
  flex: 0 0 auto;
  width: 2.75em;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--helper-color) 20%, transparent);
  background-color: transparent;
  color: var(--helper-color);
  font-size: clamp(0.85rem, 0.8rem + 0.2vw, 1rem);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

[class*="efgnav"]:hover {
  border-color: var(--primary-color);
  background-color: color-mix(in srgb, var(--primary-color) 18%, transparent);
}

[dir="rtl"] [class*="efgnav"] i {
  transform: scaleX(-1);
}

/* shared sticky filter bar */
[class*="efgbarwrap"] {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 4rem + 0.75rem);
  z-index: 5;
  width: 100%;
  max-width: 60em;
}

[class*="efgbarbox"] {
  display: flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.4em;
  border-radius: 9999px;
  background-color: color-mix(in srgb, var(--secondary-color) 78%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid color-mix(in srgb, var(--helper-color) 10%, transparent);
  transition: border-color 0.3s;
}

[class*="efgbarbox"][class*="efgstuck"] {
  border-color: color-mix(in srgb, var(--primary-color) 50%, transparent);
}

[class*="efgscroll"] {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  gap: 0.25em;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  border-radius: 9999px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
}

[class*="efgscroll"]::-webkit-scrollbar {
  display: none;
}

[class*="efgscroll"][class*="efgdrag"],
[class*="efgscroll"][class*="efgdrag"] [class*="efgtab"] {
  cursor: grabbing;
}

[class*="efgind"] {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  border-radius: 9999px;
  background-color: color-mix(in srgb, var(--primary-color) 20%, transparent);
  border: 1px solid var(--primary-color);
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

[class*="efgtab"] {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  padding: 1em 1.3em;
  border: 0;
  border-radius: 9999px;
  background: none;
  color: color-mix(in srgb, var(--helper-color) 60%, transparent);
  font-size: clamp(0.75rem, 0.72rem + 0.15vw, 0.85rem);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.25s;
}

[class*="efgtab"]:first-of-type {
  margin-inline-start: 0.6em;
}

[class*="efgtab"]:last-of-type {
  margin-inline-end: 0.6em;
}

[class*="efgtab"]:hover,
[class*="efgtab"][aria-selected="true"] {
  color: var(--helper-color);
}

[class*="efgstepbtn"] {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.4em;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--helper-color) 14%, transparent);
  background: none;
  color: var(--helper-color);
  font-size: clamp(0.8rem, 0.78rem + 0.15vw, 0.95rem);
  cursor: pointer;
  transition: opacity 0.25s, border-color 0.2s, background-color 0.2s;
}

[class*="efgstepbtn"]:hover:not(:disabled) {
  border-color: var(--primary-color);
  background-color: color-mix(in srgb, var(--primary-color) 18%, transparent);
}

[class*="efgstepbtn"]:disabled {
  opacity: 0.22;
  cursor: default;
}

[dir="rtl"] [class*="efgstepbtn"] i {
  transform: scaleX(-1);
}

/* shared reveal on scroll */
.js [class*="efgrv"] {
  opacity: 0;
  transform: translateY(1.5em);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.js [class*="efgrvin"] {
  opacity: 1;
  transform: none;
}

@media (min-width: 768px) {
  [class*="efgnav"] {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js [class*="efgrv"] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

html:lang(en) {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* inner pages */
.abcpgefgmain {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5em;
  margin-block-start: 3em;
}
