/* Kelpie site. Dark first; light via prefers-color-scheme. Tokens from the brand kit. */
:root {
  color-scheme: dark light;
  --ground: #1a1a24; --panel: #22222e; --deep: #121219; --line: #2a2a38;
  --ink: #e4e2dc; --body: #b9b7b0; --muted: #9399b2;
  --accent: #d9a066; --on-accent: #1a1a24; --active: #2e2622;
  --grid: rgba(228, 226, 220, .045);
  --working: #f9e2af; --working-t: #f9e2af;
  --waiting: #f38ba8; --waiting-bg: rgba(243, 139, 168, .14);
  --done: #a6e3a1; --done-t: #a6e3a1;
  --stale: #fab387; --stale-t: #fab387;
  --super: #cba6f7;
  --sans: 'IBM Plex Sans', Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: light) {
  :root {
    --ground: #f3f2ee; --panel: #e9e7e1; --deep: #ffffff; --line: #dcdad3;
    --ink: #1f1e24; --body: #4a4950; --muted: #5c5f70;
    --accent: #9a5a1e; --on-accent: #ffffff; --active: #f0e3d3;
    --grid: rgba(31, 30, 36, .06);
    --working: #df8e1d; --working-t: #6e4a00;
    --waiting: #d20f39; --waiting-bg: rgba(210, 15, 57, .1);
    --done: #40a02b; --done-t: #2b6b1d;
    --stale: #fe640b; --stale-t: #9a3c00;
    --super: #8839ef;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--sans); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, p, pre, ul, ol, blockquote { margin: 0; }
pre, code { font-family: var(--mono); }
code { color: var(--ink); font-size: .9em; }
a { color: var(--accent); }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 10; background: var(--accent); color: var(--on-accent); padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 16px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

.pad { padding-left: 40px; padding-right: 40px; }
.wrap { max-width: 1120px; margin: 0 auto; }
.sec { padding-top: 112px; padding-bottom: 112px; }
.ruled { border-top: 1px solid var(--line); }
h2 { font-size: 32px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
h3 { font-weight: 600; letter-spacing: -.01em; line-height: 1.25; text-wrap: pretty; }
p { text-wrap: pretty; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 5; background: var(--ground); border-bottom: 1px solid var(--line); }
.site-header .wrap { height: 60px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--accent); text-decoration: none; }
.brand span { font-size: 18px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); }
.nav { display: flex; gap: 24px; font-size: 14px; margin-left: auto; align-items: center; }
.nav a { color: var(--body); text-decoration: none; }
.nav a:hover { color: var(--ink); }
.nav .soon { color: var(--muted); font-family: var(--mono); font-size: 12.5px; }
.mobile-cta { display: none; margin-left: auto; font-size: 14px; color: var(--accent); text-decoration: none; }

/* Hero */
.hero { position: relative; padding-top: 104px; padding-bottom: 48px; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent);
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 28px; align-items: flex-start; }
.hero-lockup { display: flex; align-items: center; gap: 16px; color: var(--accent); }
.hero-lockup span { font-size: 52px; font-weight: 600; letter-spacing: -.035em; line-height: 1; color: var(--ink); }
.hero h1 { font-size: 60px; font-weight: 600; letter-spacing: -.03em; line-height: 1.02; max-width: 820px; text-wrap: pretty; }
.lede { font-size: 19px; line-height: 1.55; color: var(--body); max-width: 680px; }
.buttons { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 15px; padding: 12px 20px; border-radius: 8px; min-height: 44px; }
.btn small { font-family: var(--mono); font-size: 13px; }
.btn-primary { background: var(--accent); color: var(--on-accent); font-weight: 600; padding: 13px 20px; }
.btn-primary small { font-weight: 500; opacity: .8; }
.btn-primary:hover { color: var(--on-accent); filter: brightness(1.08); }
.btn-secondary { color: var(--ink); font-weight: 500; border: 1px solid var(--line); }
.btn-secondary small { color: var(--muted); }
.btn-secondary:hover { color: var(--ink); border-color: var(--muted); }
.version { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.hero-art { display: flex; justify-content: flex-end; min-width: 0; }
.hero-art svg { display: block; width: 100%; max-width: 560px; height: auto; }

/* Terminal surfaces */
.term { background: var(--deep); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-family: var(--mono); min-width: 0; }
.shot-sec { padding-bottom: 32px; }
.shot-sec .wrap { display: flex; flex-direction: column; gap: 14px; }
.shot { font-size: 13.5px; line-height: 1.6; display: grid; grid-template-columns: 260px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
.shot-top, .shot-bottom { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 9px 16px; color: var(--muted); font-size: 12.5px; flex-wrap: wrap; }
.shot-top { border-bottom: 1px solid var(--line); }
.shot-bottom { gap: 16px; padding: 7px 16px; border-top: 1px solid var(--line); }
.shot-side { border-right: 1px solid var(--line); padding: 10px 0; display: flex; flex-direction: column; min-width: 0; }
.shot-label { padding: 2px 16px 6px; color: var(--muted); font-size: 11px; letter-spacing: .06em; }
.row { display: flex; align-items: center; gap: 10px; padding: 5px 16px; color: var(--ink); }
.row.active { background: var(--active); box-shadow: inset 2px 0 0 var(--accent); }
.row.dim { color: var(--muted); }
.row .glyph { width: 16px; text-align: center; }
.row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .badge { font-size: 12px; }
.waiting-badge { color: var(--waiting); background: var(--waiting-bg); font-weight: 700; font-size: 11.5px; padding: 1px 7px; border-radius: 4px; animation: k-pulse 2.4s ease-in-out infinite; }
.shot-pane { padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; color: var(--body); min-width: 0; min-height: 300px; }
.shot-pane .hl { color: var(--ink); }
.answer { margin: 8px 0; padding: 9px 14px; background: var(--panel); border-radius: 6px; color: var(--ink); display: flex; gap: 10px; }
.receipt { margin-top: auto; padding-top: 12px; color: var(--muted); font-size: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.caption { font-family: var(--mono); font-size: 13px; line-height: 1.6; color: var(--muted); }
.c-working { color: var(--working); } .c-working-t { color: var(--working-t); }
.c-waiting { color: var(--waiting); font-weight: 700; }
.c-done { color: var(--done); } .c-done-t { color: var(--done-t); }
.c-stale { color: var(--stale); } .c-stale-t { color: var(--stale-t); }
.c-super { color: var(--super); }
.c-accent { color: var(--accent); }
@keyframes k-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* Why / credits */
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 40px; align-items: start; }
.split > .span2 { grid-column: span 2; }
.why-quote { font-size: 24px; line-height: 1.5; color: var(--ink); max-width: 720px; padding-left: 28px; border-left: 2px solid var(--accent); }
.credits { display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.credits p { font-size: 17px; line-height: 1.6; color: var(--body); }
.credits .license { font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* Features */
.features { padding-top: 32px; }
.features .wrap, .install .wrap { display: flex; flex-direction: column; gap: 36px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.card { background: var(--panel); border-radius: 10px; padding: 26px 26px 28px; display: flex; flex-direction: column; gap: 12px; }
.card .n { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.card h3 { font-size: 19px; }
.card p { font-size: 15px; line-height: 1.55; color: var(--body); }
.agents-note { display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.6; color: var(--body); max-width: 760px; }
.agents-note b { font-weight: 600; color: var(--ink); }

/* Agentic */
.agentic .wrap { display: flex; flex-direction: column; gap: 64px; }
.agentic-intro { display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.agentic-intro p { font-size: 17px; line-height: 1.6; color: var(--body); }
.duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 40px; align-items: center; }
.duo-copy { display: flex; flex-direction: column; gap: 14px; }
.duo-copy h3 { font-size: 22px; line-height: 1.2; }
.duo-copy h3 + p + p + h3, .duo-copy .gap { margin-top: 12px; }
.duo-copy p { font-size: 15.5px; line-height: 1.6; color: var(--body); }
.dialog-shot { padding: 18px; font-size: 13px; line-height: 1.7; color: var(--body); }
.dialog-head { display: flex; gap: 12px; color: var(--muted); font-size: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.dialog { border: 1px solid var(--super); border-radius: 8px; padding: 14px 18px; background: var(--panel); max-width: 420px; margin: 0 auto; }
.dialog .title { color: var(--ink); font-weight: 500; }
.dialog .state { color: var(--super); font-size: 12px; margin-bottom: 10px; }
.dialog .opts { display: flex; flex-direction: column; }
.dialog .opts span { padding: 0 10px; }
.dialog .opts .sel { background: var(--active); border-radius: 4px; color: var(--ink); }
.dialog .keys { display: flex; gap: 10px; justify-content: center; margin-top: 12px; font-size: 12px; }
.dialog .keys span { padding: 1px 10px; border-radius: 3px; background: var(--line); color: var(--ink); }
.dialog .keys .apply { background: var(--accent); color: var(--on-accent); }
.dialog .foot { color: var(--muted); font-size: 12px; margin-top: 8px; text-align: center; }
.host-shot { padding: 18px 20px; font-size: 12.5px; line-height: 1.7; color: var(--body); }
.tabs { display: flex; gap: 14px; color: var(--muted); flex-wrap: wrap; margin-bottom: 10px; }
.tabs .on { background: var(--accent); color: var(--on-accent); padding: 0 6px; border-radius: 3px; }
.facts { display: grid; grid-template-columns: 72px minmax(0, 1fr); column-gap: 12px; color: var(--ink); }
.tools { display: grid; grid-template-columns: 64px 64px minmax(0, 1fr); column-gap: 12px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.facts span, .tools span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facts .k, .tools .k { color: var(--muted); }

/* Install */
.os-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.os { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.os-head { display: flex; flex-direction: column; gap: 4px; }
.os-head h3 { font-size: 19px; }
.os-head h3 small { font-size: 14px; font-weight: 400; color: var(--muted); }
.os-head .file { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.os ol { padding-left: 20px; font-size: 15px; line-height: 1.6; color: var(--body); display: flex; flex-direction: column; gap: 10px; }
.code { position: relative; margin-top: 8px; background: var(--deep); border: 1px solid var(--line); border-radius: 8px; padding: 14px 72px 14px 16px; overflow-x: auto; }
.code pre { font-size: 13px; line-height: 1.55; color: var(--ink); }
.copy { position: absolute; top: 8px; right: 8px; background: var(--panel); color: var(--muted); border: 1px solid var(--line); border-radius: 5px; font-family: var(--mono); font-size: 11px; padding: 4px 8px; cursor: pointer; }
.copy:hover { color: var(--ink); }
.os .note { font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.keystrip { display: flex; align-items: center; gap: 12px 28px; flex-wrap: wrap; background: var(--panel); border-radius: 10px; padding: 16px 20px; font-family: var(--mono); font-size: 13px; color: var(--body); }
.keystrip .label { color: var(--muted); font-size: 11px; letter-spacing: .06em; }
.keystrip b { color: var(--ink); font-weight: 400; }

/* Footer */
.site-footer { padding-top: 28px; padding-bottom: 40px; border-top: 1px solid var(--line); }
.site-footer .wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.site-footer .wrap > :last-child { margin-left: auto; }

/* 404 */
.notfound { min-height: calc(100vh - 160px); display: flex; align-items: center; }
.notfound .wrap { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
.notfound h1 { font-size: 44px; font-weight: 600; letter-spacing: -.03em; }

@media (max-width: 760px) {
  .pad { padding-left: 20px; padding-right: 20px; }
  .sec { padding-top: 64px; padding-bottom: 64px; }
  .nav { display: none; }
  .mobile-cta { display: inline; }
  .hero { padding-top: 56px; }
  .hero h1 { font-size: 38px; }
  .hero-lockup span { font-size: 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-art { justify-content: center; }
  h2 { font-size: 28px; }
  .shot { grid-template-columns: 1fr; }
  .shot-side { border-right: none; border-bottom: 1px solid var(--line); }
  .shot-pane { min-height: 0; }
  .split > .span2 { grid-column: auto; }
  .why-quote { font-size: 20px; padding-left: 0; border-left: none; }
  .keystrip { flex-direction: column; align-items: flex-start; }
  .os-cols, .duo, .cards { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .waiting-badge { animation: none; }
}
