/* =========================================================
   Al Mansoora Games — Coming Soon
   ========================================================= */

:root {
  --blue: #2f7fe0;
  --blue-light: #6ec3f4;
  --green: #36c25a;
  --fire: #ff8a3d;
  --bg: #05070d;
  --text: #e9f1ff;
  --muted: rgba(233, 241, 255, 0.62);
  --glass: rgba(10, 18, 34, 0.45);
  --line: rgba(110, 195, 244, 0.25);
  --font-display: "Orbitron", sans-serif;
  --font-body: "Rajdhani", sans-serif;
}

* {
  font-family: var(--font-body);
}

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

body {
  cursor: crosshair;
}

/* ---------- Boot loader ---------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.boot.done {
  opacity: 0;
  visibility: hidden;
}

.boot-inner {
  width: min(260px, 70vw);
  text-align: center;
}

.boot-text {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.4em;
  color: var(--blue-light);
}

.dots::after {
  content: "";
  animation: dots 1s steps(4) infinite;
}

.boot-bar {
  margin-top: 14px;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.boot-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--blue), var(--green));
  box-shadow: 0 0 12px var(--blue);
  animation: boot 1.2s ease forwards;
}

/* ---------- Background ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  filter: saturate(1.15) contrast(1.05);
  animation: drift 24s ease-in-out infinite alternate;
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background:radial-gradient(ellipse at 50% 55%, rgba(5, 7, 13, 0.35) 0%, rgb(5 7 13 / 3%) 70%), linear-gradient(180deg, rgba(5, 7, 13, 0.75) 0%, rgba(5, 7, 13, 0.45) 40%, rgba(5, 7, 13, 0.9) 100%), linear-gradient(120deg, rgba(47, 127, 224, 0.25), transparent 50%, rgba(54, 194, 90, 0.18));
}

.bg-grid {
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: -10%;
  height: 55%;
  background-image:
    linear-gradient(rgba(110, 195, 244, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 195, 244, 0.22) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: perspective(500px) rotateX(62deg);
  transform-origin: center top;
  mask-image: linear-gradient(180deg, transparent 0%, #000 60%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 60%);
  animation: grid 3s linear infinite;
  opacity: 0.55;
}

.bg-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.bg-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}

.bg-vignette {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 200px 40px rgba(0, 0, 0, 0.9);
}

/* ---------- HUD frame ---------- */
.hud {
  position: fixed;
  inset: clamp(10px, 2vw, 22px);
  z-index: 2;
  pointer-events: none;
}

.hud-corner {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 2px solid var(--blue-light);
  opacity: 0.7;
  filter: drop-shadow(0 0 6px var(--blue));
  animation: corner 3s ease-in-out infinite;
}

.hud-corner.tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.hud-corner.tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.hud-corner.bl { bottom: 0; left: 0; border-right: 0; border-top: 0; border-color: var(--green); }
.hud-corner.br { bottom: 0; right: 0; border-left: 0; border-top: 0; border-color: var(--green); }

.hud-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(180deg, transparent, rgba(110, 195, 244, 0.06), transparent);
  animation: scan 6s linear infinite;
}

/* ---------- Layout ---------- */
.stage {
  position: relative;
  z-index: 3;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: clamp(18px, 4vh, 44px) clamp(16px, 5vw, 64px);
}

.topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  width: clamp(170px, 22vw, 290px);
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(8px);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.status b {
  color: var(--fire);
  font-family: inherit;
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fire);
  box-shadow: 0 0 10px var(--fire);
  animation: pulse 1.4s ease-in-out infinite;
}

