/* ============================================
   Chirp Landing Page — Design System
   ============================================ */

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

:root {
  /* Brand */
  --brand: #9B7EC8;
  --brand-dark: #7B5EA8;
  --brand-light: #C4ACE0;
  --brand-subtle: #E8DFF0;
  --cream: #FAF7F5;

  /* Dark / Break gradient */
  --twilight: #2A1F3D;
  --plum: #3D2E52;

  /* Accents */
  --green: #22c55e;
  --rose: #E8839F;
  --teal: #5BA8A0;

  /* Neutrals (warm stone) */
  --gray-50: #fafaf9;
  --gray-100: #f5f3f0;
  --gray-200: #E7E5E0;
  --gray-400: #a8a29e;
  --gray-500: #78716C;
  --gray-600: #57534e;
  --gray-800: #292524;
  --gray-900: #1c1917;

  /* Tokens */
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
  --shadow-xl: 0 25px 60px rgba(0,0,0,0.2);
}

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

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3, h4 { line-height: 1.2; }
h2 { font-size: 2rem; text-align: center; margin-bottom: 1rem; }
a { color: var(--brand); text-decoration: none; }

/* ---- Buttons ---- */
.btn {
  display: inline-block; padding: 10px 24px; border-radius: var(--radius);
  font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: all 0.2s;
  border: 2px solid transparent; text-align: center;
}
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn-ghost:hover { background: var(--cream); }
.btn-ghost-white { background: transparent; color: #fff; border-color: rgba(255,255,255,0.3); }
.btn-ghost-white:hover { border-color: var(--brand-light); color: var(--brand-light); }
.btn-white { background: #fff; color: var(--brand-dark); border-color: #fff; }
.btn-white:hover { background: var(--cream); border-color: var(--cream); }
.btn-sm { padding: 6px 16px; font-size: 0.85rem; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }

/* ---- Navigation ---- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(42, 31, 61, 0.95);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 0.3s, border-color 0.3s;
}
.nav-scrolled {
  background: rgba(250, 247, 245, 0.97);
  border-bottom-color: var(--gray-200);
}
.nav-container {
  max-width: 1100px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; height: 60px;
}
.nav-logo {
  font-size: 1.3rem; font-weight: 700; color: #fff;
  display: flex; align-items: center; gap: 8px;
  transition: color 0.3s;
}
.nav-scrolled .nav-logo { color: var(--gray-900); }
.nav-logo-icon { width: 24px; height: 24px; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 24px; }
.nav-links a { color: rgba(255,255,255,0.7); font-size: 0.9rem; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: #fff; }
.nav-scrolled .nav-links a { color: var(--gray-600); }
.nav-scrolled .nav-links a:hover { color: var(--gray-900); }
.nav-scrolled .nav-links .btn-primary { color: #fff; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #fff; transition: color 0.3s; }
.nav-scrolled .nav-toggle { color: var(--gray-800); }

/* ---- Hero (Dark) ---- */
.hero {
  padding: 100px 0 80px;
  text-align: center;
  background: linear-gradient(135deg, var(--twilight) 0%, var(--plum) 50%, var(--twilight) 100%);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -120px; right: -80px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(155,126,200,0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 800; color: #fff;
  margin-bottom: 16px;
  animation: hero-fade-up 0.7s ease both;
}
.hero-subtitle {
  font-size: 1.15rem; color: rgba(255,255,255,0.65);
  max-width: 560px; margin: 0 auto 36px; font-weight: 400;
  animation: hero-fade-up 0.7s 0.15s ease both;
}
.hero-cta {
  display: flex; justify-content: center; gap: 14px; margin-bottom: 16px;
  animation: hero-fade-up 0.7s 0.3s ease both;
}
.hero-platforms {
  font-size: 0.82rem; color: rgba(255,255,255,0.35); margin-bottom: 48px;
  animation: hero-fade-up 0.7s 0.4s ease both;
}

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

/* ---- Device Mockup Frames ---- */
.hero-devices {
  display: flex; justify-content: center; align-items: flex-end;
  gap: 32px; animation: hero-fade-up 0.8s 0.5s ease both;
}
.device-frame {
  position: relative;
  background: var(--gray-900);
  border-radius: 12px;
  padding: 32px 6px 6px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.06);
}
.device-frame::before {
  content: '';
  position: absolute;
  top: 11px; left: 12px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #EF4444;
  box-shadow: 14px 0 0 #FBBF24, 28px 0 0 #22C55E;
}
.device-frame img {
  display: block; width: 100%;
  border-radius: 0 0 7px 7px;
}
.device-home { width: 300px; }
.device-break { width: 480px; }

/* ---- Value Strip ---- */
.value-strip {
  padding: 32px 0;
  background: var(--cream);
  border-bottom: 1px solid var(--gray-200);
}
.value-strip-inner {
  display: flex; justify-content: center; align-items: center;
  gap: 40px; flex-wrap: wrap;
}
.value-item {
  display: flex; align-items: center; gap: 10px;
}
.value-item svg { flex-shrink: 0; }
.value-item span {
  font-size: 0.9rem; font-weight: 600; color: var(--gray-800);
}
.value-divider {
  width: 1px; height: 28px; background: var(--gray-200);
}

/* ---- Features ---- */
.features {
  padding: 88px 0;
  background: #fff;
  position: relative;
}
.features::before {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 50%; height: 50%;
  background: radial-gradient(ellipse at top right, rgba(155,126,200,0.05) 0%, transparent 60%);
  pointer-events: none;
}
.features h2 { margin-bottom: 12px; }
.features-subtitle {
  text-align: center; color: var(--gray-500); margin-bottom: 48px; font-size: 1.05rem;
}
.features-grid {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 24px;
}
.feature-card {
  flex: 0 1 calc(33.333% - 16px);
  padding: 32px 28px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  background: #fff;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(155,126,200,0.12);
  border-color: var(--brand-light);
}
.feature-icon-wrap {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--cream); display: flex;
  align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.feature-icon-wrap svg { width: 24px; height: 24px; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: 8px; font-weight: 600; }
.feature-card p { color: var(--gray-600); font-size: 0.9rem; line-height: 1.6; }

/* ---- App Showcase (Dark) ---- */
.showcase {
  padding: 96px 0;
  background: linear-gradient(160deg, var(--plum) 0%, var(--twilight) 100%);
}
.showcase-panel {
  display: flex; align-items: center; gap: 64px;
  max-width: 960px; margin: 0 auto;
}
.showcase-panel + .showcase-panel { margin-top: 80px; }
.showcase-panel.reverse { flex-direction: row-reverse; }
.showcase-text { flex: 1; }
.showcase-text h3 {
  font-size: 1.6rem; font-weight: 700; color: #fff; margin-bottom: 12px;
}
.showcase-text p {
  color: rgba(255,255,255,0.6); font-size: 1rem; line-height: 1.7;
}
.showcase-image { flex-shrink: 0; }
.showcase-image .device-frame {
  box-shadow: 0 30px 70px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
}
.showcase-home .device-frame { width: 320px; }
.showcase-break .device-frame { width: 460px; }

/* ---- Open Source & Privacy ---- */
.opensource {
  padding: 88px 0;
  background: var(--cream);
  text-align: center;
}
.opensource-eyebrow {
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--brand); margin-bottom: 12px;
}
.opensource h2 { margin-bottom: 16px; }
.opensource-body {
  color: var(--gray-500); max-width: 620px; margin: 0 auto 28px;
  font-size: 1.05rem; line-height: 1.7;
}
.opensource-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; color: var(--brand);
  padding: 8px 0; margin-bottom: 32px;
  transition: color 0.2s;
}
.opensource-link:hover { color: var(--brand-dark); }
.trust-pills {
  display: flex; justify-content: center; gap: 12px; flex-wrap: wrap;
}
.trust-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: 24px; padding: 8px 18px;
  font-size: 0.82rem; font-weight: 500; color: var(--gray-600);
}
.trust-pill svg { width: 16px; height: 16px; }

