/* ClawPipe Design System — Light-first, Stripe/Linear aesthetic
 * Calm, restrained, product-led. No AI gimmicks.
 */

/* === Tokens === */
:root {
  --white: #ffffff;
  --bg: #fafafa;
  --bg-subtle: #f4f4f5;
  --bg-muted: #e4e4e7;
  --surface: #ffffff;
  --surface-raised: #f8f8fa;

  --border: #e4e4e7;
  --border-subtle: #f0f0f2;

  --text: #18181b;
  --text-secondary: #52525b;
  --text-tertiary: #a1a1aa;
  --text-inverse: #fafafa;

  --accent: #6d28d9;
  --accent-hover: #5b21b6;
  --accent-light: #ede9fe;
  --accent-subtle: #f5f3ff;

  --green: #16a34a;
  --green-light: #dcfce7;
  --red: #dc2626;
  --blue: #2563eb;
  --amber: #d97706;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', SFMono-Regular, Menlo, monospace;

  --max-w: 1140px;
  --max-w-narrow: 720px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 0 0 1px var(--border);

  --transition: 150ms ease;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090b;
    --bg-subtle: #18181b;
    --bg-muted: #27272a;
    --surface: #18181b;
    --surface-raised: #1e1e22;
    --border: #27272a;
    --border-subtle: #1e1e22;
    --text: #fafafa;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --text-inverse: #18181b;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --accent-light: rgba(139,92,246,0.15);
    --accent-subtle: rgba(139,92,246,0.06);
    --white: #18181b;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.2), 0 0 0 1px var(--border);
  }
}

/* === Reset === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

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

/* === Layout === */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: var(--max-w-narrow); margin: 0 auto; padding: 0 24px; }

.section {
  padding: 80px 0;
}
.section-sm { padding: 48px 0; }
.section-lg { padding: 100px 0; }
.section-alt { background: var(--bg-subtle); }

/* === Typography === */
.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

h1, .h1 {
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
}

h2, .h2 {
  font-size: clamp(28px, 3.5vw, 38px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text);
}

h3, .h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
}

.subhead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 600px;
}

.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  min-height: 44px;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-card);
}
.btn-secondary:hover { background: var(--bg-subtle); color: var(--text); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 12px 16px;
}
.btn-ghost:hover { color: var(--text); background: var(--bg-subtle); }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* === Cards === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
}
.card:hover { border-color: var(--border); box-shadow: var(--shadow-md); transform: translateY(-2px); }

.card-sm { padding: 20px; border-radius: var(--radius-md); }
.card-flat { box-shadow: none; }
.card-flat:hover { box-shadow: none; transform: none; }

/* === Grid === */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 48px 0; }
  .section-lg { padding: 64px 0; }
}

/* === Badge === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  color: var(--accent);
}

/* === Code === */
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text);
}

pre {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}

/* === Stat === */
.stat-value {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}
.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* === Logo strip === */
.logo-strip {
  display: flex;
  gap: 32px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.logo-strip span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: -0.01em;
}

/* === Table === */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-tertiary); background: var(--bg-subtle); }
td:first-child { font-weight: 600; }
tr:last-child td { border-bottom: none; }
.yes { color: var(--green); font-weight: 600; }
.no { color: var(--text-tertiary); }

/* === FAQ === */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-q {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-q::after {
  content: '+';
  font-size: 20px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: transform var(--transition);
}
.faq-item.open .faq-q::after { content: '−'; }
.faq-a {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding-top: 0;
}
.faq-item.open .faq-a { max-height: 500px; padding-top: 12px; }

/* === Header === */
.site-header {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  background: rgba(250,250,250,0.85);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
}
@media (prefers-color-scheme: dark) {
  .site-header { background: rgba(9,9,11,0.85); }
}
.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}
.site-header .logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.site-header .logo span { color: var(--accent); }
.site-header nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.site-header nav a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.site-header nav a:hover { color: var(--text); background: var(--bg-subtle); text-decoration: none; }

/* === Footer === */
.site-footer {
  padding: 64px 0 32px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 48px;
}
.footer-grid h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}
.footer-grid a {
  display: block;
  color: var(--text-secondary);
  font-size: 14px;
  padding: 4px 0;
  transition: color var(--transition);
}
.footer-grid a:hover { color: var(--text); text-decoration: none; }
.footer-brand p {
  font-size: 14px;
  color: var(--text-tertiary);
  max-width: 260px;
  margin-top: 8px;
  line-height: 1.5;
}
.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--text-tertiary);
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .site-header nav a { font-size: 13px; padding: 6px 8px; }
}

