/* ═══════════════════════════════════════════════
   DESIGN TOKENS — Dark Grey Palette
   ═══════════════════════════════════════════════ */
:root {
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-bg-hover: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: 22px;
  --text-primary: #e4e4e7;
  --text-secondary: rgba(255, 255, 255, 0.4);
  --accent: #a1a1aa;
  --accent-glow: rgba(161, 161, 170, 0.25);
  --accent-light: #d4d4d8;
  --surface: #18181b;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  color: var(--text-primary);
  background: #09090b;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
}

/* ═══════════════════════════════════════════════
   GLASS UTILITY
   ═══════════════════════════════════════════════ */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
}

/* ═══════════════════════════════════════════════
   ANIMATED BACKGROUND
   ═══════════════════════════════════════════════ */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

#neural-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  transition: opacity 1s ease;
}

.bg__orb {
  transition: opacity 1s ease;
}

/* ── Page 2 state — hide neural layer, reveal void ── */
body.on-page-2 #neural-canvas {
  opacity: 0;
}

body.on-page-2 .bg__orb {
  opacity: 0 !important;
}

.bg__gradient {
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(135deg,
      #09090b 0%,
      #18181b 20%,
      #1c1c22 40%,
      #141418 60%,
      #0f0f12 80%,
      #09090b 100%);
  animation: gradientShift 20s ease-in-out infinite;
}

@keyframes gradientShift {

  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }

  25% {
    transform: translate(-5%, -5%) rotate(1deg);
  }

  50% {
    transform: translate(-3%, 3%) rotate(-0.5deg);
  }

  75% {
    transform: translate(3%, -2%) rotate(0.5deg);
  }
}

.bg__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.2;
  animation: orbFloat 15s ease-in-out infinite;
}

.bg__orb--1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #3f3f46 0%, transparent 70%);
  top: -10%;
  right: -5%;
  animation-duration: 18s;
}

.bg__orb--2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #52525b 0%, transparent 70%);
  bottom: -10%;
  left: -5%;
  animation-duration: 22s;
  animation-delay: -5s;
}

.bg__orb--3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #71717a 0%, transparent 70%);
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  animation-duration: 25s;
  animation-delay: -10s;
  opacity: 0.12;
}

@keyframes orbFloat {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -40px) scale(1.05);
  }

  66% {
    transform: translate(-20px, 20px) scale(0.95);
  }
}

/* ═══════════════════════════════════════════════
   LOADING SCREEN
   ═══════════════════════════════════════════════ */
.loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #09090b;
  transition: opacity 1.1s cubic-bezier(0.4, 0, 0.2, 1),
              transform 1.1s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 1.1s;
}

.loader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.04);
}

.loader__glass {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  padding: 60px 80px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  animation: glassAppear 1s ease forwards;
}

@keyframes glassAppear {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.loader__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.loader__greeting {
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--text-secondary);
  animation: fadeSlideUp 0.8s 0.3s ease both;
}

.loader__name {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #e4e4e7, #71717a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeSlideUp 0.8s 0.5s ease both;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.loader__action {
  position: relative;
  width: 180px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeSlideUp 0.6s 0.7s ease both;
}

.loader__bar {
  position: absolute;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
  transition: height 0.55s cubic-bezier(0.4, 0, 0.2, 1),
              border-radius 0.55s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.55s ease,
              box-shadow 0.55s ease;
}

.loader__action.morphing .loader__bar {
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.loader__bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #71717a, #a1a1aa);
  border-radius: 2px;
  animation: barFill 2.2s 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  transition: opacity 0.4s ease;
}

.loader__action.morphing .loader__bar-fill {
  opacity: 0;
}

@keyframes barFill {
  0% {
    width: 0%;
  }

  40% {
    width: 45%;
  }

  70% {
    width: 75%;
  }

  100% {
    width: 100%;
  }
}

.loader__enter-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, color 0.3s ease;
  z-index: 1;
}

.loader__enter-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

.loader__enter-btn:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* ═══════════════════════════════════════════════
   TOAST NOTIFICATION
   ═══════════════════════════════════════════════ */
