/* ==========================================================================
   1. SETUP & CONFIGURATION
   - Font Imports
   - Root Variables (Color Palette, Typography, Legacy)
   - Global Resets & Base Styles
   - Accessibility Settings
   ========================================================================== */

/* 1.1. Font Imports - Optimized for Performance */
/* cls optimization - font loading with display swap */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Lexend+Deca:wght@300;400;500;600;700&family=Sixtyfour+Convergence&display=swap');

/* 1.2. Root Variables */
:root {
  /* Reley Color Palette */
  --color-background: #070312;
  --color-primary: #E59AB2;
  --color-text: #e8dadf;

  /* Reley Typography - Scaled up for better visibility */
  --font-body: 'Lexend Deca', ui-sans-serif, system-ui, sans-serif;
  --font-header: 'Sixtyfour Convergence', 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  
  /* Base font size scaling */
  --base-font-scale: 1.25; /* 25% larger base font size */
  --heading-font-scale: 1.3; /* 30% larger headings */
  --button-font-scale: 1.2; /* 20% larger buttons */
  --button-scale: var(--button-font-scale); /* Alias for button scaling */

  /* Enhanced Background Theme */
  --bg1: #070312; /* deep dark background */
  --bg2: #0a0520; /* slightly lighter dark */
  --orb-pink: rgba(229, 154, 178, 0.12);
  --orb-purple: rgba(248, 187, 217, 0.08);
  --orb-ice: rgba(135, 206, 250, 0.06);

  /* Legacy & Utility Variables */
  --text-color: #e8dadf;
  --accent-color: #E59AB2;
  --border-color: rgba(229, 154, 178, 0.2);
}

/* 1.3. Global Resets & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  min-height: 100vh;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: calc(16px * var(--base-font-scale)); /* Scaled base font size */
  line-height: 1.6;
  background-color: var(--color-background); /* Solid fallback */
  background: linear-gradient(180deg, var(--color-background) 0%, transparent 12%),
              linear-gradient(135deg, var(--bg1) 0%, var(--bg2) 100%);
  display: flex;
  flex-direction: column;
  position: relative;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Global selection styling */
::selection {
  background: rgba(229, 154, 178, 0.35);
  color: #0a0520;
}
::-moz-selection {
  background: rgba(229, 154, 178, 0.35);
  color: #0a0520;
}

/* 1.4. Accessibility */
.seo-content {
  position: fixed;
  bottom: -100vh;
  left: 0;
  width: 100%;
  padding: 20px;
  background: rgba(30, 29, 43, 0.95);
  color: var(--text-color);
  font-size: calc(14px * var(--base-font-scale)); /* Scaled font size */
  line-height: 1.6;
  z-index: -1;
  opacity: 0.01;
  pointer-events: none;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Mobile performance optimizations */
@media (max-width: 768px) {
  /* Reduce animation complexity on mobile */
  .orb, .orb::before, .orb::after {
    animation-duration: 20s !important;
  }
  
  /* Simplify gradient animations */
  h1, h2#hero-title {
    animation: headerSlideDown 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 1.2s forwards;
  }
  
  /* Reduce blur effects */
  .glass-card {
    backdrop-filter: blur(5px) !important;
  }
}


/* ==========================================================================
   2. TYPOGRAPHY & BASE ELEMENTS
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-header);
  font-weight: 400;
  letter-spacing: 0.02em;
}

h1 {
  position: relative;
  z-index: 100;
  margin: 0.5em 0;
  font-family: 'Sixtyfour Convergence', 'Ubuntu', sans-serif;
  font-size: calc(1.6em * var(--heading-font-scale)); /* Scaled heading size */
  color: #e3f6ff; /* Fallback color */
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  isolation: isolate;

  /* Gradient Text Effect */
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--color-text) 100%, transparent) 0%,
    var(--color-primary) 50%,
    color-mix(in srgb, var(--color-text) 100%, transparent) 100%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;

  /* Animations */
  animation:
    headerSlideDown 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 1.2s forwards,
    softGradientShift 14s ease-in-out infinite;

  /* Performance */
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000;
  will-change: transform, opacity, background-position;
  contain: layout style paint;
}

h2#hero-title {
  position: relative;
  z-index: 100;
  margin: 0.5em 0;
  font-family: 'Sixtyfour Convergence', 'Ubuntu', sans-serif;
  font-size: calc(1.6em * var(--heading-font-scale)); /* Scaled heading size */
  color: #e3f6ff; /* Fallback color */
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  isolation: isolate;

  /* Gradient Text Effect */
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--color-text) 100%, transparent) 0%,
    var(--color-primary) 50%,
    color-mix(in srgb, var(--color-text) 100%, transparent) 100%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;

  /* Animations */
  animation:
    headerSlideDown 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 1.2s forwards,
    softGradientShift 14s ease-in-out infinite;

  /* Performance */
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000;
  will-change: transform, opacity, background-position;
  contain: layout style paint;
}

