/* Stagelog Marketing Site — matches app dark aesthetic */
:root {
  --gray-950: #030712;
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --blue-700: #1d4ed8;
  --green-400: #4ade80;
  --purple-400: #c084fc;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gray-950);
  color: var(--gray-300);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-400); text-decoration: none; }
a:hover { color: var(--blue-500); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Navigation */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(55, 65, 81, 0.5);
}
.nav .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-logo {
  font-size: 1.25rem; font-weight: 700; color: #fff;
  display: flex; align-items: center; gap: 8px;
}
.nav-logo span { font-size: 1.5rem; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { color: var(--gray-400); font-size: 0.875rem; font-weight: 500; transition: color 0.15s; }
.nav-links a:hover { color: #fff; }
.nav-cta {
  background: var(--blue-600); color: #fff !important; font-weight: 600;
  padding: 8px 20px; border-radius: 8px; font-size: 0.875rem;
  transition: background 0.15s;
}
.nav-cta:hover { background: var(--blue-700); }

/* Nav brand wrapper (logo + pill) */
.nav-brand { display: flex; align-items: center; gap: 0; }

/* Scroll arrow */
.scroll-arrow {
  margin-top: 48px; display: flex; justify-content: center;
  color: var(--gray-600);
  animation: scrollBounce 2s ease-in-out infinite;
}
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(8px); opacity: 1; }
}

/* Early Access nav pill */
.nav-early-pill {
  display: inline-block;
  background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(168,85,247,0.15));
  border: 1px solid rgba(139,92,246,0.45);
  color: var(--purple-400);
  font-size: 0.625rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 3px 10px; border-radius: 20px;
  vertical-align: middle; margin-left: 10px;
  white-space: nowrap;
}

/* Mobile nav */
.nav-toggle { display: none; background: none; border: none; color: var(--gray-400); cursor: pointer; padding: 8px; }
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--gray-950); border-bottom: 1px solid var(--gray-800);
    padding: 16px 24px;
  }
  .nav-links.open a { padding: 12px 0; }
  .nav-toggle { display: block; }
}