.toast {
  position: fixed;
  top: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: var(--text-primary);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast__icon {
  width: 16px;
  height: 16px;
  color: #a1a1aa;
  flex-shrink: 0;
}

.toast__text strong {
  color: #d4d4d8;
}


.main {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 120px;
  opacity: 0;
  transform: translateY(18px);
  translate: 0 0;
  transition: opacity 0.9s cubic-bezier(0.4, 0, 0.2, 1) 0.1s,
              transform 0.9s cubic-bezier(0.4, 0, 0.2, 1) 0.1s,
              translate 0.82s cubic-bezier(0.76, 0, 0.24, 1);
}

.main.visible {
  opacity: 1;
  transform: translateY(0);
}

.main.page-above {
  translate: 0 -100vh;
}

/* ═══════════════════════════════════════════════
   VIZ PAGE
   ═══════════════════════════════════════════════ */
.viz-page {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  translate: 0 100vh;
  transition: translate 0.82s cubic-bezier(0.76, 0, 0.24, 1);
}

.viz-page.page-visible {
  translate: 0 0;
}

.viz-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ═══════════════════════════════════════════════
   SCROLL HINTS
   ═══════════════════════════════════════════════ */
.scroll-hint {
  position: absolute;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.15);
  pointer-events: none;
  animation: scrollBounce 2.2s ease-in-out infinite;
}

.scroll-hint svg {
  width: 20px;
  height: 20px;
  display: block;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(5px); }
}

.scroll-up-hint {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.15);
  pointer-events: none;
  animation: scrollBounceUp 2.2s ease-in-out infinite;
}

.scroll-up-hint svg {
  width: 20px;
  height: 20px;
  display: block;
}

@keyframes scrollBounceUp {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(-5px); }
}

/* ═══════════════════════════════════════════════
   UPLOAD ICON
   ═══════════════════════════════════════════════ */
.upload-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition),
              box-shadow var(--transition),
              transform var(--transition),
              opacity 1.4s ease;
  opacity: 0.45;
  z-index: 2;
}

.upload-icon:hover {
  opacity: 0.85;
  background: var(--glass-bg-hover);
  transform: translate(-50%, -50%) scale(1.06);
}

.upload-icon.faded {
  opacity: 0;
  pointer-events: none;
}

.upload-icon svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
  transition: color var(--transition);
}

.upload-icon:hover svg {
  color: var(--accent-light);
}

.upload-icon.drag-over {
  background: var(--glass-bg-hover);
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  opacity: 0.9;
}

/* ═══════════════════════════════════════════════
   HERO CARD
   ═══════════════════════════════════════════════ */
.hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 56px;
  border-radius: var(--radius-lg);
  text-align: center;
  max-width: 420px;
  width: 100%;
  animation: cardFloat 6s ease-in-out infinite;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: opacity 1s ease;
}

@keyframes cardFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.hero-card__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 30px rgba(63, 63, 70, 0.3);
  transition: transform var(--transition), box-shadow var(--transition);
}

.hero-card__avatar:hover {
  transform: scale(1.08);
  box-shadow: 0 0 45px rgba(63, 63, 70, 0.4);
}

.hero-card__name {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff, #a1a1aa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-card__tagline {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--text-secondary);
  letter-spacing: 1px;
  min-height: 1.4em;
  transition: opacity 0.4s ease;
}

.hero-card__tagline.fade {
  opacity: 0;
}

.hero-card__links {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.social-link {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.social-link svg {
  width: 20px;
  height: 20px;
  transition: transform var(--transition);
}

.social-link:hover {
  background: var(--glass-bg-hover);
  border-color: #71717a;
  box-shadow: 0 0 20px rgba(113, 113, 122, 0.2);
  transform: translateY(-3px);
}

.social-link:hover svg {
  transform: scale(1.1);
  color: #d4d4d8;
}

/* ═══════════════════════════════════════════════
   MUSIC PLAYER
   ═══════════════════════════════════════════════ */
.player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  gap: 20px;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1) 0.35s,
              transform 0.65s cubic-bezier(0.4, 0, 0.2, 1) 0.35s;
}

.player.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Visualizer bars */
.player__visualizer {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 24px;
  min-width: 26px;
}

.player__visualizer span {
  width: 3px;
  background: #71717a;
  border-radius: 2px;
  height: 4px;
  transition: height 0.2s ease;
}

.player.playing .player__visualizer span:nth-child(1) {
  animation: vizBar 0.6s ease-in-out infinite alternate;
}

.player.playing .player__visualizer span:nth-child(2) {
  animation: vizBar 0.5s 0.1s ease-in-out infinite alternate;
}

.player.playing .player__visualizer span:nth-child(3) {
  animation: vizBar 0.7s 0.2s ease-in-out infinite alternate;
}

.player.playing .player__visualizer span:nth-child(4) {
  animation: vizBar 0.4s 0.15s ease-in-out infinite alternate;
}

.player.playing .player__visualizer span:nth-child(5) {
  animation: vizBar 0.55s 0.05s ease-in-out infinite alternate;
}

