/* ================================================================
   newkp.css — Design System
   The single CSS file for redesigned pages. Page-specific styles
   go in @push('styles') blocks inside each Blade view.

   Source of truth: newkp/DESIGN_SYSTEM.md
   Reference implementation: ref/kprise/index.html
   ================================================================ */

/* ---------- 1. RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: #fff;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }

/* ---------- 2. TOKENS ---------- */
:root {
  /* Color */
  --ink: #0F172A;
  --ink-2: #1E293B;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748B;
  --slate-400: #94A3B8;
  --slate-300: #CBD5E1;
  --slate-200: #E2E8F0;
  --slate-100: #F1F5F9;
  --slate-50: #F8FAFC;
  --bg-soft: #FAFBFC;
  --violet: #7C3AED;
  --violet-light: #A78BFA;
  --green: #16A34A;
  --green-light: #86EFAC;
  --amber: #F59E0B;
  --red: #DC2626;

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Spacing (8px-base) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --s-12: 48px; --s-16: 64px; --s-20: 80px; --s-24: 96px;

  /* Layout */
  --max: 1560px;
  --max-wide: 1720px;
  --gutter: max(20px, calc((100vw - 1560px) / 2 + 32px));
  --header-h: 68px;

  /* Radius */
  --r-sm: 4px;
  --r: 10px;
  --r-md: 12px;
  --r-card: 14px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --shadow-md: 0 4px 12px -2px rgba(15,23,42,.08), 0 2px 4px -2px rgba(15,23,42,.05);
  --shadow-lg: 0 30px 60px -30px rgba(15,23,42,.18), 0 8px 16px -8px rgba(15,23,42,.06);
  --shadow-product: 0 50px 100px -20px rgba(15,23,42,.18), 0 30px 60px -30px rgba(15,23,42,.25), 0 0 0 1px rgba(15,23,42,.04);

  /* Motion */
  --t-fast: .15s cubic-bezier(.65,0,.35,1);
  --t-med: .3s cubic-bezier(.65,0,.35,1);
  --t-slow: .7s cubic-bezier(.65,0,.35,1);
}

/* ---------- 3. TYPOGRAPHY ---------- */
.h1 { font-size: 64px; line-height: 1.02; letter-spacing: -.04em; font-weight: 600; text-wrap: balance; }
@media (max-width: 1023px) { .h1 { font-size: clamp(40px, 5.6vw, 64px); } }

.h2 { font-size: clamp(32px, 4.2vw, 52px); line-height: 1.06; letter-spacing: -.03em; font-weight: 600; text-wrap: balance; }
.h3 { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.2; letter-spacing: -.02em; font-weight: 600; }

.muted { color: var(--slate-500); }
.muted-h2 { color: var(--slate-500); }

.lede {
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.6;
  color: var(--slate-600);
  max-width: 640px;
  text-wrap: pretty;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: .08em;
  color: var(--slate-500); text-transform: uppercase;
  margin-bottom: 20px;
}
.eyebrow::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--ink); }
.eyebrow.dark { color: var(--slate-400); }
.eyebrow.dark::before { background: var(--violet-light); }

/* ---------- 4. BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 22px; border-radius: var(--r);
  font-size: 15px; font-weight: 500;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink); color: #fff;
  box-shadow: 0 1px 0 #fff inset, 0 1px 2px rgba(15,23,42,.2);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15,23,42,.25); }
.btn-primary .arrow { transition: transform var(--t-fast); }
.btn-primary:hover .arrow { transform: translateX(3px); }

.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--slate-200); }
.btn-ghost:hover { background: var(--slate-50); border-color: var(--slate-300); }

.btn-white { background: #fff; color: var(--ink); }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ---------- 5. LAYOUT ---------- */
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 32px; }
@media (max-width: 768px) { .container { padding: 0 20px; } }

