@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Instrument+Serif:ital@0;1&family=Geist+Mono:wght@400;500;600&display=swap');
@import url('https://api.fontshare.com/v2/css?f[]=general-sans@500,600,700&display=swap');

:root {
  --accent: #FF5E47;
  --accent-hover: #E8472F;
  --accent-soft: #FFE9E5;
  --navy: #1A2238;
  --navy-soft: #E8EAF0;
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --border: #ECECEF;
  --border-strong: #D8D8DB;
  --text: #14141A;
  --text-muted: #6B6B6B;
}

html, body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.font-display { font-family: 'General Sans', 'Inter', sans-serif; letter-spacing: -0.015em; }
.serif { font-family: 'Instrument Serif', serif; letter-spacing: -0.005em; }
.serif-italic { font-family: 'Instrument Serif', serif; font-style: italic; }
.mono { font-family: 'Geist Mono', ui-monospace, monospace; font-feature-settings: 'tnum'; }

.shadow-soft { box-shadow: 0 1px 2px rgba(20,20,40,0.04), 0 8px 24px -8px color-mix(in srgb, var(--accent) 25%, transparent); }
.shadow-card { box-shadow: 0 1px 0 rgba(20,20,40,0.04), 0 1px 3px rgba(20,20,40,0.05); }
.shadow-pop { box-shadow: 0 4px 8px -2px rgba(20,20,40,0.06), 0 16px 32px -8px rgba(20,20,40,0.18); }