/* === Pricing === */
.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.price-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.price-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-md);
}
.price-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.price-amount {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 12px 0 4px;
}
.price-amount span { font-size: 16px; font-weight: 400; color: var(--text-secondary); }
.price-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }
.price-features {
  list-style: none;
  margin: 0 0 24px;
  flex: 1;
}
.price-features li {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 6px 0;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.price-features li::before { content: "✓"; color: var(--green); font-weight: 700; flex-shrink: 0; }

/* === Callout === */
.callout {
  background: var(--accent-subtle);
  border: 1px solid var(--accent-light);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-size: 14px;
  color: var(--text);
}

/* === Accessibility === */
.skip-link {
  position: absolute; top: -48px; left: 0;
  background: var(--accent); color: #fff;
  padding: 8px 16px; z-index: 100;
  border-radius: 0 0 6px 0; font-size: 13px;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; color: #fff; }
a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* === Comparison highlight === */
.table-wrap th:nth-child(2) { color: var(--accent); }
.table-wrap td:nth-child(2) { background: var(--accent-subtle); }

/* === Code compare === */
.code-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.code-block { position: relative; }
.code-block .tag {
  position: absolute; top: 12px; right: 12px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 3px 8px; border-radius: var(--radius-full);
}
.code-block.before .tag { background: rgba(220,38,38,0.1); color: var(--red); }
.code-block.after .tag { background: rgba(22,163,74,0.1); color: var(--green); }
@media (max-width: 640px) { .code-compare { grid-template-columns: 1fr; } }

/* === Mobile menu === */
.menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text);
}
.menu-btn svg { display: block; }
@media (max-width: 720px) {
  .menu-btn { display: inline-flex; }
  .site-header nav {
    position: fixed;
    top: 64px;
    left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 8px 16px 16px;
    gap: 4px;
    box-shadow: var(--shadow-lg);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, padding 0.25s ease;
    padding-top: 0;
    padding-bottom: 0;
  }
  .site-header nav.open {
    max-height: 360px;
    padding-top: 8px;
    padding-bottom: 16px;
  }
  .site-header nav a {
    padding: 12px 16px;
    font-size: 15px;
  }
  .site-header nav a.btn {
    margin-top: 8px;
    justify-content: center;
  }
}

/* === Dashboard mockup (hero visual) === */
.dash-mock {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 0;
  overflow: hidden;
  max-width: 980px;
  margin: 56px auto 0;
  position: relative;
}
.dash-mock .chrome {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}
.dash-mock .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bg-muted); }
.dash-mock .url {
  margin-left: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-tertiary);
  background: var(--surface);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}
.dash-mock .body {
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: 320px;
}
.dash-mock .side {
  background: var(--bg-subtle);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
}
.dash-mock .side-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}
.dash-mock .side-item {
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--text-secondary);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-mock .side-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}
.dash-mock .side-item::before {
  content: '';
  width: 14px; height: 14px;
  border-radius: 3px;
  background: currentColor;
  opacity: 0.5;
  flex-shrink: 0;
}
.dash-mock .main {
  padding: 24px;
  background: var(--surface);
}
.dash-mock .stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.dash-mock .stat-cell {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.dash-mock .stat-cell .lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}
.dash-mock .stat-cell .val {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.dash-mock .stat-cell .val.green { color: var(--green); }
.dash-mock .chart {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  height: 160px;
  position: relative;
}
.dash-mock .chart-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}
.dash-mock .bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 100px;
}
.dash-mock .bar {
  flex: 1;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-hover) 100%);
  border-radius: 3px 3px 0 0;
  opacity: 0.85;
}
@media (max-width: 720px) {
  .dash-mock .body { grid-template-columns: 1fr; }
  .dash-mock .side { display: none; }
  .dash-mock .stat-row { grid-template-columns: repeat(2, 1fr); }
  .dash-mock { margin-top: 40px; }
}

/* === Screenshot frame === */
.screenshot-frame {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 4px;
  box-shadow: var(--shadow-lg);
}
.screenshot-frame .titlebar {
  display: flex; gap: 6px; padding: 10px 14px;
}
.screenshot-frame .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.screenshot-frame .content {
  background: var(--surface);
  border-radius: 0 0 calc(var(--radius-xl) - 4px) calc(var(--radius-xl) - 4px);
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  min-height: 200px;
}
