/* ============================================================
   CrossKit Design System — single source of truth
   Loaded AFTER dist/style.min.css so these tokens win site-wide.
   Palette: 1 primary + 2 secondary + 1 grayscale ramp.
   No page is allowed to hardcode random hex values.
   ============================================================ */

:root {
  /* ---- Western SaaS Brand — minimal, modern, neutral palette ---- */
  --brand:        #4f46e5;   /* Indigo 600 — primary brand */
  --brand-strong: #4338ca;   /* Indigo 700 — hover/strong */
  --brand-soft:   #eef2ff;   /* Indigo 50 — soft tint */
  --brand-bg:     #f5f3ff;   /* Even softer tint for sections */
  --accent:       #06b6d4;   /* Cyan 500 — secondary accent */
  --accent-2:     #10b981;   /* Emerald 500 — success/good accent */

  /* ---- Neutral grayscale ramp (cool, clean, Stripe-inspired) ---- */
  --gray-0:   #ffffff;
  --gray-50:  #fafafa;
  --gray-100: #f4f4f5;
  --gray-200: #e4e4e7;
  --gray-300: #d4d4d8;
  --gray-400: #a1a1aa;
  --gray-500: #71717a;
  --gray-600: #52525b;
  --gray-700: #3f3f46;
  --gray-800: #27272a;
  --gray-900: #18181b;

  /* ---- Legacy primary tokens (compat) mapped to indigo ramp ---- */
  --primary-50:  #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --primary-800: #3730a3;
  --primary-900: #312e81;

  /* ---- Semantic text (neutral, high contrast) ---- */
  --text-primary:   #18181b;
  --text-secondary: #52525b;
  --text-muted:     #71717a;

  /* ---- Semantic surfaces & borders (cool neutral) ---- */
  --bg-primary:   #ffffff;
  --bg-secondary: #fafafa;
  --bg-tertiary:  #f4f4f5;
  --border-color: #e4e4e7;
  --border-light: #f4f4f5;

  /* ---- Radius scale (softer, modern SaaS) ---- */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  18px;
  --radius-2xl: 24px;
  --radius-pill: 999px;

  /* ---- Shadow scale (soft, diffused, Linear/Stripe inspired) ---- */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, .05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, .08), 0 1px 2px -1px rgba(0, 0, 0, .05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .08), 0 2px 4px -2px rgba(0, 0, 0, .05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .08), 0 4px 6px -4px rgba(0, 0, 0, .05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .08), 0 8px 10px -6px rgba(0, 0, 0, .05);
  --shadow-brand: 0 8px 20px -4px rgba(79, 70, 229, .35);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, .04), 0 1px 2px rgba(0, 0, 0, .02);

  /* ---- Spacing scale (4px base, SaaS-standard) ---- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;

  /* ---- Typography scale (Inter-like system stack, tight SaaS hierarchy) ---- */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Monaco, Consolas, "Liberation Mono", monospace;
  --fs-display: clamp(2.5rem, 5vw, 3.75rem);  /* hero H1 */
  --fs-h1:      clamp(1.875rem, 3.6vw, 2.75rem);  /* section title */
  --fs-h2:      clamp(1.5rem, 2.4vw, 1.875rem);   /* subsection */
  --fs-h3:      1.25rem;                           /* card title */
  --fs-body:    1rem;                              /* body */
  --fs-lead:    1.125rem;                          /* subtitle/lead */
  --fs-sm:      0.875rem;                          /* helper */
  --fs-xs:      0.75rem;                           /* caption */

  --lh-tight: 1.1;
  --lh-snug:  1.3;
  --lh-body:  1.6;

  --fw-regular:   400;
  --fw-medium:    500;
  --fw-semibold:  600;
  --fw-bold:      700;
  --fw-extrabold: 800;
}

/* ---- Unified typography primitives (apply site-wide) ---- */
body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background: var(--bg-primary);
}
h1, h2, h3, h4, h5 { font-family: var(--font-sans); color: var(--text-primary); margin: 0; font-weight: var(--fw-bold); letter-spacing: -0.01em; }
.display { font-size: var(--fs-display); font-weight: var(--fw-extrabold); line-height: var(--lh-tight); letter-spacing: -.025em; }
.eyebrow-text {
  font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: .06em;
  text-transform: uppercase; color: var(--brand);
  display: inline-block; padding: 4px 12px;
  background: var(--brand-soft); border-radius: var(--radius-pill);
}
.lead-text { font-size: var(--fs-lead); line-height: var(--lh-body); color: var(--text-secondary); font-weight: var(--fw-regular); }
.muted-text { font-size: var(--fs-sm); line-height: var(--lh-snug); color: var(--text-muted); }

/* ---- Unified card (SaaS minimal) ---- */
.ck-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--sp-6);
  transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}
.ck-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gray-300);
}