.bounce { transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
.bounce:hover { transform: translateY(-1px); }
.bounce:active { transform: translateY(0) scale(0.97); }

/* Buttons */
.btn-primary {
  background: var(--accent); color: white; font-weight: 600; font-size: 14px;
  padding: 10px 18px; border-radius: 12px; display: inline-flex; align-items: center; gap: 8px;
  transition: all 0.15s ease; box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 50%, transparent);
  cursor: pointer; border: none; text-decoration: none;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-primary.lg { padding: 14px 24px; font-size: 15px; border-radius: 14px; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: white; border: 1px solid var(--border); color: var(--text); font-weight: 500; font-size: 14px;
  padding: 10px 18px; border-radius: 12px; display: inline-flex; align-items: center; gap: 8px;
  transition: all 0.15s ease; cursor: pointer; text-decoration: none;
}
.btn-secondary:hover { border-color: var(--border-strong); background: #F7F7F2; }
.btn-secondary.lg { padding: 14px 22px; font-size: 15px; border-radius: 14px; }

.btn-ghost {
  color: var(--text-muted); font-weight: 500; font-size: 14px;
  padding: 10px 14px; border-radius: 12px; transition: all 0.15s ease;
  cursor: pointer; border: none; background: transparent; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-ghost:hover { background: #F2F2EE; color: var(--text); }

/* Inputs */
.input {
  background: white; border: 1px solid var(--border); border-radius: 12px;
  padding: 11px 14px; font-size: 14px; width: 100%; font-family: inherit; color: var(--text);
  transition: all 0.15s ease;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: #9CA3AF; }
.input.lg { padding: 14px 16px; font-size: 15px; border-radius: 14px; }

.label {
  display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text);
}
.help-text { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* Cards & layout */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; }

/* Top app header */
.app-header { background: white; border-bottom: 1px solid var(--border); padding: 14px 24px; }

.nav-link {
  padding: 6px 12px; border-radius: 12px; font-size: 14px; color: var(--text-muted);
  transition: all 0.15s ease; text-decoration: none;
}
.nav-link:hover { background: #F2F2EE; color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* Tags */
.tag {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px;
}
.tag-coral { background: var(--accent-soft); color: var(--accent); }
.tag-emerald { background: #D1FAE5; color: #065F46; }
.tag-amber { background: #FEF3C7; color: #92400E; }
.tag-gray { background: #F3F4F6; color: #4B5563; }
.tag-navy { background: var(--navy-soft); color: var(--navy); }

/* Animations */
@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both; }
.delay-1 { animation-delay: 0.05s; } .delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; } .delay-4 { animation-delay: 0.2s; }
.delay-5 { animation-delay: 0.25s; } .delay-6 { animation-delay: 0.3s; }
.delay-7 { animation-delay: 0.35s; } .delay-8 { animation-delay: 0.4s; }

.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #10B981;
  animation: pulse 2s infinite; display: inline-block;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
  70% { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* Hero number switcher */
.hero-number {
  background: white; border: 1px solid var(--border); border-radius: 18px;
  padding: 14px 22px; cursor: pointer; transition: all 0.15s ease;
  text-align: right; display: inline-flex; align-items: center; gap: 14px;
  position: relative;
}
.hero-number:hover { border-color: var(--border-strong); }
.hero-number-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--text-muted); font-weight: 700; margin-bottom: 4px; line-height: 1; }
.hero-number-value { font-family: 'Geist Mono', monospace; font-size: 26px; font-weight: 600; line-height: 1; color: var(--navy); letter-spacing: -0.01em; }
.hero-number-meta { font-size: 11px; color: var(--text-muted); margin-top: 6px; display: flex; align-items: center; gap: 6px; justify-content: flex-end; }

/* Dropdown */
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: white; border: 1px solid var(--border); border-radius: 14px;
  min-width: 320px; padding: 6px;
  box-shadow: 0 4px 8px -2px rgba(20,20,40,0.06), 0 16px 32px -8px rgba(20,20,40,0.18);
  z-index: 50;
}
.dropdown.hidden { display: none; }
.dropdown-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  transition: background 0.15s ease;
}
.dropdown-item:hover { background: #F7F7F2; }
.dropdown-item.active { background: var(--accent-soft); }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 4px; }

/* Conversation rows (used in inbox) */
.conv-row { transition: background-color 0.15s ease; cursor: pointer; }
.conv-row:hover { background: #F2F2EE; }
.conv-active { background: var(--accent-soft); }
.conv-active:hover { background: var(--accent-soft); }

/* Asymmetric message bubbles (inbound = bar, outbound = bubble) */
.inbound-bar { border-left: 2px solid; padding-left: 14px; }
.bubble-out { background: var(--accent); color: white; }

/* Custom logo mark */
.mark { display: inline-block; }

/* Settings tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab {
  padding: 10px 16px; font-size: 14px; color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent; transition: all 0.15s ease;
  text-decoration: none; font-weight: 500;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* Theme swatch (settings page) */
.swatch-btn {
  width: 36px; height: 36px; border-radius: 12px; cursor: pointer; border: 2px solid white;
  outline: 2px solid transparent; transition: outline 0.15s ease;
}
.swatch-btn.active { outline-color: var(--text); }

/* Stat cards (analytics) */
.stat-num { font-family: 'Geist Mono', monospace; font-size: 32px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; color: var(--navy); }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); font-weight: 700; }
.stat-delta-up { color: #059669; font-size: 12px; font-weight: 600; }
.stat-delta-down { color: var(--accent); font-size: 12px; font-weight: 600; }

/* Use case selector cards (onboarding) */
.usecase-card {
  background: white; border: 2px solid var(--border); border-radius: 16px;
  padding: 18px; cursor: pointer; transition: all 0.15s ease;
}
.usecase-card:hover { border-color: var(--border-strong); }
.usecase-card.selected { border-color: var(--accent); background: var(--accent-soft); }

/* ============================================ */
/* ANIMATED HAMBURGER + MOBILE NAV              */
/* ============================================ */

/* Hamburger button — three lines with signature animation */
.hamburger {
  display: none; /* hidden on desktop */
  width: 40px; height: 40px; border: none; background: transparent;
  cursor: pointer; position: relative; z-index: 200;
  padding: 0; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.hamburger-line {
  display: block; height: 2.5px;
  background: var(--text); border-radius: 3px;
  position: absolute; left: 8px;
  transition: all 0.4s cubic-bezier(0.77, 0, 0.18, 1);
}
/* Stagger-in on page load */
.hamburger-line:nth-child(1) { top: 11px; width: 22px; animation: hamburgerIn1 0.5s 0.1s both; }
.hamburger-line:nth-child(2) { top: 18px; width: 16px; animation: hamburgerIn2 0.5s 0.2s both; }
.hamburger-line:nth-child(3) { top: 25px; width: 22px; animation: hamburgerIn3 0.5s 0.3s both; }
@keyframes hamburgerIn1 { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: translateX(0); } }
@keyframes hamburgerIn2 { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes hamburgerIn3 { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: translateX(0); } }

/* Hover: lines spread + middle extends */
.hamburger:hover .hamburger-line:nth-child(1) { top: 9px; }
.hamburger:hover .hamburger-line:nth-child(2) { width: 22px; }
.hamburger:hover .hamburger-line:nth-child(3) { top: 27px; }

/* Animated open state — morph to X with accent color */
.hamburger.open .hamburger-line {
  background: var(--accent);
}
.hamburger.open .hamburger-line:nth-child(1) {
  top: 18px; width: 22px; transform: rotate(45deg);
}
.hamburger.open .hamburger-line:nth-child(2) {
  opacity: 0; transform: translateX(-12px);
  width: 22px;
}
.hamburger.open .hamburger-line:nth-child(3) {
  top: 18px; width: 22px; transform: rotate(-45deg);
}
/* Override hover when open */
.hamburger.open:hover .hamburger-line:nth-child(1) { top: 18px; }
.hamburger.open:hover .hamburger-line:nth-child(3) { top: 18px; }

/* White variant (for dark backgrounds) */
.hamburger-white .hamburger-line { background: white; }
.hamburger-white.open .hamburger-line { background: var(--accent); }

/* Mobile nav overlay */
.mobile-nav {
  position: fixed; inset: 0; z-index: 150;
  background: white;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.77, 0, 0.18, 1);
  overflow-y: auto;
}
.mobile-nav.open {
  transform: translateX(0);
}
.mobile-nav-header {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.mobile-nav-links {
  flex: 1; padding: 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.mobile-nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 14px;
  font-size: 16px; font-weight: 500; color: var(--text);
  text-decoration: none; transition: background 0.15s ease;
}
.mobile-nav-link:hover { background: #F2F2EE; }
.mobile-nav-link.active {
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
}
.mobile-nav-link svg { flex-shrink: 0; }
.mobile-nav-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

/* Show hamburger, hide desktop nav on mobile */
@media (max-width: 768px) {
  .hamburger { display: block; }
  .desktop-nav { display: none !important; }
  .desktop-search { display: none !important; }
  /* Responsive app header */
  .app-header { padding: 12px 16px; }
  /* Responsive hero number */
  .hero-number-value { font-size: 18px; }
  .hero-number { padding: 10px 16px; border-radius: 14px; }
}

/* Desktop: hide mobile nav */
@media (min-width: 769px) {
  .mobile-nav { display: none !important; }
}