a {
  font-family: 'Ubuntu Mono', monospace;
  text-decoration: underline;
  color: #ffa6e2;
  font-size: calc(1em * var(--base-font-scale)); /* Scaled link text */
  transition: all 0.3s ease;
}

a:hover {
  color: #e3f6ff;
  text-shadow: 0 0 8px rgba(227, 246, 255, 0.3);
}

#stats-text {
  font-family: 'Ubuntu Mono', monospace;
  font-size: calc(0.8em * var(--base-font-scale)); /* Scaled stats text */
  color: #f4e3ff;
  margin: -1em 0;
  letter-spacing: -0.69px;
  opacity: 0;
  animation:
    scaleAndFade 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards,
    fadeSlideIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1.4s forwards;
  /* cls fix: reserve space for stats text */
  min-height: calc(1.2em * var(--base-font-scale));
  visibility: hidden;
  contain: layout style paint;
  will-change: opacity, visibility;
}

#hero-title {
  cursor: default;
  pointer-events: none;
}

#hero-title .face {
  display: inline-block;
  font-family: var(--font-header);
}

#hero-title .face.face-change {
  animation: facePop 220ms ease-in-out;
}


/* ==========================================================================
   3. LAYOUT & BACKGROUND
   ========================================================================== */

/* Animated layered background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px circle at 15% 12%, var(--orb-pink), transparent 75%),
    radial-gradient(900px circle at 82% 20%, var(--orb-purple), transparent 70%),
    radial-gradient(1000px circle at 25% 85%, var(--orb-ice), transparent 75%),
    linear-gradient(180deg, var(--color-background) 0%, transparent 18%),
    linear-gradient(135deg, var(--bg1) 0%, var(--bg2) 100%);
  background-repeat: no-repeat;
  background-size: 130% 130%, 125% 125%, 128% 128%, 100% 100%, 100% 100%;
  background-position: 0% 0%, 100% 20%, 10% 100%, 0% 0%, 0% 0%;
  filter: saturate(1.1) brightness(1.05);
  animation: bgDrift 28s ease-in-out infinite alternate;
  will-change: background-position, filter;
}

.container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  position: relative;
  z-index: 2;
  padding: 15px; /* Reduced padding for wider content */
  margin: 0;
  background: rgba(38, 20, 68, 0.192);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000;
  contain: layout style paint;
  min-height: 100vh;
  /* cls fix: prevent layout shifts during content loading */
  will-change: auto;
}

.content {
  text-align: center;
  padding: calc(35px * var(--base-font-scale)) calc(25px * var(--base-font-scale)); /* Scaled padding */
  margin: 0 15px; /* 15px margins from screen edges */
  background: rgba(55, 41, 85, 0.093);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 2px solid rgba(141, 109, 139, 0.208);
  box-shadow: 0 8px 32px rgba(19, 19, 19, 0.2), 0 0 48px rgba(227, 246, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  width: calc(100vw - 30px); /* Full width minus 15px margins on each side */
  max-width: none; /* Remove max-width constraint */
  min-height: calc(100vh - 50px);
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000;
  contain: layout style paint;
  /* cls fix: prevent layout shifts during content loading */
  will-change: auto;
}

.main-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: calc(15px * var(--base-font-scale)); /* Scaled gap */
  width: 100%;
  flex: 1;
  padding: calc(10px * var(--base-font-scale)) 0; /* Scaled padding */
}

#canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* cls optimization - modal space reservation */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  /* cls fix: prevent layout shifts when modal appears */
  contain: layout style paint;
  will-change: opacity;
}

.modal.show {
  opacity: 1;
}

.modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(30, 29, 43, 0.95);
  padding: 2rem;
  border-radius: 15px;
  border: 1px solid var(--border-color);
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  text-align: left;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  /* cls fix: prevent layout shifts during modal content loading */
  min-width: 300px;
  min-height: 200px;
  contain: layout style paint;
  z-index: 10001;
}

.modal-content h1,
.modal-content h2,
.modal-content h3,
.modal-content h4,
.modal-content h5,
.modal-content h6 {
  text-align: center;
  margin-bottom: 1rem;
  word-wrap: break-word;
}

.modal-content p,
.modal-content li {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  margin-bottom: 0.8rem;
}

.modal-content ul,
.modal-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.close-button {
  position: absolute;
  right: 15px;
  top: 15px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: var(--text-color);
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  padding: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  z-index: 10002;
}

.close-button:hover {
  background: rgba(229, 154, 178, 0.2);
  border-color: rgba(229, 154, 178, 0.4);
  transform: scale(1.1);
}

