/* Kitsful Design System - CSS Variables & Component Library */

:root {
  --kf-primary: #1D4ED8;
  --kf-secondary: #14B8A6;
  --kf-accent: #F59E0B;
  --kf-text: #0F172A;
  --kf-muted: #475569;
  --kf-bg: #F8FAFC;
  --kf-surface: #FFFFFF;
  --kf-border: #E2E8F0;

  --kf-radius: 16px;
  --kf-radius-sm: 12px;
  --kf-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --kf-shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.08);

  --kf-maxw: 1100px;
  --kf-font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --kf-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --kf-h1: clamp(2.2rem, 5vw, 3.4rem);
  --kf-h2: clamp(1.6rem, 3vw, 2.2rem);
  --kf-body: 1rem;
  --kf-line: 1.55;

  --kf-space-1: 6px;
  --kf-space-2: 10px;
  --kf-space-3: 14px;
  --kf-space-4: 18px;
  --kf-space-5: 24px;
  --kf-space-6: 32px;
  --kf-space-7: 44px;
  --kf-space-8: 64px;

  --kf-focus: 0 0 0 4px rgba(29, 78, 216, 0.25);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--kf-font);
  font-size: var(--kf-body);
  line-height: var(--kf-line);
  color: var(--kf-text);
  background: var(--kf-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1 {
  font-size: var(--kf-h1);
  font-weight: 700;
  line-height: 1.2;
  color: var(--kf-text);
  margin-bottom: var(--kf-space-5);
}

h2 {
  font-size: var(--kf-h2);
  font-weight: 600;
  line-height: 1.3;
  color: var(--kf-text);
  margin-bottom: var(--kf-space-4);
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--kf-text);
  margin-bottom: var(--kf-space-3);
}

p {
  margin-bottom: var(--kf-space-4);
  color: var(--kf-muted);
}

a {
  color: var(--kf-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #1e40af;
}

a:focus-visible {
  outline: var(--kf-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Layout Utilities */
.container {
  max-width: var(--kf-maxw);
  margin: 0 auto;
  padding: 0 var(--kf-space-5);
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--kf-space-4);
  }
}

.stack {
  display: flex;
  flex-direction: column;
}

.stack > * + * {
  margin-top: var(--kf-space-5);
}

.stack-sm > * + * {
  margin-top: var(--kf-space-3);
}

.stack-lg > * + * {
  margin-top: var(--kf-space-7);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--kf-space-4);
  align-items: center;
}

.grid {
  display: grid;
  gap: var(--kf-space-5);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.section {
  padding: var(--kf-space-8) 0;
}

@media (max-width: 768px) {
  .section {
    padding: var(--kf-space-7) 0;
  }
}

/* Header & Navigation */
.site-header {
  background: var(--kf-surface);
  border-bottom: 1px solid var(--kf-border);
  padding: var(--kf-space-5) 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(248, 250, 252, 0.95);
}

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

.nav-links {
  display: flex;
  gap: var(--kf-space-5);
  list-style: none;
  align-items: center;
}

@media (max-width: 640px) {
  .nav-links {
    gap: var(--kf-space-3);
    font-size: 0.9rem;
  }
}

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

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

.wordmark {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--kf-text);
  letter-spacing: -0.02em;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--kf-space-3) var(--kf-space-5);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--kf-radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  gap: var(--kf-space-2);
}

.btn:focus-visible {
  outline: var(--kf-focus);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--kf-primary);
  color: white;
}

.btn-primary:hover {
  background: #1e40af;
  transform: translateY(-1px);
  box-shadow: var(--kf-shadow-sm);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--kf-secondary);
  color: white;
}

.btn-secondary:hover {
  background: #0d9488;
  transform: translateY(-1px);
  box-shadow: var(--kf-shadow-sm);
}

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

.btn-ghost:hover {
  background: var(--kf-bg);
  border-color: var(--kf-primary);
}

