@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=Press+Start+2P&display=swap');

:root {
  --bg: #060607;
  --bg2: #0b0b0d;
  --panel: rgba(13, 13, 16, 0.82);
  --panel-strong: rgba(18, 18, 22, 0.96);
  --line: rgba(130, 54, 68, 0.28);
  --line-strong: rgba(181, 74, 94, 0.44);
  --accent: #b33b52;
  --accent-soft: #d46a83;
  --accent-deep: #6d1f30;
  --text: #f6f1f2;
  --muted: #9b8f93;
  --font-ui: "IBM Plex Mono", monospace;
  --font-brand: "Press Start 2P", monospace;
  --shadow-red: 0 0 22px rgba(179, 59, 82, 0.22);
  --shadow-black: 0 30px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at 18% 20%, rgba(179, 59, 82, 0.08), transparent 24%),
    radial-gradient(circle at 82% 70%, rgba(212, 106, 131, 0.06), transparent 28%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  color: var(--text);
  font-family: var(--font-ui);
}

.login-scene {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.scene-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: .08;
  animation: gridShift 16s linear infinite;
}

.scene-noise {
  position: absolute;
  inset: 0;
  opacity: .035;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.30) 0 1px, transparent 1px),
    radial-gradient(circle at 80% 40%, rgba(255,255,255,.22) 0 1px, transparent 1px),
    radial-gradient(circle at 40% 80%, rgba(255,255,255,.18) 0 1px, transparent 1px);
  background-size: 160px 160px, 220px 220px, 140px 140px;
  animation: noiseFloat 18s linear infinite;
}

.scene-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(70px);
  opacity: .26;
}

.scene-glow-a {
  width: 420px;
  height: 420px;
  left: -120px;
  top: -60px;
  background: rgba(179, 59, 82, 0.16);
  animation: glowDriftA 14s ease-in-out infinite;
}

.scene-glow-b {
  width: 360px;
  height: 360px;
  right: -100px;
  bottom: -80px;
  background: rgba(212, 106, 131, 0.12);
  animation: glowDriftB 16s ease-in-out infinite;
}

.pixel {
  position: absolute;
  width: 16px;
  height: 16px;
  background: linear-gradient(180deg, rgba(212,106,131,.40), rgba(109,31,48,.25));
  border: 1px solid rgba(212,106,131,.22);
  box-shadow: var(--shadow-red);
  opacity: .34;
}

.pixel-a { top: 14%; left: 18%; animation: pixelFloat 12s ease-in-out infinite; }
.pixel-b { top: 68%; left: 12%; animation: pixelFloat 15s ease-in-out infinite 1s; }
.pixel-c { top: 22%; right: 16%; animation: pixelFloat 13s ease-in-out infinite 2s; }
.pixel-d { bottom: 14%; right: 20%; animation: pixelFloat 17s ease-in-out infinite .5s; }

.login-page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.hero-card {
  position: relative;
  width: min(880px, 100%);
  min-height: min(560px, calc(100vh - 56px));
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(17,17,20,.64), rgba(10,10,12,.84));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-black), inset 0 0 0 1px rgba(255,255,255,.018);
  backdrop-filter: blur(10px);
  overflow: hidden;
  transform-style: preserve-3d;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(181, 74, 94, 0.14);
  pointer-events: none;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,.018), transparent 18%, transparent 82%, rgba(255,255,255,.012)),
    radial-gradient(circle at center, transparent 0 52%, rgba(179,59,82,.03) 76%, transparent 100%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 48px 32px;
  display: grid;
  justify-items: center;
  gap: 56px;
}

.qudi-wrap {
  position: relative;
  display: grid;
  place-items: center;
}

.qudi-shadow,
.qudi-title {
  font-family: var(--font-brand);
  text-transform: uppercase;
  letter-spacing: 8px;
}