.close-button:active {
  transform: scale(0.95);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

/* Responsive modal adjustments */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-width: none;
    padding: 1.5rem;
    margin: 1rem;
    max-height: 85vh;
    font-size: 14px;
  }
  
  .close-button {
    right: 10px;
    top: 10px;
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .modal-content {
    width: 98%;
    padding: 1rem;
    margin: 0.5rem;
    max-height: 90vh;
    font-size: 13px;
  }
  
  .close-button {
    right: 8px;
    top: 8px;
    width: 28px;
    height: 28px;
    font-size: 16px;
  }
}

/* 4.6. Footer / Legal Links */
.legal-links {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  animation: fadeSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 3s forwards;
}

.legal-links a {
  color: rgba(232, 218, 223, 0.4);
  text-decoration: none;
  font-size: 0.5rem;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(7, 3, 18, 0.2);
  border: 1px solid rgba(139, 122, 214, 0.1);
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
  font-weight: 300;
  letter-spacing: 0.3px;
  text-transform: lowercase;
  position: relative;
  overflow: hidden;
  box-shadow: none;
}

.legal-links a::before {
    display: none;
}

.legal-links a::after {
    display: none;
}

.legal-links a:hover {
    transform: none;
    background: rgba(7, 3, 18, 0.3);
    border-color: rgba(139, 122, 214, 0.2);
    box-shadow: none;
    color: rgba(232, 218, 223, 0.6);
    letter-spacing: 0.3px;
    animation: none;
}

.legal-links a:hover::before {
    display: none;
}

.legal-links a:hover::after {
    display: none;
}

.legal-links a:active {
    transform: none;
    background: rgba(7, 3, 18, 0.4);
    box-shadow: none;
    transition: all 0.1s ease;
    animation: none;
}

.legal-links a:active::before {
    display: none;
}

.legal-links a:active::after {
    display: none;
}

.legal-links a:focus {
  outline: 1px solid rgba(139, 122, 214, 0.3);
  outline-offset: 1px;
}

/* 4.7. Notifications */
.notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  background: var(--accent-color);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  animation: fadeIn 0.3s ease-out;
}

/* 4.8. Warning Cards */
.warning-card {
  display: none;
  background: rgba(255, 99, 71, 0.1);
  border: 1px solid rgba(255, 99, 71, 0.3);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  color: #ffd0c9;
  animation: fadeIn 0.3s ease-in-out;
}

.warning-card.show {
  display: flex;
  align-items: center;
  gap: 12px;
}

.warning-card i {
  color: #ff6347;
  font-size: 1.2rem;
}

/* 4.9. Cards */
.card {
  background: rgba(30, 29, 43, 0.582);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(229, 154, 178, 0.22);
  box-shadow: none;
  transition: transform 0.2s ease, box-shadow 0.4s ease-in, border-color 0.2s ease-in;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(229, 154, 178, 0.4);
  box-shadow: 0 8px 32px rgba(229, 154, 178, 0.15);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(229, 154, 178, 0.1) 0%, transparent 50%);
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.card:hover::before {
  opacity: 1;
}

.card > * {
  position: relative;
  z-index: 2;
}

/* 4.10. Copy Button */

/* 4.11. Help Page Specific Styles */
body.help-page .card {
  position: relative;
  overflow: hidden;
}

body.help-page .card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(229, 154, 178, 0.15) 0%, transparent 60%);
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 1;
}

body.help-page .card:hover::before {
  opacity: 1;
  animation: subtleBloomPulse 2s ease-in-out infinite;
}

/* 4.12. Animations */
@keyframes subtleBloomPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.02);
    opacity: 1;
  }
}

@keyframes wiggle {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(1deg);
  }
  75% {
    transform: rotate(-1deg);
  }
}


/* ==========================================================================
   5. COMPONENT-SPECIFIC ANIMATIONS & STYLES
   ========================================================================== */

/* Card hover glow effect */
body.help-page .card {
  position: relative;
  overflow: hidden;
}
body.help-page .card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    360px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(255, 255, 255, 0.10) 0%,
    rgba(255, 255, 255, 0.06) 30%,
    rgba(255, 255, 255, 0.035) 55%,
    transparent 85%
  );
  transition: opacity 0.3s ease-in-out;
  will-change: background, opacity;
  transform: translate3d(0,0,0);
}
body.help-page .card:hover::before {
  opacity: 1;
}

/* Button Icon Animations */
.invite-btn:hover .robot-eyes { transform: scaleY(1); }
.invite-btn .robot-eyes {
  transform-origin: 50% 50%;
  transform: scaleY(0.06);
  transition: transform 0.2s ease-out;
  will-change: transform;
}

