/* ----- reset & base ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: #000;
  color: #fff;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow: hidden;
  cursor: none;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: none; }

/* ----- canvas + character ----- */
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* ----- film grain noise overlay (background set by JS) ----- */
#grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99;
  opacity: 0.55;
  mix-blend-mode: overlay;
  background-repeat: repeat;
  background-size: 256px 256px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#character {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(100vw, 1440px);
  height: auto;
  max-height: none;
  object-fit: contain;
  z-index: 3;
  pointer-events: none;
  user-select: none;
  filter: grayscale(1) drop-shadow(0 0 40px rgba(255, 255, 255, 0.18));
  animation: characterFloat 7s ease-in-out infinite;
}

@keyframes characterFloat {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50%      { transform: translate(-50%, -50%) translateY(-10px); }
}

#character-glow {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 60vmin;
  height: 60vmin;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0) 65%);
  pointer-events: none;
  z-index: 2;
  animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 0.95; transform: translate(-50%, -50%) scale(1.1); }
}

/* ----- topbar ----- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
  z-index: 10;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.brand {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.45);
  user-select: none;
}
.brand-tick {
  color: #fff;
  margin-right: 2px;
  opacity: 0.7;
}

.links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform .15s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn svg { display: block; }

/* ----- CA bar ----- */
.ca-bar {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.5px;
  max-width: 92vw;
}
.ca-label {
  color: #fff;
  font-weight: 700;
  opacity: 0.7;
}
.ca-bar code {
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60vw;
}

/* ----- hero text behind everything ----- */
.hero-text {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  opacity: 0.06;
}
.hero-text h1 {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: clamp(80px, 18vw, 280px);
  letter-spacing: 8px;
  line-height: 0.9;
  color: #fff;
}
.hero-text h1 span { color: #fff; opacity: 0.7; }
.hero-text p {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  letter-spacing: 6px;
  margin-top: 12px;
  text-transform: uppercase;
}

/* ----- custom cursor ----- */
#cursor {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 100;
  transform: translate(-50%, -50%);
  will-change: transform;
}
.cursor-dot {
  position: absolute;
  top: 50%; left: 50%;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 8px #fff,
    0 0 18px rgba(255, 255, 255, 0.7),
    0 0 36px rgba(255, 255, 255, 0.35);
}
.cursor-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  transform: translate(-50%, -50%);
  transition: width .15s ease, height .15s ease, border-color .15s ease;
}
#cursor.hot .cursor-ring {
  width: 56px; height: 56px;
  border-color: #fff;
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.6);
}

/* ----- toast ----- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translate(-50%, 20px);
  padding: 10px 18px;
  background: #fff;
  color: #000;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  transition: opacity .25s ease, transform .25s ease;
  box-shadow: 0 0 32px rgba(255, 255, 255, 0.5);
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ----- responsive ----- */
@media (max-width: 720px) {
  .topbar {
    padding: 14px 14px;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  .links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }
  .btn { padding: 8px 12px; font-size: 11px; }
  .brand { text-align: center; font-size: 18px; }
  #character { width: 100vw; max-height: none; }
  .ca-bar code { max-width: 70vw; font-size: 11px; }
}