/* Cards */
.card {
  background: var(--kf-surface);
  border: 1px solid var(--kf-border);
  border-radius: var(--kf-radius);
  padding: var(--kf-space-5);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--kf-shadow);
  border-color: var(--kf-primary);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--kf-text);
  margin-bottom: var(--kf-space-2);
}

.card-desc {
  color: var(--kf-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  flex-grow: 1;
  margin-bottom: var(--kf-space-4);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: var(--kf-space-3);
  margin-top: auto;
  padding-top: var(--kf-space-4);
  border-top: 1px solid var(--kf-border);
}

.card-link {
  color: var(--kf-primary);
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: var(--kf-space-1);
}

.card-link:hover {
  gap: var(--kf-space-2);
}

/* Badges & Pills */
.badge {
  display: inline-block;
  padding: var(--kf-space-1) var(--kf-space-3);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  background: var(--kf-accent);
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pill {
  display: inline-block;
  padding: var(--kf-space-2) var(--kf-space-4);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 9999px;
  background: var(--kf-bg);
  color: var(--kf-muted);
  border: 1px solid var(--kf-border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill:hover {
  background: var(--kf-surface);
  border-color: var(--kf-primary);
  color: var(--kf-primary);
}

.pill.active {
  background: var(--kf-primary);
  color: white;
  border-color: var(--kf-primary);
}

/* Hero */
.hero {
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.05) 0%, rgba(20, 184, 166, 0.05) 100%);
  padding: var(--kf-space-8) 0;
  border-radius: var(--kf-radius);
  margin: var(--kf-space-6) 0;
}

.hero-inner {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  margin-bottom: var(--kf-space-4);
}

.hero p {
  font-size: 1.125rem;
  color: var(--kf-muted);
  margin-bottom: var(--kf-space-6);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  gap: var(--kf-space-4);
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .hero-actions {
    flex-direction: column;
  }
  .hero-actions .btn {
    width: 100%;
  }
}

/* Category Filters */
.category-filters {
  display: flex;
  gap: var(--kf-space-3);
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: var(--kf-space-6);
}

/* Trust Section */
.trust-section {
  background: var(--kf-surface);
  border-radius: var(--kf-radius);
  padding: var(--kf-space-7);
  border: 1px solid var(--kf-border);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--kf-space-6);
  margin-top: var(--kf-space-6);
}

.trust-item {
  text-align: center;
}

.trust-item h3 {
  font-size: 1.125rem;
  margin-bottom: var(--kf-space-2);
}

.trust-item p {
  font-size: 0.9rem;
  color: var(--kf-muted);
  margin: 0;
}

/* How It Works */
.how-it-works {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--kf-space-6);
  margin-top: var(--kf-space-6);
}

.how-step {
  text-align: center;
}

.how-step-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--kf-space-4);
  background: var(--kf-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.25rem;
}

.how-step h3 {
  margin-bottom: var(--kf-space-2);
}

.how-step p {
  font-size: 0.9rem;
  margin: 0;
}

/* Footer */
.site-footer {
  background: var(--kf-surface);
  border-top: 1px solid var(--kf-border);
  padding: var(--kf-space-7) 0;
  margin-top: var(--kf-space-8);
  text-align: center;
}

.site-footer p {
  font-size: 0.875rem;
  color: var(--kf-muted);
  margin-bottom: var(--kf-space-2);
}

.site-footer a {
  color: var(--kf-primary);
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mt-0 {
  margin-top: 0;
}

.mb-0 {
  margin-bottom: 0;
}

.hidden {
  display: none;
}

/* Loading State */
.kits-loading {
  text-align: center;
  padding: var(--kf-space-6);
  color: var(--kf-muted);
}

.kits-error {
  text-align: center;
  padding: var(--kf-space-6);
  color: #dc2626;
  background: #fef2f2;
  border-radius: var(--kf-radius-sm);
  border: 1px solid #fecaca;
}
