/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.balls-container {
  width: 500px;
  height: 500px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.balls-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* CSS Fallback MetaBalls Animation - Filled blobs that merge */
.metaballs-css {
  position: relative;
  width: 100%;
  height: 100%;
  filter: url('#goo') blur(0px);
  background: transparent;
}

/* SVG filter for gooey effect */
.metaballs-css::before {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
}

.metaball {
  position: absolute;
  border-radius: 50%;
  background: var(--foreground, #000);
  filter: blur(15px);
}

.metaballs-css-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  filter: contrast(20) brightness(1);
  background: var(--background, #fff);
}

.metaball:nth-child(1) {
  width: 100px;
  height: 100px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: metaball1 4s ease-in-out infinite;
}

.metaball:nth-child(2) {
  width: 80px;
  height: 80px;
  top: 20%;
  left: 25%;
  animation: metaball2 5s ease-in-out infinite;
}

.metaball:nth-child(3) {
  width: 70px;
  height: 70px;
  top: 65%;
  left: 70%;
  animation: metaball3 4.4s ease-in-out infinite;
}

.metaball:nth-child(4) {
  width: 60px;
  height: 60px;
  top: 15%;
  left: 65%;
  animation: metaball4 5.6s ease-in-out infinite;
}

.metaball:nth-child(5) {
  width: 75px;
  height: 75px;
  top: 70%;
  left: 25%;
  animation: metaball5 4.6s ease-in-out infinite;
}

.metaball:nth-child(6) {
  width: 55px;
  height: 55px;
  top: 45%;
  left: 15%;
  animation: metaball6 5.2s ease-in-out infinite;
}

.metaball:nth-child(7) {
  width: 50px;
  height: 50px;
  top: 40%;
  left: 80%;
  animation: metaball7 4.8s ease-in-out infinite;
}

@keyframes metaball1 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.2); }
}

@keyframes metaball2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(50px, 35px); }
}

@keyframes metaball3 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-40px, -25px); }
}

@keyframes metaball4 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-35px, 40px); }
}

@keyframes metaball5 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(35px, -35px); }
}

@keyframes metaball6 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(25px, 25px); }
}

@keyframes metaball7 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-25px, 15px); }
}

.count-container {
  text-align: center;
}

.count-display {
  font-size: 3rem;
  font-weight: 600;
  color: var(--foreground);
  font-family: var(--font-mono);
}

/* Main Page */
.main-page {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: #0a0a0f;
  color: #ffffff;
}

.main-page.hidden {
  display: none;
}

.plasma-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: #0a0a0f;
}

