/* ==========================================================================
   Habitz.space - Design System & Stylesheet
   Theme: High-End Dark Mode (#0B0F19 background, silver text, glassmorphism)
   ========================================================================== */

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

:root {
  /* Color Palette */
  --bg-dark: #0B0F19;
  --bg-card: rgba(17, 24, 39, 0.65);
  --bg-card-hover: rgba(30, 41, 59, 0.75);
  --bg-glass-pill: rgba(255, 255, 255, 0.05);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.2);
  --border-accent-emerald: rgba(16, 185, 129, 0.4);
  --border-accent-cyan: rgba(6, 182, 212, 0.4);
  
  --text-main: #F1F5F9;
  --text-silver: #CBD5E1;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  /* Brand Accents */
  --accent-emerald: #10B981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);
  --accent-cyan: #06B6D4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.25);
  --accent-violet: #8B5CF6;
  --accent-amber: #F59E0B;
  
  /* Fonts */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Transitions */
  --tr-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --tr-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset & Smooth Scroll */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Glow Background Orbs */
body::before,
body::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  pointer-events: none;
}

body::before {
  top: -100px;
  left: 15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, rgba(6, 182, 212, 0.05) 50%, transparent 80%);
  animation: floatOrb 18s ease-in-out infinite alternate;
}

body::after {
  top: 600px;
  right: 10%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, rgba(6, 182, 212, 0.06) 50%, transparent 80%);
  animation: floatOrb 22s ease-in-out infinite alternate-reverse;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.1); }
  100% { transform: translate(-30px, 40px) scale(0.95); }
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Glassmorphism Panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  transition: all var(--tr-smooth);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
}

.glass-panel:hover {
  border-color: var(--border-hover);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

/* Header & Navigation */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  transition: background var(--tr-fast);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #10B981 0%, #06B6D4 100%);
  color: #0B0F19;
  font-weight: 900;
  font-size: 1rem;
  box-shadow: 0 0 15px var(--accent-emerald-glow);
}

.logo span.space {
  color: var(--accent-cyan);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  color: var(--text-silver);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color var(--tr-fast);
}

.nav-link:hover {
  color: #FFFFFF;
}

/* Typography & Headings */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--text-main);
  line-height: 1.2;
}

