/* ============================================================
   Kobytool homepage styles
   ============================================================ */
:root {
  --indigo: #4f46e5;
  --indigo-2: #6366f1;
  --violet: #7c3aed;
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1180px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08), 0 2px 6px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 18px 40px rgba(16, 24, 40, 0.12);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font: "Inter", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- light theme ---------- */
[data-theme="light"] {
  --bg: #f7f8fc;
  --bg-soft: #eef1f8;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --border: #e6e9f0;
  --border-2: #d8dde9;
  --hero-glow: rgba(99, 102, 241, 0.18);
  --card-hover: #fbfbff;
}

/* ---------- dark theme ---------- */
[data-theme="dark"] {
  --bg: #0a0c14;
  --bg-soft: #11141f;
  --surface: #141826;
  --surface-2: #1a1f30;
  --text: #f1f5f9;
  --text-2: #aab4c5;
  --text-3: #6b7689;
  --border: #232838;
  --border-2: #2d3346;
  --hero-glow: rgba(99, 102, 241, 0.22);
  --card-hover: #1a1f30;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
  overflow-x: hidden;
}

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

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  color: #fff; font-weight: 800; font-size: 18px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}
.brand-name { font-size: 19px; letter-spacing: -0.02em; }

.main-nav { display: flex; gap: 4px; }
.main-nav a {
  font-size: 14.5px; font-weight: 500; color: var(--text-2);
  padding: 8px 13px; border-radius: 9px;
  transition: color 0.18s, background 0.18s;
}
.main-nav a:hover { color: var(--text); background: var(--bg-soft); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.btn-icon {
  display: inline-grid; place-items: center;
  min-width: 38px; height: 38px; padding: 0 10px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text-2);
  border-radius: 10px;
  cursor: pointer; font-family: var(--font);
  font-size: 13px; font-weight: 600;
  transition: all 0.18s var(--ease);
}
.btn-icon:hover { color: var(--text); border-color: var(--indigo); transform: translateY(-1px); }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding: 92px 0 64px;
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -180px; left: 50%;
  width: 900px; height: 600px;
  transform: translateX(-50%);
  background: radial-gradient(circle at center, var(--hero-glow), transparent 62%);
  pointer-events: none;
  z-index: 0;
}
.hero-inner { position: relative; z-index: 1; }
.hero-badge {
  display: inline-block;
  font-size: 13px; font-weight: 600;
  color: var(--indigo-2);
  background: color-mix(in srgb, var(--indigo) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--indigo) 25%, transparent);
  padding: 7px 16px; border-radius: 999px;
  margin-bottom: 26px;
}
.hero-title {
  font-size: clamp(34px, 5.2vw, 62px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.06;
  max-width: 16ch;
  margin: 0 auto 22px;
}
.grad {
  background: linear-gradient(120deg, var(--indigo), var(--violet) 55%, #a855f7);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-sub {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--text-2);
  max-width: 60ch;
  margin: 0 auto 34px;
}
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font); font-size: 15.5px; font-weight: 600;
  padding: 13px 26px; border-radius: 12px;
  cursor: pointer; border: 1px solid transparent;
  transition: all 0.2s var(--ease);
}
.btn-primary {
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  color: #fff;
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.38);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(79, 70, 229, 0.48); }
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-2);
}
.btn-ghost:hover { border-color: var(--indigo); transform: translateY(-2px); }

.hero-stats {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 40px; margin-top: 56px;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num {
  font-size: clamp(28px, 3.4vw, 40px); font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--indigo-2), var(--violet));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}
.stat-label { font-size: 13.5px; color: var(--text-3); margin-top: 6px; font-weight: 500; }

/* ============================================================
   TOOLS
   ============================================================ */
.tools-main { padding: 40px 0 30px; }
.tools-head { text-align: center; margin-bottom: 46px; }
.section-title {
  font-size: clamp(26px, 3.4vw, 38px); font-weight: 800;
  letter-spacing: -0.025em; margin-bottom: 12px;
}
.section-lead {
  font-size: 16.5px; color: var(--text-2);
  max-width: 56ch; margin: 0 auto;
}