/* ---------- Hero ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(10px, 2.2vh, 22px);
  width: 100%;
  max-width: 760px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-display);
  font-size: clamp(10px, 1.1vw, 13px);
  letter-spacing: 0.45em;
  color: var(--blue-light);
  line-height: 1;
}

.eyebrow-line {
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue-light));
}

.eyebrow-line:last-child {
  transform: scaleX(-1);
}

.title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(38px, min(9.5vw, 12vh), 128px);
  line-height: 0.95;
  letter-spacing: 0.04em;
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.3em;
}

.glitch {
  position: relative;
  display: inline-block;
  font-family: inherit;
  text-shadow: 0 0 30px rgba(110, 195, 244, 0.35);
}

.glitch.accent {
  background: linear-gradient(90deg, var(--blue-light), var(--blue) 45%, var(--green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 22px rgba(47, 127, 224, 0.55));
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  font-family: inherit;
  opacity: 0.8;
  pointer-events: none;
}

.glitch::before {
  color: #ff2f6d;
  -webkit-text-fill-color: #ff2f6d;
  animation: glitch-a 3.2s infinite steps(1);
  clip-path: inset(0 0 100% 0);
}

.glitch::after {
  color: #00f0ff;
  -webkit-text-fill-color: #00f0ff;
  animation: glitch-b 3.2s infinite steps(1);
  clip-path: inset(100% 0 0 0);
}

.tagline {
  font-size: clamp(15px, 1.6vw, 20px);
  line-height: 1.4;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.typed {
  color: var(--text);
  font-weight: 700;
  font-family: inherit;
}

.caret {
  color: var(--green);
  font-weight: 700;
  animation: blink 0.9s steps(1) infinite;
}

/* ---------- Footer ---------- */
.footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.press-start {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--muted);
  line-height: 1;
  animation: blink 1.4s steps(1) infinite;
}

.socials {
  display: flex;
  gap: 10px;
}

.socials a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(8px);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  transition: color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.socials a svg {
  width: 17px;
  height: 17px;
}

.socials a:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--green));
  transform: translateY(-3px);
}

.sound {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(8px);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.2em;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.sound span {
  font-family: inherit;
}

.sound:hover,
.sound.on {
  color: var(--text);
  border-color: var(--blue-light);
}

.eq {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.eq i {
  width: 2px;
  height: 3px;
  background: var(--blue-light);
}

.sound.on .eq i {
  animation: eq 0.9s ease-in-out infinite alternate;
}

.sound.on .eq i:nth-child(2) { animation-delay: 0.2s; }
.sound.on .eq i:nth-child(3) { animation-delay: 0.4s; }
.sound.on .eq i:nth-child(4) { animation-delay: 0.1s; }

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  filter: blur(6px);
}

body.ready .reveal {
  animation: reveal 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--d, 0s);
}

/* ---------- Keyframes ---------- */
@keyframes reveal {
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes boot {
  to { width: 100%; }
}

@keyframes dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

@keyframes drift {
  from { transform: scale(1.08) translate(0, 0); }
  to { transform: scale(1.14) translate(-1.5%, -1%); }
}

@keyframes grid {
  from { background-position: 0 0; }
  to { background-position: 0 60px; }
}

@keyframes corner {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@keyframes scan {
  from { top: -120px; }
  to { top: 100%; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.6); opacity: 0.5; }
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes eq {
  from { height: 3px; }
  to { height: 12px; }
}

@keyframes glitch-a {
  0%, 88%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  89% { clip-path: inset(10% 0 60% 0); transform: translate(-6px, -2px); }
  91% { clip-path: inset(50% 0 20% 0); transform: translate(5px, 1px); }
  93% { clip-path: inset(70% 0 5% 0); transform: translate(-3px, 2px); }
  95% { clip-path: inset(0 0 100% 0); transform: none; }
}

@keyframes glitch-b {
  0%, 89%, 100% { clip-path: inset(100% 0 0 0); transform: none; }
  90% { clip-path: inset(30% 0 40% 0); transform: translate(6px, 2px); }
  92% { clip-path: inset(5% 0 75% 0); transform: translate(-5px, -1px); }
  94% { clip-path: inset(60% 0 10% 0); transform: translate(4px, 0); }
  96% { clip-path: inset(100% 0 0 0); transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .status { display: none; }
  .topbar { justify-content: center; }
  .footer { justify-content: center; }
  .press-start, .sound { display: none; }
  .hud-corner { width: 22px; height: 22px; }
}

@media (max-width: 480px) {
  .eyebrow-line { width: 20px; }
  .eyebrow { letter-spacing: 0.3em; }
}

/* Short screens: drop secondary elements so nothing overflows */
@media (max-height: 520px) {
  .eyebrow { display: none; }
}

@media (max-height: 440px) {
  .tagline { display: none; }
}

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