/* ============================================
   Lebanese Rap — Coming Soon
   Dark cinematic: film grain, scanlines, CRT,
   signal glitch, letter scramble, space dust
   ============================================ */

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

:root {
  --bg: #0a0a0a;
  --fg: #f0f0f0;
  --font-display: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --font-body: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  position: relative;
}

::selection {
  background: rgba(255, 255, 255, 0.15);
}

/* --- Background Layer --- */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.space-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* --- Film Grain (canvas overlay) --- */
.grain-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 8;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: screen;
}

/* --- CRT Scanlines Overlay --- */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
  opacity: 0.4;
  animation: scanline-drift 8s linear infinite;
}

@keyframes scanline-drift {
  0% { background-position: 0 0; }
  100% { background-position: 0 4px; }
}

/* --- CRT Flicker --- */
.crt-flicker {
  position: fixed;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  background: transparent;
  animation: crt-flicker 0.1s infinite;
  opacity: 0;
}

@keyframes crt-flicker {
  0%, 95% { opacity: 0; }
  96% { opacity: 0.02; background: rgba(255, 255, 255, 0.02); }
  97% { opacity: 0; }
  98% { opacity: 0.015; background: rgba(255, 255, 255, 0.015); }
  100% { opacity: 0; }
}

/* --- Vignette --- */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 50%,
    rgba(0, 0, 0, 0.5) 100%
  );
}

/* --- Center Content --- */
.center {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  font-family: var(--font-display);
  font-size: clamp(70px, 13vw, 180px);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  color: inherit;
  position: relative;
}

.title-line {
  display: flex;
  align-items: center;
  justify-content: center;
}

.letter {
  display: inline-block;
  filter: blur(8px);
  opacity: 0;
  transition: filter 0.6s ease-out, opacity 0.5s ease;
  will-change: filter, transform;
  position: relative;
}

body.is-loaded .letter {
  opacity: 1;
}

/* Glitch: chromatic aberration */
.letter.is-glitching {
  animation: glitch-jitter 0.12s steps(2) infinite;
}

@keyframes glitch-jitter {
  0% {
    transform: translate(0, 0);
    text-shadow: -2px 0 rgba(255, 0, 50, 0.5), 2px 0 rgba(0, 200, 255, 0.5);
  }
  25% {
    transform: translate(2px, -1px);
    text-shadow: 2px 0 rgba(255, 0, 50, 0.4), -1px 0 rgba(0, 200, 255, 0.4);
  }
  50% {
    transform: translate(-2px, 1px);
    text-shadow: -1px 0 rgba(255, 0, 50, 0.6), 3px 0 rgba(0, 200, 255, 0.6);
  }
  75% {
    transform: translate(1px, 0);
    text-shadow: 1px 0 rgba(255, 0, 50, 0.3), -2px 0 rgba(0, 200, 255, 0.3);
  }
  100% {
    transform: translate(0, 0);
    text-shadow: none;
  }
}

/* Signal interference: whole title-line shifts */
.title-line.is-tearing {
  animation: signal-tear 0.15s steps(3) forwards;
}

@keyframes signal-tear {
  0% { transform: translateX(0) skewX(0deg); }
  20% { transform: translateX(-8px) skewX(-2deg); }
  40% { transform: translateX(5px) skewX(1deg); }
  60% { transform: translateX(-3px) skewX(-0.5deg); }
  80% { transform: translateX(2px) skewX(0.3deg); }
  100% { transform: translateX(0) skewX(0deg); }
}

.letter.is-scrambling {
  opacity: 1 !important;
  filter: blur(0px) !important;
}

/* --- Film burn / light leak --- */
.light-leak {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.light-leak.is-active {
  opacity: 1;
  animation: leak-flash 0.6s ease-out forwards;
}

@keyframes leak-flash {
  0% { opacity: 0.08; }
  30% { opacity: 0.12; }
  100% { opacity: 0; }
}

/* --- Footer --- */
.footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.8s ease 0.8s;
  color: inherit;
}

body.is-loaded .footer {
  opacity: 1;
}

.socials {
  display: flex;
  align-items: center;
  gap: 16px;
}

.social-link {
  color: inherit;
  opacity: 0.35;
  transition: opacity 0.25s ease, transform 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-link:hover {
  opacity: 0.75;
  transform: translateY(-1px);
}

.barcode-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: inherit;
}

.barcode {
  width: 160px;
  height: 25px;
  opacity: 0.25;
}

.barcode-text {
  font-family: var(--font-body);
  font-size: 7px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.35;
  color: inherit;
  padding-bottom: 6px;
}

/* --- Mobile --- */
@media (max-width: 768px) {
  .title {
    font-size: clamp(52px, 16vw, 110px);
  }

  /* Lighter blur on mobile (no mouse to hover) */
  .letter {
    filter: blur(3px);
  }

  /* Lighter grain on mobile */
  .grain-canvas {
    opacity: 0.03;
  }
}
