/* ---------- Tokens (mirror the app's HSL theme) ---------- */
:root {
  --bg: hsl(220, 13%, 6%);
  --card: hsl(220, 13%, 8%);
  --muted: hsl(220, 13%, 12%);
  --muted-fg: hsl(215, 14%, 60%);
  --border: hsl(220, 13%, 16%);
  --border-strong: hsl(220, 13%, 22%);
  --fg: hsl(210, 20%, 90%);
  --dim: hsl(220, 9%, 45%);
  --accent: hsl(167, 72%, 65%);
  --accent-2: #8b7af6;
  --claude-brand: #c47b5b;
  --emerald: #34d399;
  --red: #f87171;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, monospace;

  --radius: 0.5rem;
  --radius-lg: 0.625rem;
  --radius-2xl: 1rem;
}

/* ---------- Reset + base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  background-image:
    radial-gradient(1100px 600px at 80% -10%, rgba(139, 122, 246, 0.10), transparent 60%),
    radial-gradient(900px 500px at 0% 5%, rgba(106, 216, 196, 0.08), transparent 60%);
  background-attachment: fixed;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--fg); text-decoration: none; }
a:hover { color: var(--accent); }
code { font-family: var(--font-mono); font-size: 0.92em; }
strong { color: var(--fg); font-weight: 600; }

h1, h2, h3 { letter-spacing: -0.02em; }
h2 { font: 700 1.75rem/1.2 var(--font-sans); margin: 0 0 0.5rem; }
h3 { font: 600 1.05rem/1.3 var(--font-sans); margin: 0.85rem 0 0.4rem; }

.inline-code,
section .lede code,
.section-lede code,
.compare td code,
.term-cmd code {
  color: var(--accent);
  background: rgba(106, 216, 196, 0.08);
  border: 1px solid rgba(106, 216, 196, 0.18);
  padding: 0.05em 0.35em;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.88em;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 6rem 0 5rem;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.hero-glow {
  position: absolute;
  inset: -10% -10% auto -10%;
  height: 70%;
  background:
    radial-gradient(600px 320px at 30% 30%, rgba(106, 216, 196, 0.14), transparent 60%),
    radial-gradient(540px 320px at 70% 50%, rgba(139, 122, 246, 0.13), transparent 60%);
  filter: blur(8px);
  pointer-events: none;
  z-index: 0;
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-copy { max-width: 56ch; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font: 500 0.78rem/1 var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(106, 216, 196, 0.08);
  border: 1px solid rgba(106, 216, 196, 0.30);
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}
.pill-muted {
  color: var(--muted-fg);
  background: rgba(163, 169, 179, 0.05);
  border-color: rgba(163, 169, 179, 0.22);
  margin-bottom: 0.75rem;
}

.wordmark {
  font: 800 clamp(3.25rem, 8vw, 6rem) / 1.0 var(--font-mono);
  letter-spacing: -0.04em;
  margin: 0 0 0.75rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tag {
  font: 600 clamp(1.15rem, 2vw, 1.45rem) / 1.3 var(--font-sans);
  color: var(--fg);
  margin: 0 0 1.25rem;
  letter-spacing: -0.01em;
}
.lede {
  color: var(--muted-fg);
  line-height: 1.65;
  margin: 0 0 2rem;
  max-width: 60ch;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin: 0; }
.cta-row-center { justify-content: center; margin-top: 2rem; }
.cmd {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 0.65rem 1rem;
  font: 500 0.95rem var(--font-mono);
  border-radius: var(--radius-lg);
  color: var(--fg);
}
.cmd::before {
  content: "$ ";
  color: var(--dim);
  margin-right: 0.1rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  padding: 0.6rem 1.05rem;
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  font-weight: 500;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.btn:hover {
  border-color: var(--accent);
  background: var(--muted);
  color: var(--fg);
  transform: translateY(-1px);
}
.btn.primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 600;
}
.btn.primary:hover {
  background: #7fe2cf;
  border-color: #7fe2cf;
  color: var(--bg);
}
.btn-arrow {
  display: inline-block;
  transition: transform 0.18s ease;
}
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ---------- Chat mock (mirrors the actual Klimand chat UI pixel-for-pixel) ---------- */
.chat {
  width: 100%;
  display: flex;
  flex-direction: column;
}
.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;            /* matches gap-y-8 (close enough for hero density) */
  font-family: var(--font-sans);
}

/* User message — right-aligned bubble, bg-muted, rounded-2xl, px-4 py-2.5 */
.msg-user {
  display: flex;
  justify-content: flex-end;
  padding: 0 0.5rem;
}
.msg-user-bubble {
  background: var(--muted);
  color: var(--fg);
  border-radius: var(--radius-2xl);
  padding: 0.625rem 1rem;
  max-width: 85%;
  font-size: 0.94rem;
  line-height: 1.45;
}

