:root {
  /* Redux Purple Palette */
  --primary: #764abc;
  --primary-light: #9f7aea;
  --primary-dark: #553c9a;
  --accent: #f472b6; /* Pink accent */
  
  /* Modern Dark Theme */
  --bg: #0f172a;       /* Slate 900 */
  --surface: #1e293b;  /* Slate 800 */
  --surface-2: #334155; /* Slate 700 */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  --shadow-glow: 0 0 20px rgba(118, 74, 188, 0.5);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(118, 74, 188, 0.15) 0%, transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(244, 114, 182, 0.1) 0%, transparent 20%);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

/* Animations */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-container {
  min-height: 100vh;
  padding: 4rem 2rem;
  display: flex;
  justify-content: center;
}

.content-wrapper {
  max-width: 48rem; /* 768px */
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Typography */
.main-title {
  font-size: 4.5rem;
  font-weight: 900;
  margin-bottom: 3rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-align: center;
}

.text-highlight {
  color: var(--primary);
  /* Gradient Text */
  background: linear-gradient(to right, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  padding: 0 0.2em;
  filter: drop-shadow(0 0 20px rgba(118, 74, 188, 0.3));
  animation: float 6s ease-in-out infinite;
}

.text-content {
  font-size: 1.25rem;
  color: var(--text-muted);
}

.text-content p {
  margin-bottom: 2rem;
  font-weight: 400;
}

.highlight-text {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  text-align: center;
  margin: 4rem 0;
  letter-spacing: -0.01em;
}

/* Code Block Modernization */
.code-block {
  background-color: #0b101b; /* Darker than bg */
  padding: 1.5rem;
  border-radius: 1rem; /* Rounded */
  border: 1px solid var(--surface-2);
  box-shadow: var(--shadow-card);
  overflow-x: auto;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
  font-size: 0.9em;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.code-block:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.code-block code {
  color: #e2e8f0;
  white-space: pre; /* Force horizontal scroll */
  display: block; /* Ensure it takes width */
}

/* keyword highlighting simulation */
.code-block code span.kw { color: #c084fc; } /* purple */
.code-block code span.fn { color: #60a5fa; } /* blue */
.code-block code span.obj { color: #f472b6; } /* pink */

/* Demo Box - Glassmorphism */
.demo-box {
  margin: 4rem 0;
  padding: 3rem;
  border-radius: 1.5rem;
  background: rgba(30, 41, 59, 0.7); /* translucent surface */
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Subtle gradient border effect via pseudo-element? simpler to just use border for now */

.demo-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.demo-title::after {
  content: " (Powered by Redux)";
  font-size: 0.8em;
  color: var(--primary);
  font-weight: 600;
  opacity: 0.8;
}

.demo-desc {
  font-size: 1rem;
  margin-bottom: 2rem;
  color: var(--text-muted);
}

.demo-controls {
  display: flex;
  align-items: center;
  gap: 2rem;
  justify-content: center;
  margin: 2rem 0;
  background: rgba(0,0,0,0.2);
  padding: 1.5rem;
  border-radius: 1rem;
  display: inline-flex; /* wrap content */
}

/* Smooth Buttons */
.btn {
  background-color: var(--primary);
  color: white;
  font-weight: 600;
  padding: 1rem 2rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(118, 74, 188, 0.5);
}

.btn:hover {
  background-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(118, 74, 188, 0.6);
}

.btn:active {
  transform: translateY(1px);
  filter: brightness(0.9);
}

.count-display {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--text-main);
  min-width: 3ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.count-display.bump {
  transform: scale(1.3);
  color: var(--accent); /* Flash pink on update */
}

.demo-note {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-style: italic;
  opacity: 0.6;
}

/* Alternatives List */
.alternatives-section {
  margin-top: 6rem;
  position: relative;
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 2rem;
  text-align: center;
}

.alternatives-list {
  list-style: none;
  padding: 0;
}

.alternatives-list li {
  padding: 1.5rem;
  margin-bottom: 1rem;
  background: var(--surface);
  border-radius: 0.75rem;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.alternatives-list li:hover {
  background: var(--surface-2);
  transform: translateX(10px);
  border-color: var(--primary);
}

.alternatives-list strong {
  color: var(--primary-light);
  font-size: 1.1em;
}

.final-statement {
  font-size: 3.5rem;
  font-weight: 900;
  text-align: center;
  background: linear-gradient(to right, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-top: 4rem;
  line-height: 1.1;
  padding: 0 1rem;
}

.footer {
  margin-top: 6rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--surface-2);
  padding-top: 2rem;
}

/* Animation Classes */
.fade-in-section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fade-in-section.is-visible {
  opacity: 1;
  transform: none;
}

/* Custom Scrollbar - Slim & Dark */
::-webkit-scrollbar {
  width: 12px;
  height: 12px; /* For horizontal scrollbars */
}
::-webkit-scrollbar-track {
  background: var(--bg);
  border-left: 1px solid var(--surface);
}
::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: 6px;
  border: 3px solid var(--bg); /* Spacing effect */
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
  border-color: var(--bg);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .main-title { font-size: 3rem; }
  .count-display { font-size: 3rem; }
  .final-statement { font-size: 2.5rem; }
  .app-container { padding: 2rem 1rem; }
  
  .demo-controls {
    flex-direction: row; /* keep row even on mobile for counter */
    gap: 1rem;
    padding: 1rem;
  }
  
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 1.25rem;
  }
}
