/* ==========================================================
   ALFAEQ Group — Under Renovation
   Identity: black & gold · Mobile-first · RTL/LTR-safe
   ========================================================== */

:root {
  /* Black */
  --black-950: #050505;
  --black-900: #0a0a0a;
  --black-800: #121212;
  --black-700: #1c1a17;

  /* Gold */
  --gold-100: #f8ecc2;
  --gold-200: #f0d98c;
  --gold-300: #e6c674;
  --gold-400: #d4af37;
  --gold-500: #b8922b;
  --gold-600: #8c6a1e;

  --text: #f3efe6;
  --text-muted: rgba(243, 239, 230, 0.72);
  --text-subtle: rgba(243, 239, 230, 0.5);
  --line: rgba(212, 175, 55, 0.28);

  --gold-gradient: linear-gradient(
    110deg,
    var(--gold-600) 0%,
    var(--gold-400) 22%,
    var(--gold-100) 42%,
    var(--gold-300) 55%,
    var(--gold-400) 70%,
    var(--gold-600) 100%
  );

  --font-ar: "El Messiri", "Noto Kufi Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-brand: "Cairo", "El Messiri", "Segoe UI", Tahoma, sans-serif;
  --font-en: "Jost", "Helvetica Neue", Arial, sans-serif;

  --gutter: 16px;
  --logo-size: clamp(132px, 38vw, 208px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto;
  background-color: var(--black-900);
  background-image:
    radial-gradient(120% 80% at 50% 0%, var(--black-700) 0%, transparent 60%),
    radial-gradient(90% 60% at 50% 110%, #15120c 0%, transparent 70%);
  color: var(--text);
  font-family: var(--font-ar);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* English runs use the Latin typeface */
[lang="en"] {
  font-family: var(--font-en);
}

/* ---------- Background layers ---------- */

.dust {
  position: fixed;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  pointer-events: none;
  z-index: 0;
}

.glow {
  position: fixed;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  inline-size: min(900px, 140vw);
  aspect-ratio: 1;
  translate: -50% -58%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.16) 0%, rgba(212, 175, 55, 0.05) 35%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

[dir="rtl"] .glow {
  translate: 50% -58%;
}

/* ---------- Layout ---------- */

.stage {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  padding-block: clamp(40px, 8vh, 96px) 24px;
  padding-inline: max(var(--gutter), env(safe-area-inset-left), env(safe-area-inset-right));
}

.hero {
  inline-size: 100%;
  max-inline-size: 40rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ---------- Logo ---------- */

.logo-frame {
  position: relative;
  inline-size: var(--logo-size);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin-block-end: clamp(24px, 5vw, 36px);
  animation: rise 1.1s var(--ease-out) both;
}

.logo-frame::before {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.22) 0%, transparent 70%);
  filter: blur(18px);
  animation: breathe 5s ease-in-out infinite;
}

.logo-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 1.5px;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    var(--gold-600) 40deg,
    var(--gold-100) 90deg,
    var(--gold-400) 130deg,
    transparent 200deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: spin 9s linear infinite;
}

.logo-ring::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
}

/* Wide logo: 82% of the circle still sits fully inside it */
.logo {
  position: relative;
  inline-size: 82%;
  block-size: 82%;
  object-fit: contain;
  filter: drop-shadow(0 6px 24px rgba(212, 175, 55, 0.28));
}

/* ---------- Brand name ---------- */

.brand {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15em;
  font-weight: inherit;
  animation: rise 1.1s 0.15s var(--ease-out) both;
}

.brand-ar,
.brand-en {
  background: var(--gold-gradient);
  background-size: 220% 100%;
  animation: shimmer 7s ease-in-out infinite;
}

.brand-ar {
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: clamp(1.9rem, 7.5vw, 3.1rem);
  line-height: 1.5;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold-400);
}

/* English name drawn with the logo's own letters (incl. its Q) */
.brand-en {
  position: relative;
  display: block;
  block-size: clamp(14px, 4vw, 20px);
  aspect-ratio: var(--wordmark-ratio);
  margin-block-start: 0.25rem;
  -webkit-mask: var(--mask-wordmark) center / contain no-repeat;
  mask: var(--mask-wordmark) center / contain no-repeat;
}

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Status pill ---------- */

.status {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: clamp(22px, 5vw, 32px) 0 clamp(16px, 4vw, 24px);
  padding: 6px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.06);
  color: var(--gold-200);
  font-size: 0.9rem;
  line-height: 1.5;
  animation: rise 1.1s 0.45s var(--ease-out) both;
}

.status [lang="en"] {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.status-sep {
  color: var(--gold-500);
}

.status-dot {
  position: relative;
  inline-size: 7px;
  block-size: 7px;
  border-radius: 50%;
  background: var(--gold-400);
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--gold-400);
  animation: ping 2s var(--ease-out) infinite;
}

/* ---------- Message ---------- */

.message {
  display: grid;
  gap: 10px;
  animation: rise 1.1s 0.6s var(--ease-out) both;
}

.message p {
  margin: 0;
  text-wrap: balance;
}

.message-ar {
  font-size: clamp(1.05rem, 4.2vw, 1.3rem);
  line-height: 1.9;
  color: var(--text);
}

.message-en {
  font-weight: 300;
  font-size: clamp(0.92rem, 3.6vw, 1.05rem);
  line-height: 1.7;
  color: var(--text-muted);
}

/* ---------- Progress line ---------- */

.progress {
  position: relative;
  inline-size: min(220px, 60%);
  block-size: 2px;
  margin-block-start: clamp(28px, 6vw, 40px);
  border-radius: 2px;
  background: rgba(212, 175, 55, 0.14);
  overflow: hidden;
  animation: rise 1.1s 0.75s var(--ease-out) both;
}

.progress span {
  position: absolute;
  inset-block: 0;
  inline-size: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--gold-300), transparent);
  animation: travel 2.4s ease-in-out infinite;
}

/* ---------- Footer ---------- */

.footer {
  position: relative;
  z-index: 1;
  padding-block: 20px max(20px, env(safe-area-inset-bottom));
  padding-inline: var(--gutter);
  text-align: center;
  color: var(--text-subtle);
  font-size: 0.82rem;
  border-block-start: 1px solid rgba(212, 175, 55, 0.1);
}

.footer p {
  margin: 0;
}

.footer bdi {
  color: var(--gold-300);
  letter-spacing: 0.06em;
}

/* ---------- Larger screens ---------- */

@media (min-width: 48rem) {
  :root {
    --gutter: 32px;
  }

  .message {
    gap: 12px;
  }
}

@media (min-width: 64rem) {
  .hero {
    max-inline-size: 46rem;
  }
}

/* Short landscape phones: keep everything in view */
@media (max-height: 520px) and (orientation: landscape) {
  :root {
    --logo-size: clamp(96px, 22vh, 140px);
  }

  .stage {
    padding-block: 24px 12px;
  }

  .progress {
    margin-block-start: 18px;
  }
}

/* ---------- Animations ---------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes spin {
  to {
    rotate: 360deg;
  }
}

@keyframes breathe {
  0%, 100% { opacity: 0.65; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.04); }
}

@keyframes shimmer {
  0%, 100% { background-position: 100% 50%; }
  50% { background-position: 0% 50%; }
}

@keyframes ping {
  0% { transform: scale(1); opacity: 0.7; }
  80%, 100% { transform: scale(2.8); opacity: 0; }
}

@keyframes travel {
  0% { inset-inline-start: -40%; }
  100% { inset-inline-start: 100%; }
}

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

  .progress span {
    inset-inline-start: 30%;
  }
}