/* Assistant text — full width, px-2, leading-relaxed */
.msg-assistant {
  padding: 0 0.5rem;
  color: var(--fg);
  line-height: 1.65;
}
.msg-assistant p { margin: 0; font-size: 0.94rem; }

/* TerminalToolCard — outer wrapper: rounded-lg, border, bg-card, shadow-sm */
.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.02),
    0 20px 50px -20px rgba(0, 0, 0, 0.5),
    0 0 60px -30px rgba(106, 216, 196, 0.18);
}

/* ProviderBrand header — gap-3, border-b, bg-card/60, px-3 py-2 */
.brand-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
  padding: 0.5rem 0.75rem;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}
.brand-mark-claude svg path { fill: var(--claude-brand); }
.brand-mark-openai svg path { fill: var(--fg); }
.brand-wordmark {
  font-weight: 600;
  color: var(--fg);
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}
.brand-divider {
  width: 1px;
  height: 1rem;
  background: var(--border);
}
.brand-workspace {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted-fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  padding: 0.15rem 0.5rem;
  border: 1px solid rgba(106, 216, 196, 0.30);
  background: rgba(106, 216, 196, 0.07);
  border-radius: 999px;
  position: relative;
}
.brand-status::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.4rem;
  vertical-align: 1px;
  animation: pulse-dot 1.4s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(106, 216, 196, 0.6);
}
.brand-status-done {
  color: var(--emerald);
  border-color: rgba(52, 211, 153, 0.30);
  background: rgba(52, 211, 153, 0.07);
}
.brand-status-done::before {
  background: var(--emerald);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
  animation: none;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Terminal — bg-card, rounded, font-mono, header + body */
.term {
  font-family: var(--font-mono);
}
.term-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.015);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 1rem;
}
.term-head-left {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  min-width: 0;
}
.term-head-right {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.term-icon { color: var(--muted-fg); flex-shrink: 0; }
.term-cmd {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.term-cwd { color: var(--muted-fg); margin-right: 0.25rem; }
.term-duration {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted-fg);
  font-variant-numeric: tabular-nums;
}
.term-exit {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted-fg);
  font-variant-numeric: tabular-nums;
}
.term-exit-ok { color: var(--emerald); }

.term-body {
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.82rem;
}
.term-pre {
  margin: 0;
  font-family: var(--font-mono);
  color: var(--fg);
  white-space: pre;
  line-height: 1.55;
}
.term-pre .hl {
  color: var(--accent);
  background: rgba(106, 216, 196, 0.08);
  border-radius: 3px;
  padding: 0 0.2em;
}
.term-pre .ok { color: var(--emerald); font-weight: 600; }

.cursor {
  display: inline-block;
  margin-left: 0.18rem;
  color: var(--accent);
  animation: blink 1.1s steps(2, end) infinite;
}
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ---------- Sections ---------- */
section {
  padding: 5rem 0;
  border-bottom: 1px solid var(--border);
}
.section-lede {
  color: var(--muted-fg);
  max-width: 60ch;
  margin: 0 0 2rem;
  line-height: 1.65;
}

/* ---------- Card grid (features + pro) ---------- */
.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 1rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--muted);
}
.card .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(106, 216, 196, 0.10);
  color: var(--accent);
  border: 1px solid rgba(106, 216, 196, 0.20);
}
.card p {
  color: var(--muted-fg);
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.55;
}

/* ---------- Compare table ---------- */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 1.25rem;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
}
th, td {
  padding: 0.95rem 1.1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
th {
  background: rgba(255, 255, 255, 0.02);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-fg);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.015); }
td:first-child { color: var(--muted-fg); white-space: nowrap; }
@media (max-width: 640px) {
  td:first-child { white-space: normal; }
}

/* ---------- Footer ---------- */
footer {
  border-bottom: none;
  padding: 2.5rem 0 3.5rem;
  color: var(--muted-fg);
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-row p { margin: 0; }
.footer-right a { margin-left: 0.5rem; }
.footer-right a:first-child { margin-left: 0; }
.dot-sep { color: var(--dim); margin: 0 0.4rem; }

/* ---------- Motion ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.fade-in.in-view {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .fade-in { opacity: 1; transform: none; transition: none; }
  .cursor, .brand-status::before { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.05fr 1fr;
    gap: 4rem;
  }
  .hero { padding: 7rem 0 6rem; }
}
@media (max-width: 640px) {
  .hero { padding: 4rem 0 3rem; }
  section { padding: 3.5rem 0; }
  .footer-row { justify-content: flex-start; }
  .term-body { font-size: 0.76rem; }
  .term-cmd { font-size: 0.7rem; }
}
