/**
 * Astrochat — Prospect-facing marketing site styles
 *
 * Business justification: Single-page marketing site must load fast, be readable,
 * and convey trust. Distinctive typography and palette avoid generic “AI” look.
 * Architecture: Mobile-first, BEM-like classes, CSS custom properties for theme.
 * Usage: Link from index.html; no build step. Override --color-* in root if needed.
 * Invalid: Missing fonts fall back to system stack; unknown classes have no effect.
 */

:root {
  --color-bg: #0d0f12;
  --color-surface: #161a1f;
  --color-surface-elevated: #1e2329;
  --color-text: #e8eaed;
  --color-text-muted: #9ca3af;
  --color-accent: #f59e0b;
  --color-accent-hover: #fbbf24;
  --color-border: #2d333b;
  --color-success: #34d399;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --header-h: 4rem;
  --container: min(90vw, 1100px);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

/* ----- Header ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(13, 15, 18, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo:hover {
  color: var(--color-accent);
}

.nav {
  display: none;
  align-items: center;
  gap: var(--space-xl);
}

.nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav a:hover {
  color: var(--color-text);
}

/* Header CTA: brighter background and dark text so it reads clearly without hover */
.site-header .nav a.btn-primary,
.site-header .nav-mobile a.btn-primary {
  background: var(--color-accent-hover);
  color: #0d0f12;
  border-color: var(--color-accent-hover);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.site-header .nav a.btn-primary:hover,
.site-header .nav-mobile a.btn-primary:hover {
  background: #fcd34d;
  color: #0d0f12;
  border-color: #fcd34d;
  box-shadow: 0 2px 12px rgba(251, 191, 36, 0.5);
}

@media (min-width: 768px) {
  .nav {
    display: flex;
  }
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

@media (min-width: 768px) {
  .menu-toggle {
    display: none;
  }
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav overlay */
.nav-mobile {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-h);
  z-index: 99;
  background: var(--color-surface);
  padding: var(--space-xl);
  flex-direction: column;
  gap: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

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

.nav-mobile a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
}

.nav-mobile a:hover {
  color: var(--color-accent);
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-bg);
  border-color: var(--color-accent);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: var(--color-bg);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-ghost:hover {
  background: var(--color-surface-elevated);
  border-color: var(--color-text-muted);
}

.btn-outline {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.btn-outline:hover {
  background: rgba(245, 158, 11, 0.12);
}

.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: 1rem;
}

/* ----- Layout ----- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ----- Hero ----- */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl) var(--space-lg);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(245, 158, 11, 0.15), transparent),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(245, 158, 11, 0.06), transparent);
  pointer-events: none;
}

.hero-content {
  position: relative;
  text-align: center;
  z-index: 1;
}

.hero-content h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 var(--space-lg);
  color: var(--color-text);
}

.hero-content h1 em {
  font-style: italic;
  color: var(--color-accent);
}

.hero-lead {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--color-text-muted);
  max-width: 32ch;
  margin: 0 auto var(--space-xl);
  line-height: 1.5;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
}

.hero-visual {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin-top: var(--space-2xl);
  z-index: 1;
}

.mock-window {
  display: flex;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.mock-sidebar {
  width: 28%;
  min-height: 220px;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
}

.mock-chat {
  flex: 1;
  padding: var(--space-lg);
  min-height: 220px;
}

.mock-bubbles {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: flex-start;
}

.mock-bubble {
  display: block;
  width: 70%;
  max-width: 200px;
  height: 12px;
  border-radius: 12px;
  background: var(--color-border);
}

.mock-bubble.out {
  align-self: flex-end;
  background: rgba(245, 158, 11, 0.35);
}

.mock-bubble.short {
  width: 45%;
}

/* ----- Spotlight sections (chat, channels, marketing) -----
 * Business justification: Feature storytelling with clear hierarchy and alternating layout.
 * Architecture: Two-column layout (content + visual), .spotlight--alt flips order on desktop.
 * Usage: Each section has .spotlight-label, .spotlight-title, .spotlight-lead, optional list/card.
 * Invalid: Single column on small screens; missing visual still shows content.
 */
.spotlight {
  padding: var(--space-3xl) 0;
  border-top: 1px solid var(--color-border);
}

.spotlight--alt {
  background: var(--color-surface);
}

.spotlight-inner {
  display: grid;
  gap: var(--space-2xl);
  align-items: center;
}

@media (min-width: 900px) {
  .spotlight-inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
  }

  .spotlight-visual--first {
    order: -1;
  }
}

.spotlight-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

.spotlight-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 var(--space-md);
  color: var(--color-text);
}

.spotlight-lead {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-lg);
  line-height: 1.6;
}

.spotlight-content p {
  margin: 0 0 var(--space-md);
  color: var(--color-text-muted);
  line-height: 1.65;
}