.cmds-btn:hover #terminal-cursor {
  animation: terminalCursorBlink 0.8s steps(2, start) infinite;
  will-change: opacity;
}

.docs-btn:hover .bookmark {
  transform: translateY(4px) scaleY(1.5) !important;
}
.docs-btn .bookmark {
  transform-origin: top center;
  transition: transform 0.3s ease-out;
}

.survey-btn:hover .ridges .ridge:nth-child(1) { transform: scaleX(1.05); opacity: 1; transition-delay: 0ms; }
.survey-btn:hover .ridges .ridge:nth-child(2) { transform: scaleX(1.10); opacity: 1; transition-delay: 60ms; }
.survey-btn:hover .ridges .ridge:nth-child(3) { transform: scaleX(1.15); opacity: 1; transition-delay: 120ms; }
.survey-btn .ridges .ridge {
  transform-origin: left center;
  transform: scaleX(0.9);
  opacity: 0.75;
  transition: transform 0.24s ease, opacity 0.24s ease;
  will-change: transform, opacity;
}

.vote-btn:hover .star-shape {
  animation: starPulse 1.5s ease-in-out infinite;
}
.vote-btn .star-shape { will-change: transform, filter, opacity; }

.support-btn:hover svg { animation: wiggle 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 1 both; }
.support-btn svg { will-change: transform; }
.support-btn:hover .notif-dot { animation: dotPulse 1.2s ease-in-out 1 both; will-change: transform, opacity; }