.qudi-shadow {
  position: absolute;
  font-size: clamp(34px, 8vw, 92px);
  color: rgba(179,59,82,.22);
  transform: translate(8px, 8px);
  filter: blur(6px);
  user-select: none;
  animation: shadowPulse 5s ease-in-out infinite;
}

.qudi-title {
  margin: 0;
  font-size: clamp(34px, 8vw, 92px);
  line-height: 1.2;
  color: var(--text);
  text-align: center;
  text-shadow:
    0 0 0 rgba(0,0,0,0),
    0 0 18px rgba(212, 106, 131, 0.10);
}

.qudi-title span {
  display: inline-block;
  animation: letterFloat 4.6s ease-in-out infinite;
}

.qudi-title span:nth-child(1) { animation-delay: 0s; }
.qudi-title span:nth-child(2) { animation-delay: .12s; }
.qudi-title span:nth-child(3) { animation-delay: .24s; }
.qudi-title span:nth-child(4) { animation-delay: .36s; }

.enter-link {
  text-decoration: none;
}

.enter-btn {
  position: relative;
  min-width: 248px;
  min-height: 62px;
  padding: 0 28px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(23,23,28,.96), rgba(12,12,14,.96));
  color: var(--text);
  font-family: var(--font-brand);
  font-size: 12px;
  letter-spacing: 2px;
  cursor: pointer;
  overflow: hidden;
  box-shadow:
    inset 0 -5px 0 rgba(0,0,0,.28),
    0 18px 40px rgba(0,0,0,.28),
    0 0 0 1px rgba(255,255,255,.015);
  transition:
    transform .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    filter .18s ease;
}

.enter-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(212,106,131,.62);
  box-shadow:
    inset 0 -5px 0 rgba(0,0,0,.28),
    0 20px 46px rgba(0,0,0,.34),
    0 0 26px rgba(179,59,82,.18);
  filter: brightness(1.04);
}

.enter-btn:active {
  transform: translateY(0);
}

.enter-btn-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0%, rgba(212,106,131,.08) 40%, rgba(212,106,131,.20) 50%, rgba(212,106,131,.08) 60%, transparent 100%);
  transform: translateX(-130%);
  animation: btnSweep 3.8s linear infinite;
}

.enter-btn-label {
  position: relative;
  z-index: 2;
}

.glitch {
  animation: glitchFlash .28s ease;
}

@keyframes gridShift {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(34px, 34px, 0); }
}

@keyframes noiseFloat {
  0% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-12px, 8px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

@keyframes glowDriftA {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 18px) scale(1.06); }
}

@keyframes glowDriftB {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, -16px) scale(1.08); }
}

@keyframes pixelFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: .22; }
  50% { transform: translateY(-16px) rotate(180deg); opacity: .5; }
}

@keyframes shadowPulse {
  0%, 100% { opacity: .22; transform: translate(8px, 8px) scale(1); }
  50% { opacity: .34; transform: translate(10px, 10px) scale(1.02); }
}

@keyframes letterFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes btnSweep {
  0% { transform: translateX(-130%); }
  100% { transform: translateX(130%); }
}

@keyframes glitchFlash {
  0% { transform: translate(0,0); filter: none; }
  20% { transform: translate(-2px,1px); filter: drop-shadow(2px 0 rgba(212,106,131,.40)); }
  40% { transform: translate(2px,-1px); filter: drop-shadow(-2px 0 rgba(255,255,255,.20)); }
  60% { transform: translate(-1px,1px); }
  80% { transform: translate(1px,-1px); }
  100% { transform: translate(0,0); filter: none; }
}

@media (max-width: 700px) {
  .hero-card {
    min-height: min(520px, calc(100vh - 32px));
  }

  .hero-inner {
    gap: 42px;
    padding: 40px 22px;
  }

  .qudi-shadow,
  .qudi-title {
    letter-spacing: 4px;
  }

  .enter-btn {
    min-width: 220px;
    min-height: 58px;
    font-size: 11px;
  }

  .pixel {
    width: 12px;
    height: 12px;
  }
}
