:root {
  --bg: #0c0e10;
  --ink: #f2f4f3;
  --muted: #8b9390;
  --accent: #c6f23a;
  --accent-dim: rgba(198, 242, 58, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
}

body {
  font-family: Syne, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

html[data-lang="ar"] body,
html[data-lang="ar"] h1,
html[data-lang="ar"] .lede {
  font-family: "IBM Plex Sans Arabic", Syne, sans-serif;
}

html[data-lang="zh"] body,
html[data-lang="zh"] h1,
html[data-lang="zh"] .lede {
  font-family: "Noto Sans SC", Syne, sans-serif;
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: drift 14s ease-in-out infinite alternate;
}

.glow-a {
  width: min(70vw, 520px);
  height: min(70vw, 520px);
  top: -12%;
  left: -8%;
  background: radial-gradient(circle, var(--accent-dim), transparent 70%);
}

.glow-b {
  width: min(55vw, 420px);
  height: min(55vw, 420px);
  right: -10%;
  bottom: -8%;
  background: radial-gradient(circle, rgba(70, 120, 110, 0.35), transparent 70%);
  animation-delay: -4s;
}

.grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  opacity: 0.7;
}

.lang-bar {
  position: fixed;
  z-index: 2;
  top: max(16px, env(safe-area-inset-top));
  inset-inline-end: max(16px, env(safe-area-inset-right));
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(18, 22, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.lang-btn {
  appearance: none;
  border: 0;
  margin: 0;
  cursor: pointer;
  min-width: 44px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 0.78rem/1 Syne, "Noto Sans SC", "IBM Plex Sans Arabic", sans-serif;
  letter-spacing: 0.04em;
  transition: color 0.2s ease, background 0.2s ease;
}

.lang-btn:hover {
  color: var(--ink);
}

.lang-btn.is-active {
  background: var(--accent);
  color: #10140c;
}

.hero {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(28px, 6vw, 72px);
  max-width: 920px;
}

.brand {
  margin: 0 0 18px;
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: var(--accent);
  opacity: 0;
  transform: translateY(18px);
}

h1 {
  margin: 0 0 16px;
  font-weight: 700;
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  letter-spacing: -0.02em;
  opacity: 0;
  transform: translateY(18px);
}

.lede {
  margin: 0 0 28px;
  max-width: 34ch;
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  line-height: 1.65;
  color: var(--muted);
  opacity: 0;
  transform: translateY(18px);
}

html[data-lang="zh"] .lede {
  max-width: 22em;
  letter-spacing: 0.02em;
}

.meta {
  margin: 0;
  font-family: Syne, sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(242, 244, 243, 0.45);
  opacity: 0;
  transform: translateY(18px);
}

html.ready .brand,
html.ready h1,
html.ready .lede,
html.ready .meta {
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

html.ready h1 { animation-delay: 0.12s; }
html.ready .lede { animation-delay: 0.24s; }
html.ready .meta { animation-delay: 0.36s; }

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(24px, -18px) scale(1.08); }
}

@media (max-width: 640px) {
  .hero {
    align-items: stretch;
    padding-top: 72px;
  }

  .lang-bar {
    inset-inline: 16px auto auto 16px;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  html[dir="rtl"] .lang-bar {
    inset-inline: auto 16px 16px auto;
  }
}
