@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --liquid-base: #07090e;
  --liquid-glass-surface: rgba(18, 24, 38, 0.65);
  --liquid-glass-elevated: rgba(28, 38, 60, 0.75);
  --liquid-glass-border: rgba(255, 255, 255, 0.12);
  --liquid-glass-sheen: linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.02) 100%);
  
  --fluid-live: #ff334b;
  --fluid-live-glow: rgba(255, 51, 75, 0.5);
  --fluid-rec: #ff7a00;
  --fluid-rec-glow: rgba(255, 122, 0, 0.4);
  --fluid-healthy: #00f5a0;
  --fluid-healthy-glow: rgba(0, 245, 160, 0.4);
  --fluid-cyber: #00d2ff;
  --fluid-cyber-glow: rgba(0, 210, 255, 0.35);
  --fluid-violet: #7928ca;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--liquid-base);
  color: #f8fafc;
  font-family: 'Plus Jakarta Sans', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

/* Ambient Liquid Mesh Background */
.liquid-canvas {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.liquid-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: floatFluid 18s ease-in-out infinite alternate;
}

.blob-1 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, #7928ca 0%, rgba(121, 40, 202, 0) 70%);
  top: -80px;
  left: -80px;
}

.blob-2 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #00d2ff 0%, rgba(0, 210, 255, 0) 70%);
  bottom: 5%;
  right: -100px;
  animation-duration: 22s;
  animation-delay: -5s;
}

.blob-3 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, #ff334b 0%, rgba(255, 51, 75, 0) 70%);
  top: 40%;
  left: 30%;
  opacity: 0.25;
  animation-duration: 15s;
  animation-delay: -9s;
}

@keyframes floatFluid {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.1); }
  100% { transform: translate(-30px, 50px) scale(0.95); }
}

/* Liquid Glass Panels */
.liquid-glass {
  background: var(--liquid-glass-surface);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--liquid-glass-border);
  border-radius: 1.5rem;
  box-shadow: 
    0 20px 40px -15px rgba(0, 0, 0, 0.6),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
}

.liquid-glass::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--liquid-glass-sheen);
  pointer-events: none;
}

/* Tactile Liquid Buttons */
.liquid-btn {
  background: var(--liquid-glass-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--liquid-glass-border);
  border-radius: 1.25rem;
  color: #ffffff;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  box-shadow: 
    0 10px 25px -5px rgba(0, 0, 0, 0.4),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.liquid-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 100%);
  border-top-left-radius: 1.25rem;
  border-top-right-radius: 1.25rem;
  pointer-events: none;
}

.liquid-btn:active {
  transform: scale(0.93);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.5),
    inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Master Live State */
.liquid-btn.btn-live-active {
  background: linear-gradient(135deg, rgba(255, 51, 75, 0.9), rgba(180, 10, 30, 0.95)) !important;
  border-color: rgba(255, 180, 190, 0.6) !important;
  box-shadow: 0 0 35px var(--fluid-live-glow), inset 0 1px 2px rgba(255, 255, 255, 0.4) !important;
  animation: liveHeartbeat 2s infinite ease-in-out;
}

@keyframes liveHeartbeat {
  0%, 100% { box-shadow: 0 0 25px var(--fluid-live-glow); }
  50% { box-shadow: 0 0 45px rgba(255, 51, 75, 0.85); }
}

/* Master Record State */
.liquid-btn.btn-rec-active {
  background: linear-gradient(135deg, rgba(255, 122, 0, 0.9), rgba(190, 70, 0, 0.95)) !important;
  border-color: rgba(255, 200, 150, 0.6) !important;
  box-shadow: 0 0 30px var(--fluid-rec-glow) !important;
}

/* Scene Card Button */
.scene-btn {
  background: rgba(18, 24, 38, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 0.875rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.scene-btn:active {
  transform: scale(0.96);
}

.scene-btn.active-scene {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.2), rgba(121, 40, 202, 0.25));
  border: 1px solid #00d2ff;
  box-shadow: 0 0 25px rgba(0, 210, 255, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

/* Floating Telemetry Island */
.liquid-island {
  background: rgba(12, 16, 26, 0.82);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  box-shadow: 
    0 15px 35px -5px rgba(0, 0, 0, 0.7),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

/* Bottom Glass Dock */
.liquid-dock {
  background: rgba(12, 16, 26, 0.85);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.6);
}

/* Pulse Dots */
.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: relative;
  display: inline-block;
}

.pulse-dot.dot-red {
  background-color: var(--fluid-live);
  box-shadow: 0 0 12px var(--fluid-live);
}

.pulse-dot.dot-red::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--fluid-live);
  animation: dotPulse 1.5s infinite;
}

.pulse-dot.dot-green {
  background-color: var(--fluid-healthy);
  box-shadow: 0 0 12px var(--fluid-healthy);
}

@keyframes dotPulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Custom Audio Slider Range */
input[type="range"].liquid-range {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

input[type="range"].liquid-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #00d2ff;
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.6);
  cursor: pointer;
  transition: transform 0.15s ease;
}

input[type="range"].liquid-range::-webkit-slider-thumb:active {
  transform: scale(1.2);
}

/* Safe area insets for mobile */
.safe-bottom {
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
}
.safe-top {
  padding-top: max(1rem, env(safe-area-inset-top));
}