.user-install-btn:hover .user-silhouette path { fill: #e8dadf; stroke-width: 3.5; }
.user-install-btn .user-silhouette path {
  fill: #ad98b0;
  stroke-width: 2.5;
  transition: fill 0.4s ease, stroke-width 0.2s ease;
}
.user-install-btn:hover .silhouette-stop1 { stop-color: #e8dadf; }
.user-install-btn:hover .silhouette-stop2 { stop-color: #E59AB2; }


/* ==========================================================================
   6. GLOBAL ANIMATIONS & KEYFRAMES
   ========================================================================== */

/* 6.1. Page Load Animations */
.button-row .btn { 
  opacity: 0; 
  visibility: visible; /* Override critical CSS hiding */
}
.button-group {
  display: flex;
  flex-direction: column;
  gap: calc(8px * var(--base-font-scale));
  width: 100%;
  max-width: calc(800px * var(--base-font-scale));
  margin: calc(20px * var(--base-font-scale)) auto 0;
  padding: 0 calc(10px * var(--base-font-scale));
  opacity: 1; /* Override critical CSS hiding */
  visibility: visible; /* Override critical CSS hiding */
}

.button-row {
  display: flex;
  justify-content: center;
  gap: calc(8px * var(--base-font-scale));
  flex-wrap: wrap;
  align-items: stretch;
  opacity: 1; /* Override critical CSS hiding */
  visibility: visible; /* Override critical CSS hiding */
}
#stats-text {
  visibility: visible; /* Override critical CSS hiding */
}
.button-row:nth-child(1) .btn:nth-child(1) { animation: floatIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards; }
.button-row:nth-child(1) .btn:nth-child(2) { animation: floatIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s forwards; }
.button-row:nth-child(1) .btn:nth-child(3) { animation: floatIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s forwards; }
.button-row:nth-child(1) .btn:nth-child(4) { animation: floatIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s forwards; }
.button-row:nth-child(2) .btn:nth-child(1) { animation: floatIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.7s forwards; }
.button-row:nth-child(2) .btn:nth-child(2) { animation: floatIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.8s forwards; }
.button-row:nth-child(2) .btn:nth-child(3) { animation: floatIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.9s forwards; }

/* 6.2. Keyframe Definitions */
@keyframes bgDrift {
  0%   { background-position: 0% 0%, 100% 20%, 10% 100%, 0% 0%, 0% 0%; filter: saturate(1.08) brightness(1.02); }
  33%  { background-position: 15% 8%, 88% 18%, 18% 88%, 0% 0%, 0% 0%; filter: saturate(1.12) brightness(1.06); }
  66%  { background-position: 25% 15%, 75% 22%, 22% 75%, 0% 0%, 0% 0%; filter: saturate(1.10) brightness(1.04); }
  100% { background-position: 30% 18%, 70% 25%, 25% 70%, 0% 0%, 0% 0%; filter: saturate(1.08) brightness(1.02); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes headerSlideDown { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes floatIn { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeSlideIn { from { transform: translateX(-20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeUpIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes scaleAndFade {
  0%   { transform: scale(0.85) translateY(-20px); opacity: 0; }
  50%  { transform: scale(1.1) translateY(0); opacity: 0.7; }
  75%  { transform: scale(0.95) translateY(0); opacity: 0.9; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes softGradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes facePop { 0% { transform: scale(1); } 50% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes terminalCursorBlink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
@keyframes wiggle {
  0%   { transform: rotate(0deg) translateY(0); }
  25%  { transform: rotate(-3deg) translateY(-1px); }
  50%  { transform: rotate(0deg) translateY(0); }
  75%  { transform: rotate(3deg) translateY(-1px); }
  100% { transform: rotate(0deg) translateY(0); }
}
@keyframes starPulse { 0%, 100% { opacity: 0.8; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes dotPulse { 0% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.4); opacity: 1; } 100% { transform: scale(1); opacity: 0.8; } }


/* ==========================================================================
   7. VENDOR & MISC
   - Custom Scrollbar
   - Third-Party Library Styles
   - Miscellaneous States
   ========================================================================== */

/* 7.1. Custom Scrollbar */
/* Hide default scrollbar */
body::-webkit-scrollbar {
  width: 0;
  background: transparent;
}

/* Custom scrollbar overlay */
.custom-scrollbar {
  position: fixed;
  right: 4px;
  top: 10px;
  width: 6px;
  height: calc(100vh - 20px);
  pointer-events: auto;
  z-index: 10000;
  transform: translateX(0);
  opacity: 1;
  transition: none;
}

.custom-scrollbar.hidden {
  animation: scrollbarHide 0.4s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.custom-scrollbar:not(.hidden) {
  animation: scrollbarShow 0.4s cubic-bezier(0, 0, 0.2, 1) forwards;
}

@keyframes scrollbarHide {
  0% {
    transform: translateX(0);
    opacity: 1;
  }
  100% {
    transform: translateX(10px);
    opacity: 0;
  }
}

@keyframes scrollbarShow {
  0% {
    transform: translateX(10px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.scrollbar-track {
  position: absolute;
  width: 100%;
  height: 100%;
  background: transparent;
  border-radius: 3px;
}

.scrollbar-thumb {
  position: absolute;
  width: 100%;
  border-radius: 3px;
  background: #E59AB2;
  opacity: 0.7;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 20px rgba(229, 154, 178, 0.5),
              0 0 40px rgba(229, 154, 178, 0.3);
  transition: border-radius 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
              opacity 0.3s ease;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.scrollbar-thumb:active {
  cursor: grabbing;
}

.custom-scrollbar:hover .scrollbar-thumb {
  border-radius: 5px;
  opacity: 0.8;
}

body.scrollbar-dragging {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
}

/* 7.2. Third-Party Styles (e.g., oneko.js) */
#oneko {
  z-index: 2147483647; /* Max z-index */
  pointer-events: none;
}

/* 7.3. Miscellaneous Interactive States */
.copy-button:active {
  transform: scale(0.92) translateY(2px);
}


/* ==========================================================================
   BUTTON STYLES & ANIMATIONS
   ========================================================================== */

/* Base Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    min-height: 36px;
    min-width: 120px;
    max-width: 220px;
    flex: 0 1 auto;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    color: var(--text-color);
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(232, 218, 223, 0.08);
    border: 1px solid rgba(232, 218, 223, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform: translateZ(0);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 1. General Button Hover Effects (Lift, Glow, and Shine) */
.btn:hover {
  background: rgba(232, 218, 223, 0.15);
  border-color: rgba(232, 218, 223, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15),
              0 0 20px rgba(232, 218, 223, 0.1);
}

/* Shine effect on hover */
.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}


/* 2. Specific Icon Animations on Hover */
.invite-btn .robot-eyes {
  transform-origin: 50% 50%;
  transform: scaleY(0.06);
  transition: transform 0.2s ease-out;
  will-change: transform;
}
.invite-btn:hover .robot-eyes {
  transform: scaleY(1);
}

.cmds-btn:hover #terminal-cursor {
  animation: terminalCursorBlink 0.8s steps(2, start) infinite;
  will-change: opacity;
}

.docs-btn #docs-bookmark {
  transform-origin: top center;
  transition: transform 0.3s ease-out;
  will-change: transform;
}
.docs-btn:hover #docs-bookmark {
  transform: translateY(4px) scaleY(1.5);
}

.survey-btn .ridges .ridge {
  transform-origin: left center;
  transform: scaleX(0.9);
  opacity: 0.75;
  transition: transform 0.24s ease, opacity 0.24s ease;
  will-change: transform, opacity;
}
.survey-btn:hover .ridges .ridge:nth-child(1) { transform: scaleX(1.05); opacity: 1; transition-delay: 0ms; }
.survey-btn:hover .ridges .ridge:nth-child(2) { transform: scaleX(1.10); opacity: 1; transition-delay: 60ms; }
.survey-btn:hover .ridges .ridge:nth-child(3) { transform: scaleX(1.15); opacity: 1; transition-delay: 120ms; }

.vote-btn .star-shape {
  will-change: transform, filter, opacity;
}
.vote-btn:hover .star-shape {
  animation: starPulse 1.5s ease-in-out infinite;
}

.support-btn svg {
  will-change: transform;
}
.support-btn:hover svg {
  animation: wiggle 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 1 both;
}
.support-btn:hover .notification-dot {
  animation: dotPulse 1.2s ease-in-out 1 both;
  will-change: transform, opacity;
}

.user-install-btn svg path {
  transition: fill 0.4s ease, stroke-width 0.2s ease;
}
.user-install-btn:hover svg path {
  fill: #e8dadf;
  stroke-width: 3.5;
}


/* 3. Required Animation Keyframes */
@keyframes terminalCursorBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

@keyframes starPulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes wiggle {
  0%   { transform: rotate(0deg) translateY(0); }
  25%  { transform: rotate(-3deg) translateY(-1px); }
  50%  { transform: rotate(0deg) translateY(0); }
  75%  { transform: rotate(3deg) translateY(-1px); }
  100% { transform: rotate(0deg) translateY(0); }
}

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

/* ==========================================================================
   7. VISIBILITY & ENTRANCE ANIMATIONS
   ========================================================================== */

/* Stats text appears first */
#stats-text {
  opacity: 0;
  visibility: hidden;
  animation: fadeUpIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s forwards;
}

/* Header animations */
h1, h2#hero-title {
  opacity: 0;
  visibility: hidden;
  animation: headerSlideDown 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.4s forwards,
             softGradientShift 2s ease-in-out 0.8s infinite alternate;
}

/* Button group animations with staggered delays */
.button-group {
  opacity: 0;
  visibility: hidden;
  animation: fadeSlideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.6s forwards;
}

.button-row:nth-child(1) {
  animation-delay: 0.8s;
}

.button-row:nth-child(2) {
  animation-delay: 1.0s;
}

.button-row {
  opacity: 0;
  visibility: hidden;
  animation: fadeSlideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Individual button animations */
.btn {
  opacity: 0;
  visibility: hidden;
  animation: scaleAndFade 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.button-row:nth-child(1) .btn:nth-child(1) { animation-delay: 1.0s; }
.button-row:nth-child(1) .btn:nth-child(2) { animation-delay: 1.1s; }
.button-row:nth-child(1) .btn:nth-child(3) { animation-delay: 1.2s; }
.button-row:nth-child(1) .btn:nth-child(4) { animation-delay: 1.3s; }

.button-row:nth-child(2) .btn:nth-child(1) { animation-delay: 1.4s; }
.button-row:nth-child(2) .btn:nth-child(2) { animation-delay: 1.5s; }
.button-row:nth-child(2) .btn:nth-child(3) { animation-delay: 1.6s; }

/* Legal links appear last */
.legal-links {
  opacity: 0;
  visibility: hidden;
  animation: fadeSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1.8s forwards;
}

/* Animation keyframes */
@keyframes headerSlideDown {
  0% {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-30px) scale(0.95);
  }
  100% {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeSlideUp {
  0% {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

@keyframes fadeUpIn {
  0% {
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
  }
  100% {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

@keyframes scaleAndFade {
  0% {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
  }
}

@keyframes fadeSlideIn {
  0% {
    opacity: 0;
    visibility: hidden;
  }
  100% {
    opacity: 1;
    visibility: visible;
  }
}

@keyframes softGradientShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* ==========================================================================
   8. RESPONSIVE DESIGN (Media Queries)
   ========================================================================== */

/* 8.1. Tablet & Smaller Devices (max-width: 768px) */
@media (max-width: 768px) {
  /* Layout & Content */
  .container {
    padding: 8px;
  }
  .content {
    padding: 15px;
    margin: 0;
    border-radius: 12px;
    height: auto;
    min-height: calc(100vh - 30px);
    overflow-y: auto;
  }
  .main-content {
    padding: 8px 0;
    gap: 12px;
  }

  /* Navigation */
  .nav-bar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    background: rgba(30, 29, 43, 0.6);
    padding: 10px 12px;
    border-radius: 0;
    border: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .nav-link {
    flex: 1;
    text-align: center;
    padding: calc(8px * var(--base-font-scale)) calc(10px * var(--base-font-scale));
    font-size: calc(0.95rem * var(--base-font-scale));
  }

  /* Buttons */
  .button-group {
    margin: 12px auto;
    padding: 0 8px;
    max-width: 100%;
    gap: 8px;
  }
  .button-row {
    gap: 8px;
    margin-bottom: 0;
  }
  .btn {
    min-width: calc(140px * var(--button-scale));
    max-width: none;
    flex: 1 1 calc(50% - 8px);
    padding: calc(10px * var(--button-scale)) calc(14px * var(--button-scale));
    font-size: calc(0.9rem * var(--button-scale));
    height: calc(44px * var(--button-scale));
    border-radius: calc(10px * var(--button-scale));
  }
  .btn svg {
    width: calc(18px * var(--button-scale));
    height: calc(18px * var(--button-scale));
    flex-shrink: 0;
  }

  /* Elements */
  .avi {
    width: calc(120px * var(--base-font-scale));
    margin-bottom: calc(4px * var(--base-font-scale));
  }
  #stats-text {
    font-size: calc(0.9em * var(--base-font-scale));
    letter-spacing: -1px;
    margin: -1em 0;
  }

  /* Footer */
  .legal-links {
    padding: calc(8px * var(--base-font-scale));
    gap: calc(15px * var(--base-font-scale));
  }
  .legal-links a {
    font-size: calc(0.85rem * var(--base-font-scale));
    padding: calc(5px * var(--base-font-scale)) calc(10px * var(--base-font-scale));
  }
}

/* 8.2. Short Screens (max-height: 600px) */
@media (max-height: 600px) {
  .content {
    padding: 20px 10px;
  }
  .main-content {
    padding: 10px 0;
  }
}

/* ================================
   Help Page Specific Styles
   ================================ */
.intro-text {
  margin-bottom: 1.5rem;
  font-size: clamp(0.9rem, 2vw, 1rem);
}

.prefix {
  display: inline-block;
  background: rgba(30, 29, 43, 0.452);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.search-container {
  margin-bottom: 1.5rem;
  position: relative;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.search-bar {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(7, 3, 18, 0.6);
  border: 1px solid rgba(139, 122, 214, 0.3);
  border-radius: 12px;
  color: var(--text-color);
  font-size: 0.95rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-bar:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(139, 122, 214, 0.1), 0 4px 12px rgba(0, 0, 0, 0.15);
  background: rgba(7, 3, 18, 0.8);
}

.search-bar::placeholder {
  color: rgba(232, 218, 223, 0.5);
  font-style: italic;
}

.filter-container {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 1.5rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.filter-button {
  padding: 0.6rem 1.2rem;
  background: rgba(7, 3, 18, 0.3);
  border: 1px solid rgba(139, 122, 214, 0.2);
  border-radius: 25px;
  color: rgba(232, 218, 223, 0.7);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  text-transform: capitalize;
}

.filter-button:hover {
  background: rgba(139, 122, 214, 0.1);
  border-color: rgba(139, 122, 214, 0.3);
  color: rgba(232, 218, 223, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(139, 122, 214, 0.08);
}

.filter-button.active {
  background: linear-gradient(135deg, rgba(139, 122, 214, 0.15), rgba(229, 154, 178, 0.1));
  border-color: rgba(139, 122, 214, 0.4);
  color: var(--accent-color);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(139, 122, 214, 0.15);
}

.command-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  transition: all 0.3s ease;
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}

.command-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.category-tag {
  font-size: 0.65rem;
  color: var(--accent-color);
  opacity: 0.6;
  margin-top: -0.25rem;
  margin-bottom: 0.5rem;
  display: block;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.command-name {
  font-size: 1.1rem;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  line-height: 1.2;
  font-weight: 600;
}

.slash-indicator {
  font-size: 0.9rem;
  color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  cursor: help;
  transition: all 0.2s ease;
}

.slash-indicator:hover {
  background: rgba(255, 215, 0, 0.2);
  border-color: rgba(255, 215, 0, 0.5);
  box-shadow:
    0 0 10px rgba(255, 215, 0, 0.25),
    0 0 20px rgba(255, 215, 0, 0.15);
  animation: softGlowPulse 1.6s ease-in-out infinite;
}

.slash-indicator:active {
  transform: translateY(2px) scale(0.95);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
}

.vote-buttons {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.vote-button {
  background: rgba(139, 122, 214, 0.1);
  border: 1px solid transparent;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease-out;
  position: relative;
  overflow: hidden;
}

.vote-button.active,
.vote-button[data-active="true"] {
  background: var(--accent-color);
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(139, 122, 214, 0.3);
}

.vote-button:hover {
  transform: none;
}

.vote-count {
  font-size: 0.9rem;
  color: var(--text-color);
}

/* Generic interactive elements baseline */
.home-button, .filter-button {
  border: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.home-button:hover, .filter-button:hover {
  border-color: rgba(229, 154, 178, 0.4);
  box-shadow:
    0 0 10px rgba(229, 154, 178, 0.25),
    0 0 20px rgba(229, 154, 178, 0.15);
  animation: softGlowPulse 1.6s ease-in-out infinite;
}

/* Press/Click effect applied broadly */
.nav-link:active, .vote-button:active, .copy-button:active, .card:active, .filter-button:active, .home-button:active {
  transform: translateY(2px) scale(0.95);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
}

.description {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.4;
  color: rgba(232, 218, 223, 0.85);
}

.aliases {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.alias-tag {
  background: rgba(139, 122, 214, 0.15);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  color: rgba(232, 218, 223, 0.9);
  border: 1px solid rgba(139, 122, 214, 0.2);
  display: inline-block;
  margin-bottom: 0.5rem;
}

.command-details {
  border-top: 1px solid var(--border-color);
  font-size: 0.95rem;
  word-wrap: break-word;
}

.command-details .detail-item {
  word-wrap: break-word;
  white-space: normal;
}

.detail-item {
  margin-bottom: 0.5rem;
}

.detail-label {
  font-weight: bold;
  color: var(--accent-color);
}

/* Help Page Mobile Optimizations */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  .search-container {
    padding: 0.8rem;
  }

  .filter-button {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .card {
    padding: 1rem;
  }
}

/* Help Page Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card.initial-load {
  animation: fadeIn 0.3s ease-out;
}

/* Filter animation utility classes */
.card-hiding {
  opacity: 0 !important;
  transform: translateY(2px) scale(0.98) !important;
  pointer-events: none;
  transform-origin: 50% 50%;
  transition: opacity 0.2s ease, transform 0.2s ease;
  will-change: opacity, transform;
}

.card-showing {
  opacity: 0;
  transform: translateY(2px) scale(0.98);
  transform-origin: 50% 50%;
}

/* Absolute overlay for leaving cards to avoid layout reflow jitters */

.card-visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Performance hints: keep card animations on the compositor */
body.help-page .card {
  will-change: transform, opacity;
  contain: paint;
  transform: translateZ(0);
}

/* Help page typography and spacing optimizations */
body.help-page {
  font-size: 0.95rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

body.help-page h1 {
  font-size: 2.2rem;
  line-height: 1.2;
  margin-bottom: 1rem;
  font-weight: 700;
  text-align: center;
}

body.help-page h2 {
  font-size: 1.4rem;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

body.help-page p {
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

/* Improved card spacing and typography */
.card {
  padding: 1rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.card h3 {
  font-size: 1.1rem;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* Better spacing for help page sections */

body.help-page::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

body.help-page::-webkit-scrollbar-track {
  background: rgba(7, 3, 18, 0.3);
  border-radius: 3px;
}

body.help-page::-webkit-scrollbar-thumb {
  border-radius: 3px;
  transition: background 0.2s ease;
  background: linear-gradient(to bottom,
    rgba(229, 154, 178, 0.6) 0%,
    rgba(229, 154, 178, calc(0.6 + var(--scroll-darkness, 0) * 0.4)) 100%
  );
}

/* Enhanced responsive grid layout */
@media (max-width: 1200px) {
  .command-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.8rem;
  }
}

@media (max-width: 768px) {
  .command-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    padding: 0 0.5rem;
  }
  
  .search-container {
    margin-bottom: 1rem;
    padding: 0 0.5rem;
  }
  
  .filter-container {
    margin-bottom: 1rem;
    gap: 0.4rem;
    padding: 0 0.5rem;
  }
  
  .filter-button {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
}

@media (max-width: 480px) {
  .command-grid {
    padding: 0 0.25rem;
  }
  
  .command-name {
    font-size: 1rem;
  }
  
  .description {
    font-size: 0.85rem;
  }
  
  body.help-page h1 {
    font-size: 1.8rem;
  }
}

/* cls optimization - face animation elements */
.face-change {
  /* cls fix: prevent layout shifts during face animation */
  contain: layout style paint;
  will-change: opacity;
}

/* cls optimization - enhanced card animation states */
.card-hiding,
.card-showing,
.card-visible {
  /* cls fix: prevent layout shifts during card animations */
  contain: layout style paint;
}

/* cls optimization - filter buttons */
.filter-button {
  /* cls fix: prevent layout shifts when toggling active state */
  contain: layout style paint;
  will-change: background-color, border-color;
  box-sizing: border-box;
}

/* cls optimization - warning message */
#warning-message {
  /* cls fix: reserve space for warning message */
  min-height: 60px;
  contain: layout style paint;
  will-change: opacity, transform;
}

#warning-message.show {
  /* ensure consistent layout when shown */
  display: flex;
  align-items: center;
}

/* cls optimization - animation elements in animations.js */
.signal-bar {
  /* cls fix: prevent layout shifts during signal animation */
  contain: layout style paint;
  will-change: opacity;
}