/* ============================================================
   Flowstack — SaaS landing page (Koveira concept demo)
   Design tokens: indigo #4f46e5 · navy #0f172a · bg #f8fafc
   Spacing scale: 4/8px increments · Inter + system-ui fallback
   ============================================================ */

:root {
  --indigo-500: #4f46e5;
  --indigo-600: #4338ca;
  --indigo-700: #3730a3;
  --navy-900: #0f172a;
  --navy-800: #1e293b;
  --slate-700: #334155;
  --slate-500: #64748b;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --gray-50: #f8fafc;
  --white: #ffffff;
  --red-400: #f87171;
  --amber-400: #fbbf24;
  --green-500: #22c55e;

  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.18);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --transition: 180ms ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--slate-700);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 768px;
}

.section {
  padding: 96px 0;
}

.section-alt {
  background: var(--gray-50);
}

.section-head {
  max-width: 640px;
  margin: 0 auto 56px;
  text-align: center;
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--navy-900);
  margin-bottom: 16px;
}

.section-sub {
  font-size: 1.125rem;
  color: var(--slate-500);
}

.text-accent {
  color: var(--indigo-500);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-lg);
  padding: 12px 24px;
  transition: background-color var(--transition), border-color var(--transition),
    color var(--transition), box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--indigo-500);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--indigo-600);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--white);
  color: var(--navy-900);
  border: 1px solid var(--slate-200);
}

.btn-secondary:hover {
  border-color: var(--slate-300);
  background: var(--gray-50);
}

.btn-white {
  background: var(--white);
  color: var(--indigo-600);
}

.btn-white:hover {
  background: var(--slate-100);
  box-shadow: var(--shadow-md);
}

.btn-sm {
  padding: 10px 20px;
  font-size: 0.9375rem;
  border-radius: 10px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.0625rem;
  border-radius: var(--radius-xl);
}

.btn-block {
  width: 100%;
}

/* ---------- Navbar ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.site-header.is-scrolled {
  border-color: var(--slate-100);
  box-shadow: var(--shadow-sm);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 32px;
  height: 32px;
}

.brand-name {
  font-size: 1.1875rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--navy-900);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--slate-700);
  transition: color var(--transition);
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--slate-200);
  background: var(--white);
}

.nav-burger span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: var(--navy-900);
  transition: transform var(--transition), opacity var(--transition);
}

.nav-burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
  border-top: 1px solid var(--slate-100);
  background: var(--white);
  padding: 16px 24px 24px;
  box-shadow: var(--shadow-md);
}

.mobile-menu ul {
  margin-bottom: 16px;
}

.mobile-menu li a {
  display: block;
  padding: 12px 4px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--navy-900);
  border-bottom: 1px solid var(--slate-100);
  transition: color var(--transition);
}

.mobile-menu li a:hover {
  color: var(--indigo-500);
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, #eef2ff 0%, var(--white) 100%);
  padding: 88px 0 96px;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 64px;
  align-items: center;
}

.hero-copy {
  max-width: 640px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  margin-bottom: 24px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--indigo-600);
  background: #eef2ff;
  border: 1px solid #e0e7ff;
  border-radius: 999px;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--navy-900);
  margin-bottom: 24px;
}

.hero-sub {
  font-size: 1.1875rem;
  color: var(--slate-500);
  margin-bottom: 36px;
  max-width: 540px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.hero-note {
  font-size: 0.875rem;
  color: var(--slate-500);
}

/* Browser mockup */
.browser {
  background: var(--navy-900);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--navy-800);
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: var(--navy-800);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-red { background: var(--red-400); }
.dot-yellow { background: var(--amber-400); }
.dot-green { background: var(--green-500); }

.browser-url {
  flex: 1;
  margin-left: 12px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 0.8125rem;
  color: var(--slate-300);
  text-align: center;
}

.browser-body {
  display: grid;
  grid-template-columns: 56px 1fr;
  min-height: 360px;
}

.mock-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.ms-logo {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--indigo-500);
  margin-bottom: 10px;
}

.ms-item {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
}

.ms-item.active {
  background: var(--indigo-500);
}

.mock-main {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mock-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.kpi {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
}

.kpi-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--slate-300);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.kpi-value {
  display: block;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}

.kpi-delta {
  font-size: 0.6875rem;
  font-weight: 600;
}

.kpi-delta.up { color: #86efac; }
.kpi-delta.down { color: var(--red-400); }

.mock-chart {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.chart-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--white);
}

.chart-legend {
  font-size: 0.6875rem;
  color: var(--slate-300);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--indigo-500);
}

.chart-legend i.alt {
  background: rgba(255, 255, 255, 0.2);
}

.bars {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-height: 120px;
}

.bar {
  flex: 1;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #818cf8 0%, var(--indigo-500) 100%);
  transition: transform 200ms ease;
}

.bars:hover .bar {
  transform: scaleY(1.02);
  transform-origin: bottom;
}

/* ---------- Social proof ---------- */
.logos-section {
  padding: 56px 0;
  background: var(--white);
  border-bottom: 1px solid var(--slate-100);
}

.logos-label {
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate-500);
  margin-bottom: 28px;
}

.logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 24px 56px;
}

.logo-item {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--slate-300);
  filter: grayscale(1);
  opacity: 0.8;
  transition: color var(--transition), filter var(--transition), opacity var(--transition);
}