.plasma-background canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Plasma CSS fallback container */
.plasma-css {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.main-content {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 2rem;
}

/* Glitch Text */
.glitch-text-container {
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.glitch {
  color: #fff;
  font-size: clamp(3rem, 12vw, 10rem);
  white-space: nowrap;
  font-weight: 900;
  position: relative;
  margin: 0 auto;
  user-select: none;
  cursor: pointer;
  letter-spacing: 0.05em;
}

.glitch::after,
.glitch::before {
  content: attr(data-text);
  position: absolute;
  top: 0;
  color: #fff;
  background-color: transparent;
  overflow: hidden;
  clip-path: inset(0 0 0 0);
}

.glitch::after {
  left: 3px;
  text-shadow: -3px 0 #fff;
  animation: animate-glitch 3s infinite linear alternate-reverse;
}

.glitch::before {
  left: -3px;
  text-shadow: 3px 0 #fff;
  animation: animate-glitch 2s infinite linear alternate-reverse;
}

@keyframes animate-glitch {
  0% { clip-path: inset(20% 0 50% 0); }
  5% { clip-path: inset(10% 0 60% 0); }
  10% { clip-path: inset(15% 0 55% 0); }
  15% { clip-path: inset(25% 0 35% 0); }
  20% { clip-path: inset(30% 0 40% 0); }
  25% { clip-path: inset(40% 0 20% 0); }
  30% { clip-path: inset(10% 0 60% 0); }
  35% { clip-path: inset(15% 0 55% 0); }
  40% { clip-path: inset(25% 0 35% 0); }
  45% { clip-path: inset(30% 0 40% 0); }
  50% { clip-path: inset(20% 0 50% 0); }
  55% { clip-path: inset(10% 0 60% 0); }
  60% { clip-path: inset(15% 0 55% 0); }
  65% { clip-path: inset(25% 0 35% 0); }
  70% { clip-path: inset(30% 0 40% 0); }
  75% { clip-path: inset(40% 0 20% 0); }
  80% { clip-path: inset(20% 0 50% 0); }
  85% { clip-path: inset(10% 0 60% 0); }
  90% { clip-path: inset(15% 0 55% 0); }
  95% { clip-path: inset(25% 0 35% 0); }
  100% { clip-path: inset(30% 0 40% 0); }
}

/* Logo Loop */
.logo-loop-container {
  width: 100%;
  max-width: 800px;
  height: 80px;
  position: relative;
  margin: 2rem 0;
  overflow: hidden;
}

.logoloop {
  position: relative;
  width: 100%;
  height: 100%;
  --logoloop-gap: 60px;
  --logoloop-logoHeight: 48px;
}

.logoloop__track {
  display: flex;
  width: max-content;
  will-change: transform;
  user-select: none;
  position: relative;
  z-index: 0;
}

.logoloop__list {
  display: flex;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
}

.logoloop__item {
  flex: 0 0 auto;
  margin-right: var(--logoloop-gap);
  font-size: var(--logoloop-logoHeight);
  line-height: 1;
  list-style: none;
}

.logoloop__item:last-child {
  margin-right: var(--logoloop-gap);
}

.logoloop__link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border-radius: var(--radius);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #ffffff;
  opacity: 0.7;
}

/* Desktop hover effects only */
@media (hover: hover) and (pointer: fine) {
  .logoloop__item:hover .logoloop__link {
    opacity: 1;
    transform: scale(1.3);
    filter: drop-shadow(0 4px 20px rgba(139, 92, 246, 0.5));
  }
}

.logoloop__link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* When hovering on track, dim non-hovered items - desktop only */
@media (hover: hover) and (pointer: fine) {
  .logoloop__track:hover .logoloop__item .logoloop__link {
    opacity: 0.3;
  }

  .logoloop__track:hover .logoloop__item:hover .logoloop__link {
    opacity: 1;
  }
}

/* Disable hover effects on mobile */
.logoloop--mobile .logoloop__link {
  opacity: 0.8 !important;
  transform: none !important;
}

.logoloop--mobile .logoloop__item:hover .logoloop__link {
  transform: none !important;
  filter: none !important;
}

.logoloop__icon {
  width: var(--logoloop-logoHeight);
  height: var(--logoloop-logoHeight);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.logoloop__icon svg {
  width: 100%;
  height: 100%;
}

/* Volume Slider - Elastic Style */
.volume-slider-container {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 100;
}

.slider-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 12rem;
}

.slider-wrapper {
  display: flex;
  width: 100%;
  touch-action: none;
  user-select: none;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.slider-wrapper:hover {
  opacity: 1;
  transform: scale(1.1);
}

.slider-root {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 120px;
  flex-grow: 1;
  cursor: grab;
  touch-action: none;
  user-select: none;
  align-items: center;
  padding: 0.75rem 0;
}

.slider-root:active {
  cursor: grabbing;
}

.slider-track-wrapper {
  display: flex;
  flex-grow: 1;
  transition: transform 0.15s ease;
}

.slider-root:active .slider-track-wrapper {
  transform: scaleY(0.85);
}

.slider-track {
  position: relative;
  height: 6px;
  width: 100%;
  flex-grow: 1;
  overflow: hidden;
  border-radius: 9999px;
  background-color: rgba(128, 128, 128, 0.4);
  transition: height 0.2s ease;
}

.slider-wrapper:hover .slider-track {
  height: 10px;
}

.slider-range {
  position: absolute;
  height: 100%;
  background-color: #ffffff;
  border-radius: 9999px;
  transition: width 0.05s ease;
}

.slider-icon {
  width: 24px;
  height: 24px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: transform 0.25s ease, color 0.2s ease;
}

.slider-icon svg {
  width: 100%;
  height: 100%;
}

.slider-icon.active {
  animation: iconPop 0.25s ease;
}

@keyframes iconPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

.value-indicator {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
}


/* Responsive */
@media (max-width: 768px) {
  .blur-text {
    font-size: 3rem;
  }

  .logo-loop-container {
    height: 60px;
  }

  .cards-container {
    flex-direction: column;
    align-items: center;
  }

  .volume-slider-container {
    top: 1rem;
    right: 1rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  15% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  85% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
}

.main-content {
  animation: fadeIn 0.5s ease;
}

/* Metaballs Container */
.metaballs-container {
  position: relative;
  width: 100%;
  height: 100%;
}

