/* ---- Fonts --------------------------------------------------------------- */

@font-face {
  font-family: "Dubai";
  src: url("../assets/fonts/DubaiLight.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Dubai";
  src: url("../assets/fonts/DubaiBold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Bukra";
  src: url("../assets/fonts/29ltbukraregular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* ---- Tokens -------------------------------------------------------------- */

:root {
  --ink: #d9e0ed;
  --ink-soft: #b8c4e6;
  --dark: #050516;
  /* Brand green from the logo; swap for #0004eb to match the reference's electric blue. */
  --accent: #6cc24a;

  --font-sans: "Geist", system-ui, sans-serif;
  --font-display: "Geist", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;

  color-scheme: dark;
}

html[lang="ar"] {
  --font-sans: "Dubai", system-ui, sans-serif;
  --font-display: "Bukra", "Dubai", sans-serif;
  --font-mono: "Dubai", system-ui, sans-serif;
}

/* ---- Base ---------------------------------------------------------------- */

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

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: #000;
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

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

.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* CRT scanlines, vignette and a little static. */
.crt {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.75) 100%);
}

.crt::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

.page {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding-inline: 16px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 16px;
}

.logo {
  display: block;
  height: 36px;
  width: auto;
}

.main {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.hero {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-block: 40px;
  text-align: center;
}

.info-bar {
  display: grid;
  gap: 32px;
  padding-bottom: 24px;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 16px;
  border-top: 1px solid rgba(217, 224, 237, 0.1);
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(217, 224, 237, 0.4);
}

/* ---- Header controls ----------------------------------------------------- */

.social-nav {
  display: none;
  align-items: center;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink-soft);
}

.social-nav a,
.social-list a {
  transition: color 0.15s;
}

.social-nav a:hover,
.social-list a:hover {
  color: var(--accent);
}

.lang {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  padding-inline-start: 10px;
  border: 0;
  background: var(--ink);
  color: var(--dark);
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.lang:hover {
  background: #fff;
}

.lang:focus-visible,
.cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.lang-label[lang="ar"] {
  font-family: "Dubai", sans-serif;
  font-weight: 700;
}

.lang-label[lang="en"] {
  font-family: "Geist Mono", ui-monospace, monospace;
}

.lang-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  background: var(--dark);
  color: var(--ink);
  transition: background-color 0.15s, color 0.15s;
}

.lang:hover .lang-icon {
  background: var(--accent);
  color: var(--dark);
}

.lang-icon .pixel-arrow {
  width: 12px;
  height: 12px;
}

.pixel-arrow {
  display: block;
  width: 16px;
  height: 16px;
}

[dir="rtl"] .pixel-arrow {
  transform: scaleX(-1);
}

/* ---- Hero ---------------------------------------------------------------- */

.label {
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink-soft);
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  text-transform: uppercase;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.headline {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 10rem);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  color: #fff;
  mix-blend-mode: difference;
}

.headline .line {
  display: block;
}

.headline .light {
  font-weight: 300;
}

.headline .bold {
  font-weight: 600;
}

html[lang="ar"] .headline {
  font-size: clamp(2.5rem, 7vw, 7rem);
  line-height: 1.3;
  letter-spacing: 0;
}

/* ---- Info bar ------------------------------------------------------------ */

.countdown {
  display: flex;
  align-items: stretch;
  max-width: 384px;
  border: 1px solid rgba(217, 224, 237, 0.2);
  background: rgba(217, 224, 237, 0.03);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.countdown .cell {
  flex: 1;
  padding: 8px 12px;
}

.countdown .cell + .cell {
  border-inline-start: 1px solid rgba(217, 224, 237, 0.2);
}

.countdown .num {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.countdown .unit {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  color: rgba(217, 224, 237, 0.5);
}

.launched {
  font-family: var(--font-mono);
  font-size: 20px;
  text-transform: uppercase;
  color: var(--accent);
}

.about {
  max-width: 512px;
  font-size: 18px;
  line-height: 1.375;
  color: var(--ink);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tags li {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--dark);
  font-size: 14px;
  font-weight: 500;
}

.cta-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.social-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-family: var(--font-mono);
  font-size: 14px;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.cta {
  display: inline-flex;
  align-items: center;
  width: fit-content;
}

.cta-label {
  padding: 14px 20px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--dark);
  font-size: 16px;
  font-weight: 500;
  text-transform: uppercase;
  transition: background-color 0.15s;
}

.cta-arrow {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--dark);
  transition: background-color 0.15s, transform 0.15s;
}

.cta-arrow .pixel-arrow {
  width: 20px;
  height: 20px;
}

.cta:hover .cta-label,
.cta:hover .cta-arrow {
  background: #fff;
}

.cta:hover .cta-arrow {
  transform: translateX(4px);
}

[dir="rtl"] .cta:hover .cta-arrow {
  transform: translateX(-4px);
}

/* ---- Breakpoints --------------------------------------------------------- */

@media (min-width: 640px) {
  .page {
    padding-inline: 24px;
  }

  .header {
    padding-block: 20px;
  }

  .logo {
    height: 40px;
  }

  .countdown .cell {
    padding-inline: 16px;
  }

  .countdown .num {
    font-size: 30px;
  }

  .about {
    font-size: 20px;
  }
}

@media (min-width: 768px) {
  .social-nav {
    display: flex;
  }

  .social-list {
    display: none;
  }

  .info-bar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto;
    align-items: end;
    gap: 40px;
  }

  .cta-col {
    align-items: flex-end;
  }
}

@media (min-width: 1024px) {
  .page {
    padding-inline: 32px;
  }
}

/* ---- Motion -------------------------------------------------------------- */

.glitch-in {
  animation: glitch-in 0.9s steps(1, end) both;
}

@keyframes glitch-in {
  0% {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
  }
  15% {
    opacity: 1;
    clip-path: inset(0 60% 40% 0);
    transform: translateX(-6px);
  }
  30% {
    clip-path: inset(30% 20% 0 0);
    transform: translateX(4px);
  }
  45% {
    clip-path: inset(0 0 60% 0);
    transform: translateX(-2px);
  }
  60% {
    clip-path: inset(50% 0 0 0);
    transform: translateX(3px);
  }
  75%,
  100% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: none;
  }
}

@keyframes pulse {
  50% {
    opacity: 0.5;
  }
}

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