.logo-item:hover {
  color: var(--navy-900);
  filter: grayscale(0);
  opacity: 1;
}

/* ---------- Features ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  padding: 32px;
  transition: transform var(--transition), border-color var(--transition),
    box-shadow var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--indigo-500);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: #eef2ff;
  color: var(--indigo-500);
  margin-bottom: 20px;
}

.feature-icon svg {
  width: 24px;
  height: 24px;
}

.feature-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--navy-900);
  margin-bottom: 8px;
}

.feature-text {
  font-size: 0.9375rem;
  color: var(--slate-500);
}

/* ---------- How it works ---------- */
.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  counter-reset: step;
  max-width: 900px;
  margin: 0 auto;
}

.step {
  position: relative;
  text-align: center;
  padding: 0 8px;
}

.step-num {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--indigo-500);
  background: #eef2ff;
  border: 2px solid #e0e7ff;
  border-radius: 50%;
}

.step-title {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--navy-900);
  margin-bottom: 8px;
}

.step-text {
  font-size: 0.9375rem;
  color: var(--slate-500);
  max-width: 300px;
  margin: 0 auto;
}

/* ---------- Pricing ---------- */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: stretch;
}

.price-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-2xl);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
}

.price-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.price-card.popular {
  border: 2px solid var(--indigo-500);
  box-shadow: var(--shadow-lg);
}

.price-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  background: var(--indigo-500);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 999px;
  white-space: nowrap;
}

.price-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--navy-900);
  margin-bottom: 12px;
}

.price-amount {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--navy-900);
  margin-bottom: 8px;
  line-height: 1;
}

.price-currency {
  font-size: 1.25rem;
  font-weight: 700;
  vertical-align: super;
  margin-right: 2px;
}

.price-period {
  font-size: 1rem;
  font-weight: 500;
  color: var(--slate-500);
  margin-left: 4px;
}

.price-desc {
  font-size: 0.875rem;
  color: var(--slate-500);
  margin-bottom: 24px;
}

.price-features {
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.price-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9375rem;
  color: var(--slate-700);
}

.price-features svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--indigo-500);
}

/* ---------- Testimonials ---------- */
.testimonial-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.testimonial-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stars {
  display: flex;
  gap: 4px;
  color: var(--amber-400);
}

.stars svg {
  width: 18px;
  height: 18px;
}

.testimonial-quote {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--slate-700);
  flex: 1;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--slate-100);
  padding-top: 20px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}

.avatar-indigo { background: var(--indigo-500); }
.avatar-violet { background: #7c3aed; }
.avatar-sky { background: #0284c7; }

.author-meta {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--navy-900);
}

.author-role {
  font-size: 0.8125rem;
  color: var(--slate-500);
}

/* ---------- FAQ ---------- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.faq-item.open {
  border-color: #c7d2fe;
  box-shadow: var(--shadow-sm);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy-900);
  transition: color var(--transition);
}

.faq-question:hover {
  color: var(--indigo-500);
}

.faq-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--slate-500);
  transition: transform var(--transition), color var(--transition);
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
  color: var(--indigo-500);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 250ms ease;
}

.faq-answer-inner {
  padding: 0 24px 20px;
  font-size: 0.9375rem;
  color: var(--slate-500);
}

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, #312e81 0%, #4f46e5 55%, #6d28d9 100%);
  padding: 96px 0;
}

.cta-inner {
  text-align: center;
  max-width: 640px;
}

.cta-title {
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-bottom: 16px;
}

.cta-sub {
  font-size: 1.125rem;
  color: #c7d2fe;
  margin-bottom: 32px;
}

.cta-note {
  margin-top: 20px;
  font-size: 0.875rem;
  color: #a5b4fc;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-900);
  color: var(--slate-300);
  padding: 72px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-brand .brand-name {
  color: var(--white);
}

.footer-tagline {
  margin-top: 16px;
  font-size: 0.875rem;
  color: var(--slate-500);
  max-width: 280px;
}

.footer-col h4 {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 16px;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  font-size: 0.9375rem;
  color: var(--slate-300);
  transition: color var(--transition);
}

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

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
}

.copyright {
  font-size: 0.875rem;
  color: var(--slate-500);
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #a5b4fc;
  background: rgba(79, 70, 229, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive: sm (640px) ---------- */
@media (min-width: 640px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .testimonial-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }

  /* Connecting line behind step numbers */
  .step::before {
    content: "";
    position: absolute;
    top: 28px;
    left: calc(50% + 40px);
    width: calc(100% - 80px);
    height: 2px;
    background: var(--slate-200);
  }

  .step:last-child::before {
    display: none;
  }
}

/* ---------- Responsive: md (768px) ---------- */
@media (min-width: 768px) {
  .nav-burger {
    display: none;
  }

  .mobile-menu {
    display: none !important;
  }

  .hero-inner {
    grid-template-columns: 1fr 1fr;
    gap: 56px;
  }

  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
  }
}

/* ---------- Responsive: mobile (default / below 768px) ---------- */
@media (max-width: 767px) {
  .nav-links,
  .nav-actions .btn {
    display: none;
  }

  .nav-burger {
    display: flex;
  }

  .section {
    padding: 64px 0;
  }

  .mock-kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .browser-body {
    grid-template-columns: 44px 1fr;
    min-height: 300px;
  }

  .chart-legend {
    display: none;
  }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