.section { padding: 112px 0; }
.section-tight { padding: 72px 0; }
@media (max-width: 768px) {
  .section { padding: 64px 0; }
  .section-tight { padding: 48px 0; }
}
.section-bg-soft { background: var(--bg-soft); border-top: 1px solid var(--slate-200); border-bottom: 1px solid var(--slate-200); }
.section-bg-50 { background: var(--slate-50); border-top: 1px solid var(--slate-200); border-bottom: 1px solid var(--slate-200); }
.section-dark { background: #0B1220; color: #fff; }
.section-dark .h2 { color: #fff; }
.section-dark .lede { color: var(--slate-400); }

/* ---------- 6. NAV (sticky mega) ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--slate-200);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h);
  padding: 0 32px; max-width: var(--max); margin: 0 auto; gap: 24px;
}
@media (max-width: 768px) { .nav-inner { padding: 0 20px; height: 60px; } }

.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-mark { width: 28px; height: 28px; background: var(--ink); border-radius: 7px; display: grid; place-items: center; }
.logo-mark::after { content: ""; width: 12px; height: 12px; background: var(--violet); border-radius: 3px; }
.logo-text { font-weight: 600; font-size: 16px; letter-spacing: -.01em; }
.logo-by { font-size: 10px; color: var(--slate-400); margin-left: 2px; }

.nav-links { display: flex; align-items: center; gap: 0; flex: 1; justify-content: center; }
.nav-item { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 10px 14px; border-radius: 6px;
  font-size: 14px; color: var(--slate-600);
  transition: all var(--t-fast); cursor: pointer;
}
.nav-link:hover, .nav-item.open .nav-link { background: var(--slate-100); color: var(--ink); }
.nav-caret { transition: transform var(--t-fast); font-size: 10px; opacity: .6; }
.nav-item.open .nav-caret { transform: rotate(180deg); }

.nav-cta { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.nav-cta .btn { padding: 9px 16px; font-size: 14px; }

.nav-mobile-btn { display: none; width: 40px; height: 40px; border-radius: 8px; align-items: center; justify-content: center; color: var(--ink); }
.nav-mobile-btn svg { width: 22px; height: 22px; }

.mega {
  position: absolute; top: calc(100% - 1px); left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #fff; border: 1px solid var(--slate-200);
  border-radius: var(--r-card); box-shadow: var(--shadow-lg);
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-med), transform var(--t-med);
  z-index: 60; width: max-content;
}
.nav-item.open .mega { opacity: 1; transform: translateX(-50%) translateY(8px); pointer-events: auto; }
.mega::before { content: ""; position: absolute; top: -12px; left: 0; right: 0; height: 12px; }
.mega-grid { display: grid; gap: 24px; }
.mega-grid.cols-2 { grid-template-columns: 260px 260px; }
.mega-grid.cols-2-feature { grid-template-columns: 240px 240px 300px; }
.mega-grid.cols-1 { grid-template-columns: 1fr; }
.mega-col { display: flex; flex-direction: column; gap: 2px; }
.mega-heading { font-size: 11px; font-weight: 600; color: var(--slate-400); letter-spacing: .06em; text-transform: uppercase; margin: 0 0 8px; padding: 0 12px; }
.mega-item { display: block; padding: 10px 12px; border-radius: 8px; transition: background var(--t-fast); }
.mega-item:hover { background: var(--slate-50); }
.mega-item-title { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.mega-item-desc { font-size: 12px; color: var(--slate-500); line-height: 1.4; }
.mega-feature { background: linear-gradient(135deg, var(--ink), var(--ink-2)); border-radius: 12px; padding: 24px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; }
.mega-feature-badge { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .1em; background: var(--violet-light); color: #1E1B4B; padding: 3px 8px; border-radius: 4px; margin-bottom: 14px; align-self: flex-start; }
.mega-feature-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.mega-feature-desc { font-size: 13px; color: var(--slate-300); line-height: 1.5; margin-bottom: 14px; }
.mega-feature-cta { font-size: 13px; font-weight: 500; color: var(--violet-light); }

/* Mobile drawer */
.mobile-nav { position: fixed; inset: 64px 0 0 0; background: #fff; z-index: 40; overflow-y: auto; padding: 20px 24px 80px; display: none; border-top: 1px solid var(--slate-200); }
.mobile-nav.open { display: block; }
.mobile-section { padding: 14px 0; border-bottom: 1px solid var(--slate-200); }
.mobile-section-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-size: 16px; font-weight: 600; cursor: pointer; }
.mobile-section-head .arrow { transition: transform var(--t-fast); }
.mobile-section.open .mobile-section-head .arrow { transform: rotate(180deg); }
.mobile-section-body { display: none; padding: 8px 0 0; }
.mobile-section.open .mobile-section-body { display: block; }
.mobile-link { display: block; padding: 10px 0; font-size: 14px; color: var(--slate-600); }
.mobile-link strong { display: block; color: var(--ink); font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.mobile-cta { display: grid; gap: 10px; margin-top: 24px; }
.mobile-cta .btn { justify-content: center; }

@media (max-width: 1023px) {
  .nav-links, .nav-cta .btn-ghost { display: none; }
  .nav-mobile-btn { display: inline-flex; }
  .nav-cta .btn-primary { padding: 8px 14px; font-size: 13px; }
}

/* ---------- 7. RATING BAR ---------- */
.rating-bar { display: flex; align-items: center; gap: 24px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--slate-200); flex-wrap: wrap; }
.rating-item { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.rating-item + .rating-item { padding-left: 24px; border-left: 1px solid var(--slate-200); }
.rating-platform { font-size: 12px; font-weight: 700; letter-spacing: .02em; line-height: 1; display: flex; align-items: center; gap: 6px; }
.rating-platform.capterra { color: #FF9D28; }
.rating-platform.softwareadvice { color: #FA8072; }
.rating-platform.getapp { color: #FF5C35; }
.rating-stars { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.stars { position: relative; display: inline-block; color: #E2E8F0; font-size: 13px; letter-spacing: 1px; line-height: 1; }
.stars::before { content: "★★★★★"; }
.stars-fill { position: absolute; top: 0; left: 0; overflow: hidden; color: #0E9F6E; white-space: nowrap; }
.stars-fill::before { content: "★★★★★"; }
.rating-score { font-weight: 700; color: var(--ink); font-size: 13px; }

/* ---------- 8. FOOTER ---------- */
.footer { background: #0B1220; color: #fff; padding: 64px 0 32px; }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 0 32px; display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 48px; }
@media (max-width: 900px) { .footer-inner { grid-template-columns: 1fr 1fr; gap: 40px 24px; } }
@media (max-width: 480px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-brand .logo-mark { background: #fff; }
.footer-brand .logo-mark::after { background: var(--violet-light); }
.footer-brand .logo-text { color: #fff; }
.footer-copy { font-size: 13.5px; color: var(--slate-400); margin: 14px 0 18px; max-width: 300px; line-height: 1.55; }
.footer-aws { font-size: 11px; color: var(--slate-500); font-family: var(--font-mono); }
.footer-head { font-size: 12px; font-weight: 600; color: var(--slate-400); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 16px; }
.footer-link { display: block; font-size: 13.5px; color: var(--slate-300); padding: 6px 0; transition: color var(--t-fast); }
.footer-link:hover { color: #fff; }
.footer-bottom { max-width: var(--max); margin: 48px auto 0; padding: 24px 32px; border-top: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--slate-500); flex-wrap: wrap; gap: 16px; }
.footer-bottom a { color: var(--slate-400); transition: color var(--t-fast); }
.footer-bottom a:hover { color: #fff; }

/* ---------- 9. ACCESSIBILITY ---------- */
.skip-link {
  position: absolute; top: -100%; left: 1rem; z-index: 9999;
  padding: 12px 24px; background: var(--violet); color: #fff;
  border-radius: 0 0 8px 8px; font-weight: 500;
  transition: top var(--t-fast);
}
.skip-link:focus { top: 0; }

:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }

/* ---------- 10. UTILITIES ---------- */
.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;
}

/* ---------- 11. REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
