/* ============================================================
   jkx — landing page
   Single-file stylesheet. No frameworks, no JS dependencies.
   ============================================================ */

:root {
  color-scheme: dark;

  --bg: #07091a;
  --bg-2: #0a0e22;
  --surface: #0f1530;
  --surface-2: #131a3a;
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);

  --text: #e7ecf5;
  --text-strong: #ffffff;
  --muted: #9aa6bf;
  --muted-2: #6b7794;

  --accent: #6366f1;
  --accent-2: #22d3ee;
  --accent-3: #a78bfa;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;

  --radius: 14px;
  --radius-lg: 20px;

  --container: 72rem;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(99, 102, 241, 0.22), transparent 60%),
    radial-gradient(900px 500px at 0% 10%, rgba(34, 211, 238, 0.14), transparent 65%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
code {
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular,
    Menlo, monospace;
  font-size: 0.9em;
  padding: 0.05em 0.35em;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.12);
  color: #e7ecf5;
}

/* ============================================================
   NAV
   ============================================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.9rem max(1.25rem, calc((100vw - var(--container)) / 2));
  backdrop-filter: blur(14px);
  background: rgba(7, 9, 26, 0.7);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-3) 100%);
  color: white;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 6px 18px -6px rgba(99, 102, 241, 0.6);
}

.brand-name { color: var(--text-strong); font-size: 1.05rem; }

.nav-links {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
  font-size: 0.92rem;
  color: var(--muted);
}

.nav-links a { transition: color 0.15s ease; }
.nav-links a:hover { color: var(--text-strong); }

.nav-cta { padding: 0.45rem 0.95rem; font-size: 0.9rem; }

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-cta { margin-left: auto; }
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.15rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%);
  color: white;
  box-shadow: 0 8px 22px -10px rgba(99, 102, 241, 0.7);
}
.btn-primary:hover { transform: translateY(-1px); }

.btn-ghost {
  background: rgba(148, 163, 184, 0.06);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: rgba(148, 163, 184, 0.12); }

/* ============================================================
   LAYOUT HELPERS
   ============================================================ */

.section {
  padding: 6rem max(1.25rem, calc((100vw - var(--container)) / 2));
}

.section-alt {
  background:
    linear-gradient(180deg, transparent, rgba(15, 21, 48, 0.5) 30%, rgba(15, 21, 48, 0.5) 70%, transparent),
    var(--bg);
}

.section-head {
  text-align: center;
  max-width: 44rem;
  margin: 0 auto 3rem;
}

.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.15;
  margin: 0.3rem 0 0.8rem;
  color: var(--text-strong);
  letter-spacing: -0.01em;
}

.section-lede {
  color: var(--muted);
  margin: 0;
  font-size: 1.05rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent-2);
  margin: 0 0 0.4rem;
}

.grad {
  background: linear-gradient(120deg, var(--accent-2) 0%, var(--accent) 50%, var(--accent-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  padding: 5rem max(1.25rem, calc((100vw - var(--container)) / 2)) 4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
}

.hero-copy h1 {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0.4rem 0 1.2rem;
  color: var(--text-strong);
}

.hero-copy h1 .grad { display: block; margin-top: 0.25rem; }

.lede {
  font-size: 1.08rem;
  color: var(--muted);
  margin: 0 0 1.8rem;
  max-width: 36rem;
}

.lede strong { color: var(--text-strong); font-weight: 600; }

.hero-cta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.8rem;
}

.hero-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  color: var(--muted-2);
  font-size: 0.88rem;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.4rem;
  background: var(--muted-2);
  vertical-align: middle;
}

.dot-ok {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
}

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* ============================================================
   BLINKING CURSOR (used in chat input)
   ============================================================ */

.cursor {
  display: inline-block;
  width: 0.55ch;
  background: var(--accent-2);
  color: var(--accent-2);
  animation: blink 1s steps(2) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ============================================================
   CHAT PREVIEW (hero visual)
   ============================================================ */

.chat {
  background: linear-gradient(180deg, #0d1230 0%, #0a0e26 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.chat-bar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 1rem;
  background: rgba(148, 163, 184, 0.06);
  border-bottom: 1px solid var(--border);
  font-size: 0.86rem;
}

.chat-key {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-2);
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.28);
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
}

