/* ============================================================
   homebase.page — Custom Styles
   Commercial landing page for Home Base.
   Supplements Tailwind CDN with animations, glassmorphism,
   gradient mesh, and scroll-driven storytelling.
   ============================================================ */

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

/* --- Root Variables --- */
:root {
  --bg-deep: #030712;
  --bg-surface: rgba(15, 23, 42, 0.45);
  --border-glow: rgba(99, 102, 241, 0.12);
  --border-glow-hover: rgba(99, 102, 241, 0.35);
  --indigo: #6366f1;
  --purple: #a855f7;
  --violet: #8b5cf6;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

code, .mono { font-family: 'JetBrains Mono', monospace; }

/* --- Gradient Text --- */
.gradient-text {
  background: linear-gradient(135deg, #c7d2fe 0%, #818cf8 30%, #a855f7 60%, #c084fc 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 8s ease-in-out infinite;
}

.gradient-text-subtle {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 50%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Hero Gradient Mesh --- */
.hero-mesh {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.hero-mesh .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float-orb 20s ease-in-out infinite;
}

.hero-mesh .orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.35), transparent 70%);
  top: -15%; right: -10%;
  animation-delay: 0s;
}

.hero-mesh .orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.25), transparent 70%);
  bottom: -20%; left: -5%;
  animation-delay: -7s;
}

.hero-mesh .orb-3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.2), transparent 70%);
  top: 40%; left: 30%;
  animation-delay: -14s;
}

/* --- Dot Grid --- */
.dot-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: radial-gradient(rgba(99, 102, 241, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 70% 50% at 50% 40%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 40%, black 20%, transparent 100%);
}

/* --- Glassmorphism --- */
.glass {
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glow);
  border-radius: 1rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass:hover {
  border-color: var(--border-glow-hover);
  box-shadow:
    0 8px 40px rgba(99, 102, 241, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transform: translateY(-3px);
}

/* --- Navbar --- */
.navbar {
  background: rgba(3, 7, 18, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(99, 102, 241, 0.06);
  transition: all 0.3s ease;
}

.navbar.scrolled {
  background: rgba(3, 7, 18, 0.92);
  border-bottom-color: rgba(99, 102, 241, 0.12);
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.08);
}

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  font-weight: 700;
  font-size: 0.9375rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover::before { opacity: 1; }

.btn-primary span,
.btn-primary svg { position: relative; z-index: 1; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: transparent;
  color: #c7d2fe;
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(99, 102, 241, 0.25);
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-outline:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateY(-2px);
}

/* --- Section Label --- */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.875rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #818cf8;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

/* --- Divider --- */
.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(99, 102, 241, 0.2), transparent);
  border: none;
  margin: 0;
}

/* --- Problem/Solution Table --- */
.comparison-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(99, 102, 241, 0.06);
  border-radius: 0.5rem;
  overflow: hidden;
}

.comparison-row > div {
  padding: 1.25rem 1.5rem;
  background: var(--bg-deep);
}

.comparison-row .problem {
  color: var(--text-muted);
  position: relative;
}

.comparison-row .problem::before {
  content: '✗';
  color: #ef4444;
  margin-right: 0.75rem;
  font-weight: 700;
}

.comparison-row .solution {
  color: var(--text-secondary);
  position: relative;
}

.comparison-row .solution::before {
  content: '✓';
  color: #22c55e;
  margin-right: 0.75rem;
  font-weight: 700;
}

/* --- Step Numbers --- */
.step-number {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.125rem;
  color: #818cf8;
  flex-shrink: 0;
}

/* --- Waitlist Form --- */
.waitlist-input {
  flex: 1;
  min-width: 0;
  padding: 0.875rem 1.25rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 0.75rem;
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

.waitlist-input::placeholder {
  color: var(--text-muted);
}

.waitlist-input:focus {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* --- Trust Badge --- */
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #cbd5e1;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.trust-badge:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.06);
}

/* --- Scroll Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
.reveal.d4 { transition-delay: 0.32s; }
.reveal.d5 { transition-delay: 0.4s; }

/* --- Keyframes --- */
@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes float-orb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -20px) scale(1.05); }
  50% { transform: translate(-20px, 15px) scale(0.95); }
  75% { transform: translate(15px, 25px) scale(1.02); }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce-subtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

.animate-in { animation: fade-in-up 0.7s ease-out forwards; }
.animate-bounce { animation: bounce-subtle 2.5s ease-in-out infinite; }

/* --- Mobile Menu --- */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 7, 18, 0.96);
  backdrop-filter: blur(24px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.mobile-menu.open { display: flex; }

.mobile-menu .nav-link {
  font-size: 1.25rem;
  padding: 0.75rem 2rem;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: rgba(99, 102, 241, 0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99, 102, 241, 0.4); }

/* --- Selection --- */
::selection { background: rgba(99, 102, 241, 0.35); color: white; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero-heading { font-size: 2.25rem !important; }
  .comparison-row { grid-template-columns: 1fr; }
  .btn-primary, .btn-outline {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero-heading { font-size: 1.875rem !important; }
}