.cat { margin-bottom: 56px; scroll-margin-top: 90px; }
.cat-head {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 22px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.cat-icon {
  display: grid; place-items: center;
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 12px;
  background: color-mix(in srgb, var(--indigo) 12%, transparent);
  color: var(--indigo-2);
}
.cat-head-text { flex: 1; min-width: 0; }
.cat-title { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.cat-desc { font-size: 14.5px; color: var(--text-2); margin-top: 2px; }
.cat-count {
  flex-shrink: 0;
  font-size: 13px; font-weight: 700; color: var(--indigo-2);
  background: color-mix(in srgb, var(--indigo) 12%, transparent);
  padding: 5px 13px; border-radius: 999px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 16px;
}
.card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease),
    border-color 0.22s var(--ease), background 0.22s var(--ease);
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(var(--indigo), var(--violet));
  opacity: 0;
  transition: opacity 0.22s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--indigo) 40%, var(--border));
  background: var(--card-hover);
}
.card:hover::before { opacity: 1; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-name { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.card-badge {
  flex-shrink: 0; font-size: 13px; color: #f59e0b;
  line-height: 1; margin-top: 2px;
}
.card-desc {
  font-size: 13.8px; color: var(--text-2);
  margin: 7px 0 14px; flex: 1; line-height: 1.55;
}
.card-go {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13.5px; font-weight: 600; color: var(--indigo-2);
  margin-top: auto;
}
.card-go svg { transition: transform 0.22s var(--ease); }
.card:hover .card-go svg { transform: translateX(4px); }
.card-flagship { border-color: color-mix(in srgb, var(--indigo) 24%, var(--border)); }

/* ============================================================
   WHY
   ============================================================ */
.why {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 76px 0;
}
.why .section-title, .why .section-lead { text-align: center; }
.why .section-lead { margin-bottom: 48px; }
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.why-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.why-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.why-icon {
  display: grid; place-items: center;
  width: 50px; height: 50px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  color: #fff; margin-bottom: 18px;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.32);
}
.why-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.01em; }
.why-card p { font-size: 14.5px; color: var(--text-2); line-height: 1.6; }

/* ============================================================
   CTA STRIP
   ============================================================ */
.cta-strip { padding: 84px 0; }
.cta-inner {
  text-align: center;
  background: linear-gradient(135deg, var(--indigo), var(--violet) 70%, #9333ea);
  border-radius: 26px;
  padding: 58px 30px;
  box-shadow: 0 22px 50px rgba(79, 70, 229, 0.4);
  position: relative;
  overflow: hidden;
}
.cta-inner::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 0%, rgba(255,255,255,0.18), transparent 45%);
  pointer-events: none;
}
.cta-inner h2 {
  position: relative;
  font-size: clamp(24px, 3.2vw, 36px); font-weight: 800;
  color: #fff; letter-spacing: -0.02em; margin-bottom: 12px;
}
.cta-inner p { position: relative; color: rgba(255,255,255,0.9); font-size: 17px; margin-bottom: 28px; }
.cta-inner .btn-primary {
  position: relative;
  background: #fff; color: var(--indigo);
  box-shadow: 0 10px 26px rgba(0,0,0,0.18);
}
.cta-inner .btn-primary:hover { background: #f4f4ff; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 54px 0 26px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border);
}
.footer-tag { font-size: 14.5px; color: var(--text-2); margin-top: 14px; max-width: 42ch; line-height: 1.6; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-size: 14.5px; color: var(--text-2); transition: color 0.18s; }
.footer-links a:hover { color: var(--indigo-2); }
.footer-contact { display: flex; flex-direction: column; gap: 8px; }
.footer-contact span { font-size: 13px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.footer-contact a { font-size: 15px; font-weight: 600; color: var(--indigo-2); }
.footer-contact a:hover { text-decoration: underline; }
.footer-bottom {
  padding-top: 22px;
  font-size: 13.5px; color: var(--text-3);
  text-align: center;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .main-nav { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .container { padding: 0 18px; }
  .hero { padding: 64px 0 48px; }
  .hero-stats { gap: 26px; margin-top: 40px; }
  .stat { min-width: 64px; }
  .cards { grid-template-columns: 1fr; }
  .cat-head { flex-wrap: wrap; }
  .cat-count { order: -1; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .cta-inner { padding: 44px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
