/* ═══════════════════════════════════════════════════════════════════════
   xflows.ai — Brand Design System
   Colors derived from brand reference (android-reference.md).
   To retune: update the --primary and --accent values below.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── 1. Variables & Reset ─────────────────────────────────────────────── */
:root {
  /* Brand colours — change these two to retune everything */
  --primary: #5B21FA;
  --primary-light: #7C3AED;
  --primary-tint: #a78bfa;
  --accent: #0ECFB8;

  --gradient: linear-gradient(135deg, var(--primary), var(--accent));
  --gradient-text: linear-gradient(135deg, var(--primary-light), var(--accent));

  /* Surfaces */
  --bg: #0D0F1A;
  --surface: #1A1D2E;
  --surface-2: #222538;
  --border: #2A2D3E;

  /* Text */
  --text: #F0F2FF;
  --muted: #8B8FA8;

  /* Status */
  --danger: #FF4D6D;
  --warning: #F59E0B;
  --success: #0ECFB8;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 100px;

  /* Glow */
  --glow-primary: rgba(91, 33, 250, 0.18);
  --glow-accent: rgba(14, 207, 184, 0.15);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

img, svg { max-width: 100%; display: block; }
a { color: var(--primary-tint); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }

/* ── 2. Typography ────────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mono { font-family: 'JetBrains Mono', monospace; }

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

section {
  padding: 5rem 0;
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 3rem;
}

.section-header p {
  color: var(--muted);
  margin-top: 0.75rem;
  font-size: 1.05rem;
}

/* ── 4. Navigation ────────────────────────────────────────────────────── */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(13, 15, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-family: 'Inter', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
}

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

.logo-x {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-rest { color: var(--text); }

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

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s;
}

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

/* Hamburger — hidden on desktop */
.nav-toggle-cb { display: none; }
.nav-hamburger { display: none; }

/* ── 5. Animated Background (flowing lines canvas) ────────────────── */
.flow-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.flow-bg canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── 6. Hero ──────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 1.5rem 5rem;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero h1 {
  margin-bottom: 1.25rem;
}

.hero p {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── 7. Buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 20px var(--glow-primary);
}

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--glow-primary);
  color: #fff;
}

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

.btn-ghost:hover {
  border-color: var(--primary-tint);
  color: var(--primary-tint);
}

.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--primary-tint);
  border-radius: var(--radius-pill);
}

.btn-sm:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── 8. Metrics Bar ───────────────────────────────────────────────────── */
.metrics {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 3rem 0;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  text-align: center;
}

.metric-item h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.metric-item h3 .gradient-text {
  font-size: inherit;
  font-weight: inherit;
}

.metric-item p {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── 9. How It Works ──────────────────────────────────────────────────── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  counter-reset: step;
}

.step-card {
  text-align: center;
  padding: 2rem 1.5rem;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
  margin-bottom: 1.25rem;
}

.step-card h3 {
  margin-bottom: 0.75rem;
}

.step-card p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

/* ── 10. Cards (use cases, why-xflows) ────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 30px var(--glow-primary);
}

.card-icon {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  display: block;
}

.card h3 { margin-bottom: 0.6rem; }

.card p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

/* 3-column variant for "why xflows" */
.card-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* ── 11. Platform Section ─────────────────────────────────────────────── */
.platform-section {
  position: relative;
  overflow: hidden;
}

.platform-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.platform-text h2 { margin-bottom: 1rem; }

.platform-text p {
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.7;
}

.platform-visual {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
}

.chat-bubble {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.chat-bubble.user {
  border-left: 3px solid var(--primary);
}

.chat-bubble.ai {
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

/* ── 12. Integrations ─────────────────────────────────────────────────── */
.integrations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
}

.integration-group h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: var(--primary-tint);
}

.integration-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
  color: var(--text);
  transition: border-color 0.2s;
}

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