/* ---- Unified buttons (SaaS minimal — Linear/Stripe inspired) ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-sans); font-size: .9rem; font-weight: var(--fw-semibold);
  line-height: 1; padding: .7rem 1.4rem; border-radius: var(--radius-md);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  -webkit-appearance: none; appearance: none; color: inherit;
  transition: all .18s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}
.btn-lg { padding: .9rem 1.75rem; font-size: 1rem; border-radius: var(--radius-md); }
.btn-block { width: 100%; }
.btn-primary, .btn-secondary, .btn-outline, .btn-enterprise {
  font-family: var(--font-sans);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: all .18s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
}
.btn-primary {
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  box-shadow: var(--shadow-brand);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  border-color: var(--gray-400);
  background: var(--bg-secondary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}
.btn-enterprise {
  background: var(--gray-900);
  color: #fff;
  border: 1px solid var(--gray-900);
}
.btn-enterprise:hover {
  background: var(--gray-800);
  border-color: var(--gray-800);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
/* press + keyboard focus (accessibility) */
.btn:active, .btn-primary:active, .btn-secondary:active, .btn-outline:active, .btn-enterprise:active {
  transform: translateY(0) !important;
}
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---- Global image baseline (perf + no layout shift) ---- */
img { max-width: 100%; height: auto; display: block; }

/* ---- Code fragments (clean SaaS dark theme) ---- */
pre, code {
  font-family: var(--font-mono);
}
pre {
  background: #0b1020;
  color: #e2e8f0;
  padding: 24px 28px;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.7;
  border: 1px solid #1e293b;
  box-shadow: var(--shadow-lg);
  position: relative;
}
pre::before {
  content: '';
  position: absolute; top: 14px; left: 20px;
  width: 52px; height: 12px;
  background-image: radial-gradient(circle, #475569 3.5px, transparent 4px);
  background-size: 16px 100%;
  background-repeat: no-repeat;
  pointer-events: none;
}
pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
  border-radius: 0;
}
code {
  background: var(--brand-soft);
  color: var(--brand-strong);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.86em;
  font-weight: 500;
}

/* ---- Navbar brand (solid, Western SaaS) ---- */
.navbar-logo span {
  background: none;
  -webkit-text-fill-color: var(--text-primary);
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

/* ---- Kill leftover Chinese purple-pink gradients ---- */
.btn-gradient {
  background: var(--brand) !important;
  color: #fff !important;
  box-shadow: var(--shadow-sm) !important;
  position: relative;
  overflow: hidden;
}
.btn-gradient::before { display: none !important; }
.btn-gradient:hover {
  background: var(--brand-strong) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-brand) !important;
}

/* ---- Forms (Stripe-like) ---- */
.form-container {
  max-width: 420px;
  margin: 0 auto;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  box-shadow: var(--shadow-card);
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: 6px;
}
.form-group input,
.form-group textarea,
.form-group select,
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: .9375rem;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: border-color .15s ease, box-shadow .15s ease;
  box-sizing: border-box;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.form-control:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* ---- Dashboard (Linear/Stripe app chrome) ---- */
.dashboard { padding: 48px 0 80px; }
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}
.dashboard-header h1 {
  font-size: var(--fs-h1);
  font-weight: var(--fw-extrabold);
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}
.sidebar {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: none;
}
.sidebar h3 {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: 8px 12px 12px;
  font-weight: var(--fw-semibold);
}
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { padding: 0; border: 0; }
.sidebar a {
  display: block;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--fs-sm);
}
.sidebar a:hover { background: var(--bg-secondary); color: var(--text-primary); }
.dashboard .main-content {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: none;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: var(--radius-lg);
  text-align: left;
}
.stat-card:hover { transform: none; box-shadow: none; }
.stat-card .number {
  font-size: 1.5rem;
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.stat-card .label {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  margin-top: 4px;
}

/* ---- Tool catalog (tools.html) ---- */
.tool-page {
  padding: 56px 0 96px;
  background: var(--bg-primary);
  min-height: auto;
}
.tool-page-header {
  text-align: left;
  max-width: 640px;
  margin: 0 0 36px;
}
.tool-page-header::after { display: none; }
.tool-page-header h1 {
  font-size: var(--fs-h1);
  font-weight: var(--fw-extrabold);
  letter-spacing: -0.025em;
  color: var(--text-primary);
  background: none;
  -webkit-text-fill-color: inherit;
  margin-bottom: 12px;
}
.tool-page-header p {
  color: var(--text-secondary);
  font-size: var(--fs-lead);
  max-width: none;
  margin: 0 0 8px;
}

/* ---- Feedback / floating widgets ---- */
.feedback-float-btn {
  background: var(--brand) !important;
  box-shadow: var(--shadow-md) !important;
  border-radius: var(--radius-pill) !important;
}

@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}
