/* Kepo landing page. Tokens and values mirror the app (client/src/index.css and
   tailwind.config.js) so the page matches the product. Dark mode follows the
   visitor's system setting; the app's saved theme lives on another origin and
   cannot be read here. */

:root {
  --canvas: 248 250 252;
  --surface: 255 255 255;
  --sunken: 241 244 248;
  --hover: 244 246 250;
  --line: 226 230 237;
  --ink: 15 23 42;
  --muted: 100 110 130;
  --brand: 51 29 170;
  --accent: var(--brand);
  --accent-hover: 50 36 125;
  --accent-soft: 240 237 253;
  --accent-ink: 50 36 125;
  --accent-fg: 255 255 255;
  --focus: var(--brand);
  --success: 21 128 61;
  --success-soft: 229 246 234;
  --warning: 161 98 7;
  --warning-soft: 254 243 219;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: 15 23 42;
    --surface: 26 34 56;
    --sunken: 33 43 68;
    --hover: 38 49 76;
    --line: 45 56 84;
    --ink: 241 245 249;
    --muted: 148 160 184;
    --accent: 54 29 192;
    --accent-hover: 58 30 209;
    --accent-soft: 49 42 84;
    --accent-ink: 78 50 231;
    --focus: 78 50 231;
    --success: 74 200 140;
    --success-soft: 20 46 35;
    --warning: 236 172 72;
    --warning-soft: 54 42 20;
    color-scheme: dark;
  }
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; border: 0 solid; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; scroll-behavior: smooth; }
body {
  margin: 0;
  background: rgb(var(--canvas));
  color: rgb(var(--ink));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.875rem;
  line-height: 1.375rem;
  font-feature-settings: 'cv11', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: inherit; }
img, svg { display: block; max-width: 100%; }
::selection { background: rgb(var(--accent) / 0.25); }
:focus-visible { outline: 2px solid rgb(var(--focus)); outline-offset: 2px; }

.container { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: 1rem; }
.nowrap { white-space: nowrap; }
.icon { width: 1.125rem; height: 1.125rem; stroke-width: 1.75; flex: none; }
.icon.sm { width: 1rem; height: 1rem; }
.icon.lg { width: 1.25rem; height: 1.25rem; }
.icon.pv { stroke-width: 1.6; }

/* Skip link */
.skip-link {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
}
.skip-link:focus {
  position: fixed; left: 0.75rem; top: 0.75rem; z-index: 50; width: auto; height: auto; margin: 0;
  overflow: visible; clip: auto; white-space: normal;
  border-radius: 0.625rem; background: rgb(var(--surface)); padding: 0.5rem 0.75rem;
  font-weight: 500; box-shadow: 0 24px 48px -12px rgb(0 0 0 / 0.28), 0 0 0 1px rgb(var(--line));
}

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 0.5rem; }
.logo img { width: 1.5rem; height: 1.5rem; }
.logo-word { font-size: 17px; font-weight: 600; line-height: 1; letter-spacing: -0.025em; color: rgb(var(--ink)); }
.home-link { border-radius: 0.625rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border-radius: 0.625rem; font-weight: 500; user-select: none; cursor: pointer;
  transition: background-color 150ms, color 150ms, transform 150ms;
}
.btn:active { transform: scale(0.98); }
.btn-md { height: 2.75rem; padding-inline: 1rem; font-size: 0.875rem; line-height: 1.375rem; }
.btn-sm { height: 2.5rem; padding-inline: 0.75rem; font-size: 0.8125rem; line-height: 1.25rem; }
.btn-primary { background: rgb(var(--accent)); color: rgb(var(--accent-fg)); }
.btn-primary:hover { background: rgb(var(--accent-hover)); }
.btn-secondary { border: 1px solid rgb(var(--line)); background: rgb(var(--surface)); color: rgb(var(--ink)); }
.btn-secondary:hover { background: rgb(var(--hover)); }
.btn-ghost { color: rgb(var(--muted)); }
.btn-ghost:hover { background: rgb(var(--hover)); color: rgb(var(--ink)); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid rgb(var(--line));
  background: rgb(var(--canvas) / 0.85);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.header-inner { display: flex; height: 4rem; align-items: center; justify-content: space-between; gap: 0.75rem; }
.header-nav { display: flex; align-items: center; gap: 0.5rem; }
.nav-manage { display: none; }

/* Hero */
.hero { position: relative; overflow: hidden; }
.hero-glow {
  pointer-events: none; position: absolute; inset-inline: 0; top: 0; height: 520px;
  background: radial-gradient(60% 60% at 50% 0%, rgb(var(--accent) / 0.14), transparent);
}
.hero-grid { position: relative; display: grid; align-items: center; gap: 3rem; padding-top: 3.5rem; padding-bottom: 4rem; }
.hero-copy { text-align: center; }
.hero-title {
  font-size: 2.25rem; line-height: 1.1; font-weight: 600; letter-spacing: -0.025em; text-wrap: balance;
}
.hero-accent { display: block; color: rgb(var(--accent-ink)); }
.hero-lead {
  max-width: 36rem; margin: 1.25rem auto 0; color: rgb(var(--muted));
  font-size: 1rem; line-height: 1.75rem;
}
.cta-row { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 0.75rem; margin-top: 2rem; }
.cta-row-closing { margin-top: 1.75rem; }

/* Preview illustration */
.preview {
  width: 100%; max-width: 28rem; margin-inline: auto; padding: 1rem;
  border: 1px solid rgb(var(--line)); border-radius: 1.25rem; background: rgb(var(--surface));
  box-shadow: 0 24px 48px -12px rgb(0 0 0 / 0.28), 0 0 0 1px rgb(var(--line));
}
.pv-search {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0.75rem;
  border-radius: 0.625rem; background: rgb(var(--sunken)); color: rgb(var(--muted));
  font-size: 0.8125rem; line-height: 1.25rem;
}
.pv-list { margin-top: 1rem; }
.pv-list > * + * { margin-top: 0.625rem; }
.pv-row {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0.75rem;
  border: 1px solid rgb(var(--line)); border-radius: 0.625rem;
}
.pv-icon {
  display: inline-flex; flex: none; width: 2.5rem; height: 2.5rem; align-items: center; justify-content: center;
  border-radius: 0.625rem; background: rgb(var(--sunken)); color: rgb(var(--muted));
}
.pv-text { min-width: 0; flex: 1 1 0%; }
.pv-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.pv-path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.75rem; line-height: 1rem; color: rgb(var(--muted)); }
.pv-badge { display: none; flex: none; }
.pv-caption { margin-top: 1rem; text-align: center; font-size: 0.75rem; line-height: 1rem; color: rgb(var(--muted)); }