.chat-title {
  color: var(--text);
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-status {
  font-size: 0.78rem;
  color: var(--muted-2);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.chat-body {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.1rem 1.1rem 0.6rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

.msg { display: flex; flex-direction: column; gap: 0.3rem; max-width: 88%; }
.msg-self    { align-self: flex-end; align-items: flex-end; }
.msg-partner { align-self: flex-start; align-items: flex-start; }

.msg-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  color: var(--muted-2);
}

.msg-name { font-weight: 600; color: var(--muted); }
.msg-time { color: var(--muted-2); }

.msg-avatar {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-3) 100%);
  color: white;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  font-weight: 700;
}

.msg-tag {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-3);
  background: rgba(167, 139, 250, 0.14);
  border: 1px solid rgba(167, 139, 250, 0.32);
  padding: 0.05rem 0.36rem;
  border-radius: 999px;
}

.msg-bubble {
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  color: var(--text);
}

.msg-self .msg-bubble {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.4);
  border-bottom-right-radius: 4px;
}

.msg-partner .msg-bubble {
  background: rgba(148, 163, 184, 0.06);
  border-bottom-left-radius: 4px;
}

.msg-bubble code {
  background: rgba(7, 9, 26, 0.55);
  border: 1px solid var(--border);
  padding: 0.05em 0.36em;
  font-size: 0.86em;
}

.msg-typing {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.35rem;
}

.typing {
  display: inline-flex;
  gap: 4px;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--border);
}

.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-2);
  animation: typing 1.2s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: 0.18s; }
.typing i:nth-child(3) { animation-delay: 0.36s; }

@keyframes typing {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40%           { transform: translateY(-3px); opacity: 1; }
}

.chat-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem 0.85rem;
  border-top: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.04);
  font-size: 0.86rem;
  color: var(--muted-2);
}

.chat-input-hint { font-style: italic; }

/* ============================================================
   CARDS (how it works)
   ============================================================ */

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.card h3 {
  margin: 0.8rem 0 0.55rem;
  color: var(--text-strong);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.card-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.14);
  color: var(--accent-2);
  border: 1px solid rgba(99, 102, 241, 0.32);
}

.card-accent {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.12) 0%, var(--surface-2) 100%);
  border-color: rgba(99, 102, 241, 0.4);
}

.card-accent .card-icon {
  background: rgba(99, 102, 241, 0.22);
  color: white;
}

.tag {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.14);
  color: var(--accent-2);
  border: 1px solid rgba(34, 211, 238, 0.28);
}

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

/* ============================================================
   FEATURES
   ============================================================ */

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.feature {
  padding: 1.4rem;
  border-radius: var(--radius);
  background: rgba(15, 21, 48, 0.55);
  border: 1px solid var(--border);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.feature:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.07);
}

.feature h3 {
  margin: 0.8rem 0 0.4rem;
  font-size: 1.05rem;
  color: var(--text-strong);
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent-2);
  border: 1px solid rgba(34, 211, 238, 0.22);
}

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

/* ============================================================
   FEATURES — compact layout (4 cards, 2x2 on desktop)
   ============================================================ */

.features-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 52rem;
  margin: 0 auto;
}

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

/* ============================================================
   CTA
   ============================================================ */

.cta {
  padding: 5rem max(1.25rem, calc((100vw - var(--container)) / 2)) 6rem;
}

.cta-inner {
  background:
    radial-gradient(60% 80% at 50% 0%, rgba(99, 102, 241, 0.25), transparent 70%),
    linear-gradient(180deg, rgba(99, 102, 241, 0.18) 0%, rgba(34, 211, 238, 0.06) 100%);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  max-width: 56rem;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}

.cta-inner h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--text-strong);
  letter-spacing: -0.01em;
}

.cta-inner p {
  margin: 0 auto 1.5rem;
  max-width: 36rem;
  color: var(--muted);
}

.cta-actions {
  display: inline-flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ============================================================
   FOOTER
   ============================================================ */

.foot {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  padding: 2.5rem max(1.25rem, calc((100vw - var(--container)) / 2));
}

.foot-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  color: var(--muted);
}

.foot-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-weight: 600;
}

.foot-meta {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted-2);
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */

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