/* ================= VARIABLES ================= */
:root {
  /* Core Colors - "Midnight Glass" Theme */
  --bg-deep: #030407;
  --text-main: #ffffff;
  --text-muted: #94a3b8;
  
  /* Accents */
  --accent-primary: #6366f1; /* Indigo */
  --accent-glow: #818cf8;
  --accent-secondary: #06b6d4; /* Cyan */
  
  /* Glassmorphism Layers */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.15);
  
  /* Spacing */
  --radius-lg: 24px;
  --radius-md: 16px;
}

/* ================= RESET ================= */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent; /* Removes blue highlight on mobile tap */
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  /* Smooth text rendering on mobile */
  -webkit-font-smoothing: antialiased;
}

/* ================= BACKGROUND ================= */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg-deep);
  /* More complex, subtle gradient mesh */
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 85% 30%, rgba(6, 182, 212, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 50% 90%, rgba(124, 58, 237, 0.1) 0%, transparent 60%);
}

/* ================= ANIMATIONS ================= */
.fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1); /* Apple-style ease */
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ================= BRAND (Universal) ================= */
.brand, .brand-mini {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 20px 40px; /* Reduced top padding for mobile aesthetic */
}

.brand img, .brand-mini img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.brand h1, .brand-mini h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ================= GLASS CARDS (Shared Style) ================= */
.card, .features-card, .users-box {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px); /* Safari support */
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Mobile Touch Feedback */
.card:active, .features-card:active, .open-btn:active {
  transform: scale(0.97);
}

/* ================= HOME GRID ================= */
.card-grid {
  max-width: 1100px;
  margin: auto;
  display: grid;
  gap: 20px; /* Tighter gap for mobile */
  padding: 0 20px 120px; /* Huge bottom padding for safe scrolling */
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
}

.logo-wrap {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 20px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.logo-wrap img {
  max-width: 65%;
  max-height: 65%;
}

/* ================= FEATURES PAGE ================= */
.features-layout {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 20px 140px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.users-box {
  width: 100%;
  padding: 24px;
  display: flex;
  flex-direction: row; /* Horizontal on mobile fits better */
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.users-box .count {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  text-shadow: 0 0 20px var(--accent-primary);
}

.users-box .label {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.features-card {
  padding: 28px;
}

.features-card h2 {
  margin: 0 0 20px 0;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--accent-glow);
}

.features-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}

.features-card li {
  font-size: 1rem;
  line-height: 1.5;
  color: #d1d5db;
  display: flex;
  gap: 12px;
}

.features-card li::before {
  content: "✓";
  color: var(--accent-secondary);
  font-weight: bold;
}

/* ================= FLOATING ACTION BUTTON ================= */
.open-btn {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 24px;
  /* Handle iPhone Home Bar */
  bottom: calc(24px + env(safe-area-inset-bottom));
  
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 100;
  
  transition: transform 0.15s ease;
}

/* ================= DESKTOP TWEAKS ================= */
@media (min-width: 768px) {
  .features-layout {
    margin-top: 80px;
    display: grid;
    grid-template-columns: 1fr 280px; /* Sidebar layout */
    align-items: start;
  }
  
  .users-box {
    flex-direction: column;
    text-align: center;
    padding: 40px 20px;
    height: auto;
    position: sticky;
    top: 40px;
  }
  
  .open-btn {
    width: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    padding: 16px 48px;
    border-radius: 99px;
    bottom: 40px;
  }
  
  .open-btn:hover {
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.6);
    transform: translateX(-50%) translateY(-2px);
  }
}