.spotlight-list {
  margin: var(--space-lg) 0;
  padding-left: 1.25rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.spotlight-list li {
  margin-bottom: var(--space-md);
}

.spotlight-list strong {
  color: var(--color-text);
}

.spotlight-note {
  margin-top: var(--space-lg);
  font-size: 0.95rem;
  color: var(--color-text-muted);
  font-style: italic;
}

.spotlight-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.spotlight-card {
  width: 100%;
  max-width: 340px;
  padding: var(--space-xl);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.spotlight-card--chat {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.spotlight-card-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
}

.spotlight-card-line {
  display: block;
  height: 10px;
  border-radius: 6px;
  background: var(--color-border);
  width: 85%;
}

.spotlight-card-line.short {
  width: 55%;
}

.spotlight-card-line.out {
  align-self: flex-end;
  background: rgba(245, 158, 11, 0.35);
  width: 70%;
}

.spotlight-card--channels {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: center;
}

.channel-pill {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.channel-unified {
  margin: var(--space-sm) 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-accent);
}

.spotlight-card--marketing {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.template-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-accent);
  padding: var(--space-xs) var(--space-sm);
  background: rgba(245, 158, 11, 0.12);
  border-radius: var(--radius);
  width: fit-content;
}

.template-line {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: var(--color-border);
  width: 100%;
}

.template-line:last-child {
  width: 75%;
}

/* ----- Section title (shared) ----- */
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-lg);
  color: var(--color-text);
  text-align: center;
}

.section-title--small {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  margin-bottom: var(--space-md);
}

/* ----- Features ----- */
.features {
  padding: var(--space-3xl) 0;
  background: var(--color-surface);
}

.features .section-title {
  margin-bottom: var(--space-2xl);
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

@media (min-width: 640px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .features-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.feature-card {
  padding: var(--space-xl);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.feature-icon {
  font-size: 1.75rem;
  margin-bottom: var(--space-md);
}

.feature-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0 0 var(--space-sm);
  color: var(--color-text);
}

.feature-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

/* ----- Integrations (API & webhooks — brief) ----- */
.integrations {
  padding: var(--space-2xl) 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.integrations-inner {
  max-width: 36rem;
  margin: 0 auto;
  text-align: center;
}

.integrations-text {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.65;
}

/* ----- How it works ----- */
.how-it-works {
  padding: var(--space-3xl) 0;
}

.how-it-works .section-title {
  margin-bottom: var(--space-2xl);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
  max-width: 36rem;
  margin: 0 auto;
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-lg);
  align-items: start;
}

.step-num {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  color: var(--color-bg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.step h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0 0 var(--space-xs);
  color: var(--color-text);
}

.step p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

/* ----- Pricing ----- */
.pricing {
  padding: var(--space-3xl) 0;
  background: var(--color-surface);
}

.pricing .section-title {
  margin-bottom: var(--space-sm);
}

.pricing-sub {
  text-align: center;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-2xl);
  font-size: 1rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  max-width: 960px;
  margin: 0 auto;
}

@media (min-width: 720px) {
  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.price-card {
  position: relative;
  padding: var(--space-xl);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.price-card.featured {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.price-card .badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-accent);
  color: var(--color-bg);
  font-size: 0.75rem;
  font-weight: 600;
  padding: var(--space-xs) var(--space-md);
  border-radius: 999px;
}

.price-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  margin: 0 0 var(--space-md);
  color: var(--color-text);
}

.price {
  margin-bottom: var(--space-lg);
}

.price .amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--color-text);
}

.price-features {
  list-style: none;
  margin: 0 0 var(--space-xl);
  padding: 0;
  text-align: left;
  width: 100%;
}

.price-features li {
  padding: var(--space-sm) 0;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  position: relative;
  padding-left: 1.25rem;
}

.price-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-success);
  font-weight: 600;
}

.price-card .btn {
  width: 100%;
  margin-top: auto;
}

/* ----- CTA ----- */
.cta {
  padding: var(--space-3xl) 0;
  text-align: center;
  border-top: 1px solid var(--color-border);
}

.cta .section-title {
  margin-bottom: var(--space-md);
}

.cta-text {
  color: var(--color-text-muted);
  margin: 0 0 var(--space-xl);
  font-size: 1.05rem;
}

.cta-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

/* ----- Footer ----- */
.site-footer {
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  text-align: center;
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
}

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

.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  margin: 0;
  color: var(--color-text-muted);
}

.footer-copy {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ----- Legal pages (privacy, terms) -----
 * Business justification: Legal pages must be readable and match site branding.
 * Architecture: Same header/footer as home; .legal-content constrains width and typography.
 * Usage: Used in /privacy-policy and /terms-and-conditions index.html.
 * Invalid: Missing .legal-content still renders; long text wraps normally.
 */
.legal-content {
  max-width: 42rem;
  margin: 0 auto;
  padding: var(--space-2xl) 0 var(--space-3xl);
}

.legal-content h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  margin: 0 0 var(--space-md);
  color: var(--color-text);
}

.legal-content h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  margin: var(--space-2xl) 0 var(--space-md);
  color: var(--color-text);
}

.legal-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: var(--space-xl) 0 var(--space-sm);
  color: var(--color-text);
}

.legal-content p,
.legal-content li {
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  line-height: 1.65;
}

.legal-body {
  margin-top: var(--space-md);
}

.legal-content p:last-child {
  margin-bottom: 0;
}

.legal-content ul {
  margin: var(--space-md) 0;
  padding-left: 1.5rem;
}

.legal-content li {
  margin-bottom: var(--space-xs);
}

.legal-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-xl) 0;
}

.legal-content strong {
  color: var(--color-text);
}

.legal-content a {
  color: var(--color-accent);
  text-decoration: none;
}

.legal-content a:hover {
  text-decoration: underline;
}

.legal-back {
  display: inline-block;
  margin-bottom: var(--space-xl);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.legal-back:hover {
  color: var(--color-accent);
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