.badge {
  display: inline-flex; flex: none; align-items: center; gap: 0.375rem; white-space: nowrap;
  padding: 0.125rem 0.5rem; border-radius: 0.5rem; font-size: 0.75rem; line-height: 1rem; font-weight: 500;
}
.badge .dot { width: 0.375rem; height: 0.375rem; border-radius: 9999px; background: currentColor; }
.badge-success { background: rgb(var(--success-soft)); color: rgb(var(--success)); }
.badge-accent { background: rgb(var(--accent-soft)); color: rgb(var(--accent-ink)); }
.badge-warning { background: rgb(var(--warning-soft)); color: rgb(var(--warning)); }

/* Sections */
.h2 { font-size: 1.5rem; line-height: 2rem; font-weight: 600; letter-spacing: -0.025em; text-wrap: balance; }
.section-head { max-width: 42rem; margin-inline: auto; text-align: center; }
.section-lead { margin-top: 0.75rem; font-size: 1rem; line-height: 1.75rem; color: rgb(var(--muted)); }

.problem { border-block: 1px solid rgb(var(--line)); background: rgb(var(--surface)); }
.section-pad-problem { padding-block: 4rem; }
.problem-list { display: grid; gap: 1rem; max-width: 56rem; margin: 2.5rem auto 0; }
.problem-item {
  padding: 1.25rem; border: 1px solid rgb(var(--line)); border-radius: 1rem;
  background: rgb(var(--canvas)); font-size: 0.875rem; line-height: 1.5rem;
}

.manage { scroll-margin-top: 5rem; }
.section-pad-manage { padding-block: 4rem; }
.feature-grid { display: grid; gap: 1rem; margin-top: 3rem; }
.feature { padding: 1.25rem; border: 1px solid rgb(var(--line)); border-radius: 1rem; background: rgb(var(--surface)); }
.feature-icon {
  display: inline-flex; width: 2.5rem; height: 2.5rem; align-items: center; justify-content: center;
  border-radius: 0.625rem; background: rgb(var(--accent-soft)); color: rgb(var(--accent-ink));
}
.feature-title { margin-top: 1rem; font-size: 1rem; line-height: 1.5rem; font-weight: 600; letter-spacing: -0.01em; }
.feature-body { margin-top: 0.375rem; font-size: 0.875rem; line-height: 1.5rem; color: rgb(var(--muted)); }

.closing { padding: 0 1rem 4rem; }
.closing-box {
  max-width: 56rem; margin-inline: auto; padding: 3rem 1.5rem; text-align: center;
  border: 1px solid rgb(var(--line)); border-radius: 1.25rem; background: rgb(var(--surface));
}
.closing-lead { max-width: 36rem; margin-inline: auto; }

.site-footer { border-top: 1px solid rgb(var(--line)); }
.footer-inner {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding-block: 2rem; font-size: 0.8125rem; line-height: 1.25rem; color: rgb(var(--muted));
}

/* >= 640px (sm) */
@media (min-width: 640px) {
  .container { padding-inline: 1.5rem; }
  .nav-manage { display: inline-flex; }
  .hero-title { font-size: 3rem; }
  .hero-lead { font-size: 1.125rem; line-height: 2rem; }
  .cta-row { flex-direction: row; align-items: center; }
  .btn-wide { padding-inline: 1.5rem; }
  .preview { padding: 1.25rem; }
  .pv-badge { display: block; }
  .h2 { font-size: 1.875rem; line-height: 2.25rem; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .closing { padding-inline: 1.5rem; }
  .closing-box { padding-inline: 2.5rem; }
  .footer-inner { flex-direction: row; }
}

/* >= 768px (md) */
@media (min-width: 768px) {
  .btn-md { height: 2.5rem; }
  .btn-sm { height: 2rem; }
  .hero-grid { padding-top: 5rem; padding-bottom: 6rem; }
  .section-pad-problem { padding-block: 5rem; }
  .section-pad-manage { padding-block: 6rem; }
  .problem-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .closing { padding-bottom: 6rem; }
  .closing-box { padding-block: 3.5rem; }
}

/* >= 1024px (lg) */
@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4rem; }
  .hero-copy { text-align: left; }
  .hero-title { font-size: 3.5rem; }
  .hero-lead { margin-inline: 0; }
  .hero-copy .cta-row { justify-content: flex-start; }
  .feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

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