/* Hero */
.hero {
  padding: 100px 0 80px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(37, 99, 235, 0.12) 0%, transparent 60%);
}
.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 800; color: #fff;
  line-height: 1.15; margin-bottom: 20px;
}
.hero h1 .gradient {
  background: linear-gradient(135deg, var(--blue-400), var(--purple-400));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p { font-size: 1.125rem; color: var(--gray-400); max-width: 560px; margin: 0 auto 36px; }
.hero-cta {
  display: inline-block;
  background: var(--blue-600); color: #fff; font-weight: 600;
  padding: 14px 36px; border-radius: 10px; font-size: 1.05rem;
  transition: background 0.15s, transform 0.1s;
}
.hero-cta:hover { background: var(--blue-700); color: #fff; transform: translateY(-1px); }

/* Section */
.section { padding: 80px 0; }
.section-title {
  font-size: 1.75rem; font-weight: 700; color: #fff;
  text-align: center; margin-bottom: 12px;
}
.section-subtitle {
  text-align: center; color: var(--gray-400); margin-bottom: 48px;
  max-width: 540px; margin-left: auto; margin-right: auto;
}

/* Feature cards */
.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.feature-card {
  background: var(--gray-900); border: 1px solid var(--gray-800);
  border-radius: 12px; padding: 28px;
  transition: border-color 0.2s;
}
.feature-card:hover { border-color: var(--gray-700); }
.feature-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--gray-800); display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; margin-bottom: 16px;
}
.feature-card h3 { color: #fff; font-weight: 600; font-size: 1rem; margin-bottom: 8px; }
.feature-card p { color: var(--gray-400); font-size: 0.875rem; line-height: 1.6; }

/* Pricing */
.pricing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px; max-width: 960px; margin: 0 auto;
}
.pricing-card {
  background: var(--gray-900); border: 1px solid var(--gray-800);
  border-radius: 16px; padding: 32px; position: relative;
}
.pricing-card.featured {
  border-color: var(--blue-600);
  box-shadow: 0 0 40px rgba(37, 99, 235, 0.1);
}
.pricing-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--blue-600); color: #fff; font-size: 0.75rem; font-weight: 600;
  padding: 4px 16px; border-radius: 20px;
}
.pricing-card h3 { color: #fff; font-size: 1.25rem; font-weight: 700; margin-bottom: 8px; }
.pricing-price { color: #fff; font-size: 2.5rem; font-weight: 800; margin-bottom: 4px; }
.pricing-price span { font-size: 1rem; font-weight: 400; color: var(--gray-400); }
.pricing-desc { color: var(--gray-400); font-size: 0.875rem; margin-bottom: 24px; }
.pricing-features { list-style: none; margin-bottom: 28px; }
.pricing-features li {
  padding: 6px 0; font-size: 0.875rem; color: var(--gray-300);
  display: flex; align-items: center; gap: 10px;
}
.pricing-features li::before { content: '\2713'; color: var(--green-400); font-weight: 600; }
.pricing-btn {
  display: block; text-align: center; width: 100%;
  padding: 12px; border-radius: 8px; font-weight: 600; font-size: 0.9rem;
  transition: background 0.15s;
}
.pricing-btn-primary { background: var(--blue-600); color: #fff; }
.pricing-btn-primary:hover { background: var(--blue-700); color: #fff; }
.pricing-btn-secondary { background: var(--gray-800); color: var(--gray-300); }
.pricing-btn-secondary:hover { background: var(--gray-700); color: #fff; }

/* Comparison table */
.compare-table { width: 100%; border-collapse: collapse; margin: 48px auto 0; max-width: 720px; }
.compare-table th, .compare-table td {
  padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--gray-800);
  font-size: 0.875rem;
}
.compare-table th { color: #fff; font-weight: 600; }
.compare-table td { color: var(--gray-400); }
.compare-table .check { color: var(--green-400); text-align: center; }
.compare-table .dash { color: var(--gray-600); text-align: center; }

/* Footer */
.footer {
  border-top: 1px solid var(--gray-800);
  padding: 40px 0;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
.footer-brand h3 { color: #fff; font-weight: 700; font-size: 1.125rem; margin-bottom: 8px; }
.footer-brand p { color: var(--gray-500); font-size: 0.8125rem; }
.footer-col h4 { color: var(--gray-300); font-weight: 600; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; }
.footer-col a { display: block; color: var(--gray-500); font-size: 0.8125rem; padding: 4px 0; }
.footer-col a:hover { color: var(--gray-300); }
.footer-bottom {
  border-top: 1px solid var(--gray-800); margin-top: 32px; padding-top: 24px;
  text-align: center; color: var(--gray-600); font-size: 0.75rem;
}

/* Open source bar */
.oss-bar {
  border-top: 1px solid var(--gray-800); margin-top: 32px; padding-top: 24px;
}
.oss-bar h4 {
  color: var(--gray-500); font-size: 0.6875rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  text-align: center; margin-bottom: 16px;
}
.oss-links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px;
}
.oss-links a {
  color: var(--gray-500); font-size: 0.75rem; font-weight: 500;
  display: flex; align-items: center; gap: 5px;
  transition: color 0.15s;
}
.oss-links a:hover { color: var(--gray-300); }
.oss-links a svg { width: 14px; height: 14px; opacity: 0.6; }

/* Utility */
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }

/* About page */
.about-content { max-width: 680px; margin: 0 auto; }
.about-content h2 { color: #fff; font-size: 1.5rem; font-weight: 700; margin: 40px 0 16px; }
.about-content p { margin-bottom: 16px; color: var(--gray-300); }

/* Support page */
.support-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.support-card {
  background: var(--gray-900); border: 1px solid var(--gray-800);
  border-radius: 12px; padding: 28px; text-align: center;
}
.support-card h3 { color: #fff; font-weight: 600; margin: 12px 0 8px; }
.support-card p { color: var(--gray-400); font-size: 0.875rem; }
.faq-item { border-bottom: 1px solid var(--gray-800); padding: 20px 0; }
.faq-item h3 { color: #fff; font-weight: 600; font-size: 0.95rem; margin-bottom: 8px; }
.faq-item p { color: var(--gray-400); font-size: 0.875rem; }

/* Contact form */
.contact-form { display: flex; flex-direction: column; gap: 20px; }
.contact-field { display: flex; flex-direction: column; gap: 6px; }
.contact-field label { font-size: 0.875rem; font-weight: 500; color: var(--gray-300); }
.contact-field input, .contact-field textarea {
  background: var(--gray-900); border: 1px solid var(--gray-700);
  border-radius: 8px; color: var(--gray-200);
  padding: 10px 14px; font-family: inherit; font-size: 0.9375rem;
  transition: border-color 0.15s;
}
.contact-field input:focus, .contact-field textarea:focus {
  outline: none; border-color: var(--blue-600);
}
.contact-field textarea { resize: vertical; min-height: 120px; }
.contact-submit {
  background: var(--blue-600); color: #fff; font-weight: 600;
  border: none; border-radius: 8px; padding: 12px 28px;
  font-size: 0.9375rem; cursor: pointer; transition: background 0.15s;
  align-self: flex-start;
}
.contact-submit:hover { background: var(--blue-700); }
.contact-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.contact-result { border-radius: 10px; padding: 16px 20px; font-size: 0.875rem; }
.contact-result-success { background: rgba(74,222,128,0.08); border: 1px solid rgba(74,222,128,0.25); color: var(--gray-300); }
.contact-result-error { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25); color: #fca5a5; }
@media (max-width: 768px) {
  .contact-field input, .contact-field textarea { font-size: 16px; }
}

/* Invite Only section */
.invite-section { background: var(--gray-900); }
.invite-badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(37,99,235,0.2), rgba(139,92,246,0.2));
  border: 1px solid rgba(139,92,246,0.4);
  color: var(--purple-400);
  font-size: 0.6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 4px 14px; border-radius: 20px;
}
.invite-secondary-btn {
  display: inline-block;
  background: transparent; color: var(--gray-300);
  border: 1px solid var(--gray-700);
  font-weight: 600; padding: 14px 28px;
  border-radius: 10px; font-size: 1.05rem;
  transition: border-color 0.15s, color 0.15s;
}
.invite-secondary-btn:hover { border-color: var(--gray-500); color: #fff; }

/* Footer Cosmo credit */
.footer-cosmo-credit {
  text-align: center; margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--gray-800);
  color: var(--gray-500); font-size: 0.6875rem;
}
.footer-cosmo-credit a { color: var(--gray-400); font-weight: 500; }
.footer-cosmo-credit a:hover { color: var(--blue-400); }

/* Cosmo Chat Widget */
.cosmo-bubble {
  position: fixed; bottom: 24px; right: 24px; z-index: 1000;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--blue-600); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}
.cosmo-bubble:hover { transform: scale(1.08); box-shadow: 0 4px 28px rgba(37, 99, 235, 0.55); }
.cosmo-bubble img { width: 30px; height: 30px; border-radius: 50%; }

.cosmo-panel {
  position: fixed; bottom: 88px; right: 24px; z-index: 1000;
  width: 360px; max-height: 520px;
  background: var(--gray-900); border: 1px solid var(--gray-700);
  border-radius: 16px; display: none; flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  overflow: hidden;
}
.cosmo-panel.open { display: flex; }

.cosmo-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--gray-800);
  background: var(--gray-900);
}
.cosmo-header img { width: 28px; height: 28px; border-radius: 50%; }
.cosmo-header span { color: #fff; font-weight: 600; font-size: 0.9rem; flex: 1; }
.cosmo-header button {
  background: none; border: none; color: var(--gray-500); cursor: pointer;
  font-size: 1.25rem; padding: 0 4px; line-height: 1;
}
.cosmo-header button:hover { color: var(--gray-300); }

.cosmo-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 200px; max-height: 340px;
}
.cosmo-msg {
  max-width: 85%; padding: 10px 14px; border-radius: 12px;
  font-size: 0.8125rem; line-height: 1.55; word-wrap: break-word;
}
.cosmo-msg.user {
  background: var(--blue-600); color: #fff; align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.cosmo-msg.assistant {
  background: var(--gray-800); color: var(--gray-200); align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.cosmo-typing {
  display: flex; gap: 5px; padding: 10px 14px;
  background: var(--gray-800); border-radius: 12px;
  align-self: flex-start; border-bottom-left-radius: 4px;
}
.cosmo-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gray-500); animation: cosmoBounce 1.2s infinite;
}
.cosmo-typing span:nth-child(2) { animation-delay: 0.2s; }
.cosmo-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes cosmoBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

.cosmo-input-row {
  display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--gray-800);
  background: var(--gray-900);
}
.cosmo-input-row textarea {
  flex: 1; background: var(--gray-800); border: 1px solid var(--gray-700);
  border-radius: 8px; color: var(--gray-200); padding: 8px 12px;
  font-family: inherit; font-size: 0.8125rem; resize: none;
  min-height: 36px; max-height: 80px; line-height: 1.4;
}
.cosmo-input-row textarea::placeholder { color: var(--gray-500); }
.cosmo-input-row textarea:focus { outline: none; border-color: var(--blue-600); }
.cosmo-input-row button {
  background: var(--blue-600); border: none; border-radius: 8px;
  color: #fff; cursor: pointer; padding: 0 14px; font-weight: 600;
  font-size: 0.8125rem; white-space: nowrap;
  transition: background 0.15s;
}
.cosmo-input-row button:hover { background: var(--blue-700); }
.cosmo-input-row button:disabled { opacity: 0.5; cursor: not-allowed; }

.cosmo-powered {
  text-align: center; padding: 6px; font-size: 0.625rem;
  color: var(--gray-600); border-top: 1px solid var(--gray-800);
}
.cosmo-powered a { color: var(--gray-500); }
.cosmo-handoff-hint {
  padding: 6px 12px; text-align: center;
  border-top: 1px solid var(--gray-800);
}
.cosmo-handoff-hint button {
  background: none; border: none; cursor: pointer;
  color: var(--gray-400); font-size: 0.75rem; padding: 4px 8px;
  border-radius: 6px; transition: color 0.15s, background 0.15s;
}
.cosmo-handoff-hint button:hover { color: var(--gray-200); background: var(--gray-800); }
.cosmo-email-row {
  display: none; align-items: center; gap: 8px;
  padding: 10px 12px; border-top: 1px solid var(--gray-800);
}
.cosmo-email-row input {
  flex: 1; min-width: 0; background: var(--gray-800); border: 1px solid var(--gray-700);
  border-radius: 8px; padding: 8px 10px; color: #fff; font-size: 0.875rem;
}
.cosmo-email-row input::placeholder { color: var(--gray-500); }
.cosmo-email-row input:focus { outline: none; border-color: var(--blue-600); }
.cosmo-email-row button {
  background: var(--blue-600); color: #fff; border: none; border-radius: 8px;
  padding: 8px 14px; font-size: 0.8125rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.cosmo-email-row button:hover { background: var(--blue-700); }
.cosmo-email-row button:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 480px) {
  .cosmo-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    bottom: auto;
    right: auto;
    width: calc(100vw - 32px);
    height: 78vh;
    max-height: 78vh;
    border-radius: 16px;
    overflow-x: hidden;
  }
  .cosmo-bubble { bottom: 16px; right: 16px; }
  .cosmo-input-row textarea { font-size: 16px; }
}
