:root {
  --bg-dark: #040807;
  --neon-green: #00ff88;
  --neon-green-glow: rgba(0, 255, 136, 0.6);
  --neon-green-dim: rgba(0, 255, 136, 0.15);
  --border-green: rgba(0, 255, 136, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* Background ambient glow */
.ambient-glow {
  position: absolute;
  width: 60vh;
  height: 60vh;
  background: radial-gradient(circle, var(--neon-green-glow) 0%, rgba(0, 255, 136, 0.05) 50%, transparent 70%);
  filter: blur(80px);
  opacity: 0.6;
  z-index: 0;
  animation: ambientPulse 4s infinite ease-in-out;
}

@keyframes ambientPulse {
  0%, 100% { opacity: 0.5; transform: scale(0.95); }
  50% { opacity: 0.8; transform: scale(1.08); }
}

.page-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  gap: 20px;
  overflow: hidden;
}

.company-title {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  pointer-events: none;
  font-size: clamp(1.75rem, 7.5vw, 10.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #ffffff;
  width: 92vw;
  max-width: 90%;
  text-align: center;
  padding: 0 16px;
  word-break: break-word;
  overflow-wrap: break-word;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.95), 0 0 60px rgba(0, 0, 0, 0.85);
}

/* Main Battery Container scaled to viewport height */
.battery-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: clamp(280px, 70vh, 800px);
  width: 90vw;
  max-width: 400px;
  aspect-ratio: 1 / 2.1;
  opacity: 0.20;
  filter: drop-shadow(0 0 35px var(--neon-green-glow));
  margin: 0 auto;
}

/* Battery Top Terminal Cap */
.battery-cap {
  width: 32%;
  height: 5%;
  background: var(--neon-green);
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  box-shadow: 0 0 20px var(--neon-green), inset 0 0 10px rgba(255, 255, 255, 0.8);
  margin-bottom: 2px;
}

/* Battery Main Outer Shell */
.battery-body {
  width: 100%;
  height: 95%;
  border: 6px solid var(--neon-green);
  border-radius: 36px;
  background: rgba(4, 15, 10, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 
    0 0 30px var(--border-green),
    inset 0 0 25px rgba(0, 255, 136, 0.2);
  padding: 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Inner Bars Stack */
.battery-inner {
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  height: 100%;
  width: 100%;
}

/* Individual Charging Bar */
.battery-bar {
  flex: 1;
  width: 100%;
  border-radius: 16px;
  background: var(--neon-green-dim);
  border: 1px solid rgba(0, 255, 136, 0.2);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  min-height: 20px;
}

/* Loop filling animation for the bars */
.bar-1 { animation: fillBar1 3.2s infinite ease-in-out; }
.bar-2 { animation: fillBar2 3.2s infinite ease-in-out; }
.bar-3 { animation: fillBar3 3.2s infinite ease-in-out; }
.bar-4 { animation: fillBar4 3.2s infinite ease-in-out; }

/* Keyframe loops: Bars fill bottom-up sequentially (0-25%, 25-50%, 50-75%, 75-100%) */
@keyframes fillBar1 {
  0%, 10% {
    background: var(--neon-green-dim);
    box-shadow: none;
  }
  20%, 85% {
    background: var(--neon-green);
    box-shadow: 0 0 25px var(--neon-green), inset 0 0 10px #ffffff;
  }
  95%, 100% {
    background: var(--neon-green-dim);
    box-shadow: none;
  }
}

@keyframes fillBar2 {
  0%, 30% {
    background: var(--neon-green-dim);
    box-shadow: none;
  }
  40%, 85% {
    background: var(--neon-green);
    box-shadow: 0 0 25px var(--neon-green), inset 0 0 10px #ffffff;
  }
  95%, 100% {
    background: var(--neon-green-dim);
    box-shadow: none;
  }
}

@keyframes fillBar3 {
  0%, 50% {
    background: var(--neon-green-dim);
    box-shadow: none;
  }
  60%, 85% {
    background: var(--neon-green);
    box-shadow: 0 0 25px var(--neon-green), inset 0 0 10px #ffffff;
  }
  95%, 100% {
    background: var(--neon-green-dim);
    box-shadow: none;
  }
}

@keyframes fillBar4 {
  0%, 70% {
    background: var(--neon-green-dim);
    box-shadow: none;
  }
  80%, 85% {
    background: var(--neon-green);
    box-shadow: 0 0 25px var(--neon-green), inset 0 0 10px #ffffff;
  }
  95%, 100% {
    background: var(--neon-green-dim);
    box-shadow: none;
  }
}

/* Responsive adjustments for tablets and phones */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }
  
  .page-wrapper {
    padding: 20px;
  }
  
  .company-title {
    font-size: clamp(1.5rem, 6.5vw, 3.5rem);
    width: 90vw;
  }
  
  .battery-container {
    height: clamp(250px, 60vh, 600px);
    max-width: 350px;
  }
  
  .battery-body {
    border-width: 5px;
    padding: 16px;
  }
  
  .battery-inner {
    gap: 10px;
  }
}

/* Small phones (max-width: 480px) */
@media (max-width: 480px) {
  body {
    font-size: 16px;
  }
  
  .page-wrapper {
    padding: 16px;
  }
  
  .company-title {
    font-size: clamp(1.25rem, 5.5vw, 2.5rem);
    width: 95vw;
    top: 30%;
  }
  
  .battery-container {
    height: clamp(200px, 50vh, 500px);
    max-width: 280px;
    top: 55%;
  }
  
  .battery-body {
    border-width: 4px;
    border-radius: 28px;
    padding: 14px;
  }
  
  .battery-inner {
    gap: 8px;
  }
  
  .battery-bar {
    min-height: 18px;
  }
}

/* Landscape and very small height adjustments */
@media (max-height: 500px) {
  .page-wrapper {
    gap: 10px;
  }
  
  .company-title {
    font-size: clamp(1.2rem, 5vh, 2.2rem);
    top: 25%;
  }
  
  .battery-container {
    height: clamp(180px, 45vh, 400px);
    max-width: 250px;
  }
}
