@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/cinzel-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

:root {
  --navy: #091a33;
  --navy-deep: #050f20;
  --gold: #d4a64a;
  --gold-light: #f3d58a;
  --ivory: #f5f1e8;
  --muted: #a9b4c7;
  --font-display: "Cinzel", "Times New Roman", serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-arabic: "IBM Plex Sans Arabic", system-ui, sans-serif;
}

html[lang="ar"] {
  --font-display: var(--font-arabic);
  --font-body: var(--font-arabic);
}

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

html, body { height: 100%; }

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at 50% 42%, #091a33 0%, #091a33 36%, #071428 74%, var(--navy-deep) 100%);
  color: var(--ivory);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

#circuit {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse 78% 62% at 50% 46%, rgba(9, 26, 51, 0.82) 0%, rgba(9, 26, 51, 0.35) 48%, transparent 74%);
}

.topbar, .stage, .footer { position: relative; z-index: 2; }

.topbar {
  display: flex;
  justify-content: flex-end;
  padding: clamp(16px, 3vw, 28px) clamp(16px, 4vw, 40px);
}

.lang-toggle {
  min-height: 44px;
  font: 500 0.95rem/1 var(--font-arabic), var(--font-body);
  color: var(--gold-light);
  background: rgba(9, 26, 51, 0.55);
  border: 1px solid rgba(212, 166, 74, 0.65);
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
  opacity: 0;
  animation: fade-in 0.8s ease 1.8s forwards;
}
.lang-toggle:hover,
.lang-toggle:focus-visible {
  background: var(--gold);
  color: var(--navy);
  outline: none;
}
html[lang="en"] [data-lang-label="ar"],
html[lang="ar"] [data-lang-label="en"] { display: none; }

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 clamp(20px, 5vw, 48px) 24px;
  gap: clamp(14px, 2.4vh, 24px);
}

.logo-wrap {
  position: relative;
  width: min(640px, 84vw);
  overflow: hidden;
  opacity: 0;
  -webkit-animation: logo-in 1.2s ease 0.15s forwards;
  animation: logo-in 1.2s ease 0.15s forwards;
}
.logo { display: block; width: 100%; height: auto; }

.shine {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  left: 0;
  width: 38%;
  background: linear-gradient(100deg, transparent, rgba(255, 236, 190, 0.7), transparent);
  -webkit-transform: translate3d(-160%, 0, 0);
  transform: translate3d(-160%, 0, 0);
  -webkit-animation: shine 5.5s ease-in-out 1.4s infinite;
  animation: shine 5.5s ease-in-out 1.4s infinite;
  pointer-events: none;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(360px, 72vw);
}
.divider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform: scaleX(0);
  animation: grow 0.9s ease 0.9s forwards;
}
.divider i {
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 12px solid var(--gold);
  opacity: 0;
  animation: fade-in 0.5s ease 1.2s forwards, pulse 2.8s ease-in-out 1.8s infinite;
}

.headline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 7vw, 4.4rem);
  letter-spacing: 0.06em;
  line-height: 1.15;
  color: var(--gold-light);
  opacity: 0;
  -webkit-animation: rise 0.9s ease 1s forwards;
  animation: rise 0.9s ease 1s forwards;
}
.gold {
  display: inline-block;
  color: var(--gold-light);
  background-image: linear-gradient(100deg, #b8862f 0%, #fff6d8 45%, #b8862f 70%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-animation: gold-flow 5s linear infinite;
  animation: gold-flow 5s linear infinite;
}
html[dir="rtl"] .headline {
  font-weight: 500;
  letter-spacing: 0;
  font-size: clamp(2.6rem, 12vw, 5.2rem);
}

.lead {
  max-width: 36rem;
  font-size: clamp(0.98rem, 2.4vw, 1.125rem);
  font-weight: 400;
  line-height: 1.75;
  color: var(--muted);
  opacity: 0;
  -webkit-animation: rise 0.9s ease 1.35s forwards;
  animation: rise 0.9s ease 1.35s forwards;
}

.progress {
  width: min(320px, 72vw);
  margin-top: 4px;
  opacity: 0;
  animation: fade-in 0.8s ease 1.6s forwards;
}
.bar {
  position: relative;
  height: 2px;
  border-radius: 2px;
  background: rgba(212, 166, 74, 0.2);
  overflow: hidden;
}
.bar span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 38%;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
  transform: translate3d(-120%, 0, 0);
  animation: scan 2.4s ease-in-out infinite;
}
.status {
  margin-top: 12px;
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}
html[lang="ar"] .status { letter-spacing: 0; font-size: 0.95rem; text-transform: none; }
.status::after {
  content: "...";
  display: inline-block;
  width: 1.4em;
  text-align: start;
  -webkit-animation: dots 1.4s step-end infinite;
  animation: dots 1.4s step-end infinite;
}

.footer {
  padding: 18px 16px 28px;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(169, 180, 199, 0.8);
  opacity: 0;
  animation: fade-in 0.8s ease 1.8s forwards;
}

.back {
  color: var(--gold-light);
  font-weight: 500;
}

body.switching .headline,
body.switching .lead,
body.switching .status {
  opacity: 0 !important;
}

@keyframes logo-in { to { opacity: 1; } }
@keyframes shine {
  0%, 42% { transform: translate3d(-160%, 0, 0); }
  78%, 100% { transform: translate3d(340%, 0, 0); }
}
@keyframes grow { to { transform: scaleX(1); } }
@keyframes fade-in { to { opacity: 1; } }
@keyframes rise { to { opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes gold-flow {
  from { background-position: 0% center; }
  to { background-position: 200% center; }
}
@keyframes scan {
  from { transform: translate3d(-120%, 0, 0); }
  to { transform: translate3d(280%, 0, 0); }
}
@keyframes dots {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

@media (max-width: 720px) {
  .vignette {
    background: radial-gradient(ellipse 92% 46% at 50% 42%, rgba(9, 26, 51, 0.72) 0%, rgba(9, 26, 51, 0.22) 52%, transparent 76%);
  }
  .headline { letter-spacing: 0.03em; }
}

@media (max-height: 560px) {
  .logo-wrap { width: min(420px, 62vw); }
  .stage { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
  }
  .shine, .bar span { display: none; }
}
