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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0800;
  -webkit-font-smoothing: antialiased;
  font-family: 'IBM Plex Mono', monospace;
}

/* ---- Split layout ---- */

.split-layout {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
}

/* ---- Left side: Hero ---- */

.hero-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  width: 100%;
}

/* CRT scanline overlay on left side */
.crt-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
}

/* Vignette on hero side */
.hero-side::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 50%,
    rgba(0, 0, 0, 0.5) 100%
  );
  z-index: 3;
}

.hero-title {
  font-family: 'Sixtyfour', monospace;
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 400;
  color: #ffc040;
  letter-spacing: 0.08em;
  text-shadow:
    0 0 3px rgba(255, 200, 80, 0.7),
    0 0 15px rgba(255, 140, 0, 0.6),
    0 0 40px rgba(255, 100, 0, 0.4),
    0 0 80px rgba(255, 80, 0, 0.2);
  line-height: 1;
  margin-bottom: 0.5em;
  animation: flicker 4s infinite;
}

.hero-title span {
  display: inline-block;
}

.hero-title .kern-o {
  margin-left: -0.08em;
}

.hero-title .kern-narrow {
  margin-left: -0.22em;
  margin-right: -0.18em;
}

.hero-tagline {
  color: #cc9966;
  font-size: clamp(0.85rem, 1.5vw, 1.1rem);
  opacity: 0.8;
  margin-bottom: 2.5em;
  text-shadow: 0 0 8px rgba(255, 129, 0, 0.3);
}

/* Download buttons */
.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.75em 1.8em;
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(0.8rem, 1.2vw, 1rem);
  color: #ff8100;
  border: 1px solid rgba(255, 129, 0, 0.4);
  border-radius: 6px;
  background: rgba(255, 129, 0, 0.06);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-shadow: 0 0 6px rgba(255, 129, 0, 0.3);
  min-width: 260px;
  justify-content: center;
}

.btn:hover {
  background: rgba(255, 129, 0, 0.15);
  border-color: rgba(255, 129, 0, 0.7);
  text-shadow:
    0 0 8px rgba(255, 129, 0, 0.5),
    0 0 20px rgba(255, 129, 0, 0.3);
  box-shadow: 0 0 20px rgba(255, 129, 0, 0.15);
}

.btn-icon {
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
}

@keyframes flicker {
  0%, 100% { opacity: 1; filter: brightness(1); }
  4% { opacity: 0.88; filter: brightness(0.9); }
  6% { opacity: 1; filter: brightness(1.05); }
  7% { opacity: 0.95; }
  8% { opacity: 1; }
  42% { opacity: 1; }
  43% { opacity: 0.85; filter: brightness(0.85); }
  44% { opacity: 0.9; }
  45% { opacity: 1; filter: brightness(1); }
  72% { opacity: 1; }
  73% { opacity: 0.92; filter: brightness(1.08); }
  74% { opacity: 0.97; }
  75% { opacity: 1; filter: brightness(1); }
  92% { opacity: 1; }
  93% { opacity: 0.82; filter: brightness(0.88); }
  93.5% { opacity: 1; filter: brightness(1.1); }
  94% { opacity: 0.9; }
  95% { opacity: 1; filter: brightness(1); }
}

/* ---- Right side: Phone ---- */

.phone-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#app {
  width: 100%;
  height: 100%;
}

.phone-frame {
  --phone-w: 393px;
  --phone-ratio: calc(852 / 393);
  width: var(--phone-w);
  height: calc(var(--phone-w) * var(--phone-ratio));
  max-height: calc(100vh - 48px);
  max-width: calc((100vh - 48px) / var(--phone-ratio));
  border-radius: 44px;
  border: 4px solid #1a1a1a;
  box-shadow:
    0 0 0 2px #0d0d0d,
    0 0 40px rgba(255, 129, 0, 0.08),
    0 20px 60px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
  background: #0a0800;
  flex-shrink: 0;
}

.phone-notch {
  display: block;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 34px;
  background: #0d0d0d;
  border-radius: 20px;
  z-index: 10;
}

.phone-speaker {
  display: block;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 4px;
  background: #1a1a1a;
  border-radius: 2px;
  z-index: 11;
}

/* Volume buttons (left side) */
.phone-frame::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 160px;
  width: 3px;
  height: 32px;
  background: #1a1a1a;
  border-radius: 2px 0 0 2px;
  box-shadow: 0 44px 0 #1a1a1a;
}

/* Power button (right side) */
.phone-frame::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 190px;
  width: 3px;
  height: 56px;
  background: #1a1a1a;
  border-radius: 0 2px 2px 0;
}

#app {
  border-radius: 40px;
  overflow: hidden;
}

canvas {
  border-radius: 40px;
}

/* ---- Mobile: stack vertically, hide phone ---- */

@media (max-width: 767px) {
  .split-layout {
    flex-direction: column;
    overflow-y: auto;
  }

  .hero-side {
    flex: none;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .phone-side {
    display: none;
  }

  .crt-overlay {
    display: none;
  }

  .hero-side::after {
    display: none;
  }
}

/* ---- Noscript fallback ---- */

.noscript-fallback {
  font-family: 'IBM Plex Mono', monospace;
  color: #ff8100;
  background: #0a0800;
  padding: 2rem;
  max-width: 80ch;
  margin: 0 auto;
  line-height: 1.6;
  text-align: center;
}

.noscript-fallback h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.noscript-fallback a {
  color: #ff8100;
  text-decoration: underline;
}