/* ---- Blog Highlights ---- */
.blog-section { padding: 80px 0; background: #fff; }
.blog-section h2 { margin-bottom: 8px; }
.blog-section-subtitle {
  text-align: center; color: var(--gray-500); margin-bottom: 40px;
}
.blog-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.blog-card {
  display: block; padding: 28px;
  border: 1px solid var(--gray-200); border-radius: var(--radius-xl);
  text-decoration: none; color: inherit;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(155,126,200,0.1);
  border-color: var(--brand-light);
}
.blog-card-tag {
  display: inline-block;
  font-size: 0.75rem; font-weight: 600;
  color: var(--brand); background: var(--brand-subtle);
  padding: 3px 10px; border-radius: 12px;
  margin-bottom: 12px;
}
.blog-card h3 {
  font-size: 1.05rem; font-weight: 600; margin-bottom: 8px;
  color: var(--gray-800); line-height: 1.4;
}
.blog-card p { color: var(--gray-500); font-size: 0.85rem; line-height: 1.5; }
.blog-view-all { text-align: center; margin-top: 28px; }

/* ---- Download CTA ---- */
.download {
  padding: 80px 0;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.download::before {
  content: '';
  position: absolute; top: -100px; left: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.download h2 { color: #fff; margin-bottom: 8px; }
.download-subtitle { color: rgba(255,255,255,0.75); margin-bottom: 36px; font-size: 1.05rem; }
.download-buttons {
  display: flex; justify-content: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.download-mobile { color: rgba(255,255,255,0.5); font-size: 0.85rem; }

/* ---- FAQ ---- */
.faq { padding: 80px 0; background: var(--cream); }
.faq-list { max-width: 700px; margin: 32px auto 0; }
.faq-item { border-bottom: 1px solid var(--gray-200); transition: border-color 0.2s; }
.faq-item[open] { border-left: 3px solid var(--brand); padding-left: 16px; }
.faq-item summary {
  padding: 16px 0; font-weight: 600; cursor: pointer; font-size: 1rem;
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.faq-item summary::before {
  content: '+'; color: var(--brand); font-size: 1.2rem; font-weight: 700;
  width: 20px; text-align: center; flex-shrink: 0;
  transition: transform 0.2s;
}
.faq-item[open] summary::before { content: '\2212'; }
.faq-item p { padding: 0 0 16px 28px; color: var(--gray-600); font-size: 0.9rem; line-height: 1.7; }

/* ---- Footer (Dark) ---- */
.footer {
  padding: 60px 0 30px;
  background: var(--gray-900);
  color: rgba(255,255,255,0.5);
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer h4 { color: #fff; margin-bottom: 12px; font-size: 0.9rem; }
.footer-about { font-size: 0.85rem; line-height: 1.6; max-width: 280px; }
.footer ul { list-style: none; }
.footer li { margin-bottom: 8px; }
.footer li a { color: rgba(255,255,255,0.5); font-size: 0.85rem; transition: color 0.2s; }
.footer li a:hover { color: var(--brand-light); }
.footer-bottom {
  margin-top: 40px; padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center; font-size: 0.8rem;
  color: rgba(255,255,255,0.3);
}

/* ---- Scroll Reveal Animations ---- */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1; transform: translateY(0);
}
.reveal-left {
  opacity: 0; transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-left.visible { opacity: 1; transform: translateX(0); }
.reveal-right {
  opacity: 0; transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-right.visible { opacity: 1; transform: translateX(0); }

/* Stagger children */
.reveal-stagger > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger > *:nth-child(2) { transition-delay: 0.08s; }
.reveal-stagger > *:nth-child(3) { transition-delay: 0.16s; }
.reveal-stagger > *:nth-child(4) { transition-delay: 0.24s; }
.reveal-stagger > *:nth-child(5) { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-left, .reveal-right {
    opacity: 1; transform: none; transition: none;
  }
  .hero h1, .hero-subtitle, .hero-cta, .hero-platforms, .hero-devices {
    animation: none;
  }
}

/* ============================================
   Blog Article Styles (shared with blog pages)
   ============================================ */
.article-body h2 { text-align: left; font-size: 1.5rem; margin: 32px 0 16px; }
.article-body h3 { text-align: left; font-size: 1.2rem; margin: 24px 0 12px; }
.article-body p { color: var(--gray-600); font-size: 0.95rem; line-height: 1.8; margin-bottom: 16px; }
.article-body ul, .article-body ol { color: var(--gray-600); font-size: 0.95rem; line-height: 1.8; margin: 0 0 16px 24px; }
.article-body li { margin-bottom: 8px; }
.article-body blockquote {
  border-left: 3px solid var(--brand); margin: 24px 0; padding: 16px 20px;
  background: var(--gray-50); border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--gray-600); font-style: italic;
}
.article-body table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 0.9rem; }
.article-body th, .article-body td { padding: 10px 14px; border-bottom: 1px solid var(--gray-200); text-align: left; }
.article-body th { background: var(--gray-100); font-weight: 600; }
.article-body .cta-box {
  background: var(--cream); border: 1px solid var(--brand); border-radius: var(--radius-lg);
  padding: 24px; text-align: center; margin: 32px 0;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
  .showcase-panel { gap: 40px; }
  .showcase-home .device-frame { width: 260px; }
  .showcase-break .device-frame { width: 380px; }
  .device-home { width: 240px; }
  .device-break { width: 380px; }
}

@media (max-width: 768px) {
  h2 { font-size: 1.6rem; }

  /* Nav mobile */
  .nav-links { display: none; }
  .nav-links.active {
    display: flex; flex-direction: column;
    position: absolute; top: 60px; left: 0; right: 0;
    background: var(--twilight); padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    gap: 12px;
  }
  .nav-scrolled .nav-links.active {
    background: #fff;
    border-bottom-color: var(--gray-200);
  }
  .nav-toggle { display: block; }

  /* Hero mobile */
  .hero { padding: 72px 0 56px; }
  .hero-cta { flex-direction: column; align-items: center; }
  .hero-devices { flex-direction: column; align-items: center; gap: 20px; }
  .device-home { width: 220px; }
  .device-break { width: 280px; }

  /* Value strip */
  .value-strip-inner { gap: 16px; }
  .value-divider { display: none; }
  .value-item { flex: 0 1 calc(50% - 8px); justify-content: center; }

  /* Features */
  .feature-card { flex: 0 1 100%; }

  /* Showcase */
  .showcase { padding: 64px 0; }
  .showcase-panel, .showcase-panel.reverse { flex-direction: column; gap: 32px; text-align: center; }
  .showcase-home .device-frame { width: 240px; }
  .showcase-break .device-frame { width: 300px; }

  /* Blog */
  .blog-grid { grid-template-columns: 1fr; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.8rem; }
  .device-home { width: 180px; }
  .device-break { width: 240px; }
  .showcase-home .device-frame { width: 200px; }
  .showcase-break .device-frame { width: 260px; }
  .download-buttons { flex-direction: column; align-items: center; }
  .footer-grid { grid-template-columns: 1fr; }
}