@keyframes vizBar {
  0% {
    height: 4px;
  }

  100% {
    height: 20px;
  }
}

.player__info {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.player__track-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.player__track-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Controls */
.player__controls {
  display: flex;
  align-items: center;
}

.player__btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.player__btn svg {
  width: 20px;
  height: 20px;
}

.player__btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.player__btn--play {
  width: 42px;
  height: 42px;
  background: rgba(161, 161, 170, 0.15);
  border: 1px solid rgba(161, 161, 170, 0.2);
}

.player__btn--play:hover {
  background: rgba(161, 161, 170, 0.25);
  transform: scale(1.08);
}

.player__btn--play svg {
  width: 20px;
  height: 20px;
}

/* Right section */
.player__right {
  display: flex;
  align-items: center;
}

.player__volume {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player__volume-icon {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* Volume slider */
#volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 90px;
  height: 3px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
  cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #a1a1aa;
  box-shadow: 0 0 6px rgba(161, 161, 170, 0.3);
  cursor: pointer;
  transition: transform var(--transition);
}

#volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

#volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #a1a1aa;
  box-shadow: 0 0 6px rgba(161, 161, 170, 0.3);
  cursor: pointer;
  border: none;
}

.hidden {
  display: none !important;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 700px) {
  .hero-card {
    padding: 36px 28px;
  }

  .hero-card__name {
    font-size: 1.7rem;
  }

  .player {
    padding: 12px 16px;
    gap: 14px;
  }

  #volume-slider {
    width: 60px;
  }

  .loader__glass {
    padding: 40px 36px;
  }

  .loader__name {
    font-size: 2.2rem;
  }
}

@media (max-width: 400px) {
  .loader__glass {
    padding: 32px 24px;
  }

  .loader__name {
    font-size: 1.8rem;
  }

  .loader__action {
    width: 140px;
  }
}

/* ═══════════════════════════════════════════════
   CRT EASTER EGG OVERLAY
   ═══════════════════════════════════════════════ */
#crt-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #000;
  pointer-events: none;
  opacity: 0;
}

#crt-overlay.crt-active {
  pointer-events: all;
  opacity: 1;
}

#crt-bar {
  position: absolute;
  left: 0;
  width: 100%;
  top: 50%;
  height: 100vh;
  transform: translateY(-50%);
  background: #fff;
  box-shadow: 0 0 80px 40px rgba(255, 255, 255, 0.4),
              0 0 16px 4px rgba(255, 255, 255, 0.9);
  z-index: 1;
  opacity: 0;
}

#crt-terminal {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8vh 13vw;
  font-family: 'Courier New', Courier, monospace;
  font-size: clamp(11px, 1.3vw, 14px);
  line-height: 1.95;
  letter-spacing: 0.04em;
  color: #9fe89f;
  opacity: 0;
  z-index: 2;
}

#crt-terminal.crt-visible {
  opacity: 1;
}

#crt-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.18) 2px,
    rgba(0, 0, 0, 0.18) 4px
  );
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.5s;
}

#crt-scanlines.crt-visible {
  opacity: 1;
}

.crt-tline {
  min-height: 1.95em;
  overflow: hidden;
}

.crt-tline.crt-error {
  color: #ff2b2b;
  margin-top: 0.5em;
}

.crt-tline.crt-psych {
  color: #b8b8b8;
  opacity: 0;
  transition: opacity 0.7s ease;
  margin-top: 0.15em;
}

.crt-tline.crt-psych.show {
  opacity: 1;
}

@keyframes crtGlitch {
  0%   { transform: translateX(0)    skewX(0deg);     filter: brightness(1); }
  15%  { transform: translateX(-5px) skewX(-2.5deg);  filter: brightness(2.5); }
  30%  { transform: translateX(4px)  skewX(1.5deg);   filter: brightness(1); }
  55%  { transform: translateX(-2px) skewX(0deg); }
  75%  { transform: translateX(3px);                  filter: brightness(1.4); }
  100% { transform: translateX(0)    skewX(0deg);     filter: brightness(1); }
}

.crt-tline.crt-glitching {
  animation: crtGlitch 0.2s ease-in-out;
}

@keyframes crtFlicker {
  0%, 100% { opacity: 1; }
  30%       { opacity: 0.88; }
  50%       { opacity: 0.62; }
  70%       { opacity: 0.9; }
  85%       { opacity: 0.75; }
}

#crt-terminal.crt-flickering {
  animation: crtFlicker 0.28s step-end;
}