.pill-desc {
  color: var(--muted);
  font-size: 0.75rem;
  margin-left: 0.3rem;
}

/* ── 13. CTA Banner ───────────────────────────────────────────────────── */
.cta-banner {
  position: relative;
  text-align: center;
  padding: 5rem 1.5rem;
  overflow: hidden;
}

.cta-banner h2 { margin-bottom: 1rem; }

.cta-banner p {
  color: var(--muted);
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.cta-banner .btn { position: relative; z-index: 1; }

/* ── 14. FAQ Accordion ────────────────────────────────────────────────── */
.faq-list {
  max-width: 720px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  transition: color 0.2s;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--muted);
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: 1rem;
}

.faq-item[open] summary::after {
  content: '\2212';
}

.faq-item summary:hover { color: var(--accent); }

.faq-answer {
  padding: 0 0 1.25rem;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.95rem;
}

/* ── 15. About Page ───────────────────────────────────────────────────── */
.about-hero {
  padding-top: 8rem;
  text-align: center;
}

.about-hero p {
  color: var(--muted);
  max-width: 600px;
  margin: 1rem auto 0;
  font-size: 1.1rem;
  line-height: 1.7;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
}

.about-card h3 { margin-bottom: 0.75rem; }
.about-card p { color: var(--muted); line-height: 1.7; font-size: 0.95rem; }

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
}

.team-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--surface-2);
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.team-card h3 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.team-card .role { color: var(--accent); font-size: 0.85rem; font-weight: 600; }
.team-card p { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }

/* ── 16. Contact Page ─────────────────────────────────────────────────── */
.contact-hero {
  padding-top: 8rem;
  text-align: center;
}

.contact-hero p {
  color: var(--muted);
  max-width: 500px;
  margin: 1rem auto 0;
  font-size: 1.1rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
}

.contact-card .contact-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.contact-card h3 { margin-bottom: 0.5rem; }
.contact-card p { color: var(--muted); font-size: 0.95rem; }
.contact-card a { font-weight: 600; }

/* ── 17. Legal Pages ──────────────────────────────────────────────────── */
.legal {
  padding-top: 8rem;
  max-width: 720px;
  margin: 0 auto;
}

.legal h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.legal .last-updated { color: var(--muted); font-size: 0.9rem; margin-bottom: 2rem; }
.legal h2 { font-size: 1.3rem; margin: 2rem 0 0.75rem; }
.legal p, .legal li { color: var(--muted); line-height: 1.7; margin-bottom: 0.75rem; }
.legal ul { padding-left: 1.5rem; }
.legal a { color: var(--accent); }

/* ── 18. Breadcrumbs ──────────────────────────────────────────────────── */
.breadcrumbs {
  padding: 0.75rem 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { margin: 0 0.4rem; }

/* ── 19. Footer ───────────────────────────────────────────────────────── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 3.5rem 0 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 2fr;
  gap: 3rem;
  padding-bottom: 2.5rem;
}

.footer-tagline {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.footer-col h4 {
  margin-bottom: 0.75rem;
}

.footer-col a {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.25rem 0;
  transition: color 0.2s;
}

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

.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── 20. Responsive ───────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .platform-content {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    z-index: 1001;
  }

  .nav-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
  }

  .nav-toggle-cb:checked ~ .nav-hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .nav-toggle-cb:checked ~ .nav-hamburger span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle-cb:checked ~ .nav-hamburger span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 2rem 2rem;
    gap: 1.25rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .nav-toggle-cb:checked ~ .nav-links {
    transform: translateX(0);
  }

  .footer-links {
    grid-template-columns: 1fr 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

@media (max-width: 640px) {
  section { padding: 3.5rem 0; }

  .hero { min-height: auto; padding: 7rem 1.5rem 4rem; }

  .hero-buttons { flex-direction: column; align-items: center; }

  .card-grid,
  .card-grid-3,
  .steps-grid {
    grid-template-columns: 1fr;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-links {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}