.gradient-text {
  background: linear-gradient(135deg, #FFFFFF 0%, #E2E8F0 50%, #94A3B8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-emerald {
  background: linear-gradient(135deg, #FFFFFF 0%, #34D399 50%, #10B981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-cyan {
  background: linear-gradient(135deg, #FFFFFF 0%, #38BDF8 50%, #06B6D4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Buttons & CTAs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.75rem;
  border-radius: 12px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--tr-smooth);
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #031D14;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35);
  font-weight: 700;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.5);
  background: linear-gradient(135deg, #34D399 0%, #10B981 100%);
}

.btn-secondary {
  background: var(--bg-glass-pill);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

.btn-cyan {
  background: linear-gradient(135deg, #06B6D4 0%, #0891B2 100%);
  color: #022630;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.35);
  font-weight: 700;
}

.btn-cyan:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(6, 182, 212, 0.5);
  background: linear-gradient(135deg, #38BDF8 0%, #06B6D4 100%);
}

/* 1. HERO SECTION */
.hero-section {
  padding: 6rem 0 4rem;
  text-align: center;
  position: relative;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 100px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--accent-emerald);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hero-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulseDot 2s infinite;
}

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

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto 2.5rem;
  font-weight: 400;
  line-height: 1.7;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

/* 2. THE DUAL-PRODUCT SHOWCASE */
.showcase-section {
  padding: 4rem 0 6rem;
}

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

.grid-dual {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2.5rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: background var(--tr-smooth);
}

.product-card-core::before {
  background: linear-gradient(90deg, var(--accent-emerald), transparent);
}

.product-card-quit::before {
  background: linear-gradient(90deg, var(--accent-cyan), transparent);
}

.card-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  margin-bottom: 1.25rem;
  width: fit-content;
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-cyan {
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.card-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.card-tagline {
  font-size: 1.05rem;
  color: var(--text-silver);
  font-weight: 600;
  margin-bottom: 1rem;
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.98rem;
  margin-bottom: 2rem;
  line-height: 1.65;
}

/* GitHub Contribution Grid Preview Widget */
.widget-grid-container {
  background: rgba(11, 15, 25, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.grid-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.score-badge {
  color: var(--accent-emerald);
  font-weight: 700;
  background: rgba(16, 185, 129, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}

.habit-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 5px;
}

.habit-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.habit-square {
  aspect-ratio: 1;
  border-radius: 3px;
  background-color: #1E293B;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease;
}

.habit-square:hover {
  transform: scale(1.3);
  z-index: 5;
}

.habit-square.lvl-0 { background-color: #1E293B; }
.habit-square.lvl-1 { background-color: #064E3B; }
.habit-square.lvl-2 { background-color: #047857; }
.habit-square.lvl-3 { background-color: #10B981; }
.habit-square.lvl-4 { background-color: #34D399; box-shadow: 0 0 8px rgba(52, 211, 153, 0.5); }

/* Science-Backed Feature Matrix for Card B */
.quit-features-widget {
  background: rgba(11, 15, 25, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.feature-mini-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 0.85rem;
  text-align: left;
}

.mini-card-val {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.mini-card-lbl {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

.emergency-btn-preview {
  grid-column: span 2;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #FCA5A5;
  padding: 0.6rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.pulse-red {
  width: 8px;
  height: 8px;
  background: #EF4444;
  border-radius: 50%;
  animation: pulseRed 1.5s infinite;
}

@keyframes pulseRed {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* 3. PRIVACY & TRANSPARENCY BANNER */
.privacy-section {
  padding: 2rem 0 5rem;
}

.privacy-banner {
  padding: 2.25rem 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: radial-gradient(circle at top left, rgba(16, 185, 129, 0.05), transparent 70%),
              radial-gradient(circle at bottom right, rgba(6, 182, 212, 0.05), transparent 70%),
              var(--bg-card);
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.privacy-icon {
  font-size: 2.2rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.85rem;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.privacy-content h3 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.privacy-content p {
  color: var(--text-silver);
  font-size: 1rem;
  line-height: 1.65;
}

/* 4. DYNAMIC INSTALLATION GUIDE */
.install-section {
  padding: 3rem 0 6rem;
}

.device-bar {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.device-tab {
  padding: 0.65rem 1.4rem;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--tr-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.device-tab:hover {
  border-color: var(--border-hover);
  color: var(--text-main);
}

.device-tab.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(6, 182, 212, 0.15) 100%);
  border-color: var(--accent-emerald);
  color: #FFFFFF;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.detected-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  background: var(--accent-emerald);
  color: #031D14;
  font-weight: 700;
  margin-left: 0.3rem;
  text-transform: uppercase;
}

.install-card-wrapper {
  max-width: 800px;
  margin: 0 auto;
}

.install-card {
  display: none;
  padding: 3rem;
  animation: fadeIn 0.4s ease-out;
}

.install-card.active {
  display: block;
}

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

.install-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.75rem;
  margin-top: 2rem;
}

.step-item {
  background: rgba(11, 15, 25, 0.6);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: 14px;
  position: relative;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.step-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.step-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
  background: rgba(7, 10, 18, 0.9);
  color: var(--text-dim);
  font-size: 0.9rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--tr-fast);
}

.footer-links a:hover {
  color: var(--text-main);
}

/* Modal for Habitz Core Checklist Preview */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 100%;
  max-width: 650px;
  background: #0F172A;
  border: 1px solid var(--border-hover);
  border-radius: 20px;
  padding: 2rem;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

.modal-overlay.open .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

/* Media Queries */
@media (max-width: 768px) {
  .hero-section {
    padding: 4rem 0 3rem;
  }
  .privacy-banner {
    flex-direction: column;
    padding: 1.75rem;
  }
  .grid-dual {
    grid-template-columns: 1fr;
  }
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}
