/* ── kwisatz landing ─────────────────────────────────────────────────
   No webfonts, no CDN, no analytics. Self-hosted is the brand.
   ─────────────────────────────────────────────────────────────────── */

:root {
  --ink-0:   #06080f;
  --ink-1:   #0a0f1c;
  --ink-2:   #101728;
  --ink-3:   #17203559;
  --line:     #22304d;
  --line-soft:#1a2540;
  --line-strong:#2e4166;
  --text:    #dfe6f4;
  --text-dim:#9aa6c2;
  --text-mute:#6c7997;
  --amber:   #f6a723;
  --amber-soft:#f6a72326;
  --cyan:    #4cc9f0;
  --violet:  #a78bfa;
  --green:   #4ade80;
  --red:     #f87171;

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --wrap: 1140px;
  --r: 10px;
  --r-sm: 7px;
  --pad: clamp(1.15rem, 4vw, 2.5rem);
  --sec: clamp(4.5rem, 9vw, 8rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--ink-0);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 .6em; font-weight: 600; }
p { margin: 0 0 1.1em; }
code, .mono { font-family: var(--mono); font-variant-ligatures: none; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-size: .86em; letter-spacing: -0.01em; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--amber); color: #000; padding: .5rem .9rem; border-radius: 6px; }

/* ── nav ── */
.nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px) saturate(1.4);
  background: #06080fd0;
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.nav.is-stuck { border-bottom-color: var(--line-soft); background: #06080fe8; }
.nav__inner { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.2rem); height: 64px; }
.brand { display: flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand__mark {
  display: grid; place-items: center; width: 26px; height: 26px;
  background: linear-gradient(150deg, var(--amber), #e2560b);
  color: #11070300; color: #14080a; border-radius: 7px; font-family: var(--mono);
  font-size: 14px; font-weight: 700;
}
.brand__mark span { opacity: .5; margin-left: 1px; }
.brand__name { font-family: var(--mono); letter-spacing: -0.04em; font-size: 19px; }
.nav__links { display: flex; gap: clamp(.7rem, 2vw, 1.5rem); margin-left: auto; font-size: .93rem; }
@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__inner { justify-content: space-between; }
  body { font-size: 16px; }
}
.nav__links a { color: var(--text-dim); }
.nav__links a:hover, .nav__links a.active { color: var(--text); text-decoration: none; }
.nav__cta { font-size: .85rem !important; }

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1.05rem; border-radius: 8px; font-size: .95rem; font-weight: 550;
  border: 1px solid var(--line); color: var(--text); background: var(--ink-2);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; border-color: var(--line-strong); transform: translateY(-1px); }
.btn--primary { background: var(--amber); border-color: var(--amber); color: #17100a; }
.btn--primary:hover { background: #ffb52e; }
.btn--ghost { background: transparent; }

/* ── hero ── */
.hero { position: relative; padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(3rem, 7vw, 5rem); overflow: hidden; }
.hero__grid {
  position: absolute; inset: -20% -10% auto -10%; height: 130%;
  background:
    radial-gradient(60% 55% at 22% 12%, #f6a72312 0%, transparent 70%),
    radial-gradient(50% 60% at 88% 8%, #4cc9f012 0%, transparent 70%),
    linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0/48px 48px,
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0/48px 48px;
  mask-image: radial-gradient(80% 70% at 50% 15%, #000 20%, transparent 78%);
  pointer-events: none;
}
.hero__inner { position: relative; display: grid; gap: clamp(2rem, 4vw, 3.5rem); align-items: center; grid-template-columns: minmax(0,1fr) minmax(0,.86fr); }
@media (max-width: 980px) { .hero__inner { grid-template-columns: 1fr; } }

.eyebrow { color: var(--amber); font-size: .74rem; letter-spacing: .17em; text-transform: uppercase; margin: 0 0 1.1rem; }
.hero h1 { font-size: clamp(2.5rem, 6.6vw, 4.1rem); margin: 0 0 1rem; }
.hero h1 .line { display: block; }
.hero h1 em { font-style: normal; color: var(--amber); }
.lede { color: var(--text-dim); font-size: clamp(1rem, 1.4vw, 1.13rem); max-width: 56ch; }
.lede strong { color: var(--text); font-weight: 550; }
.hero__formula { display: flex; flex-wrap: wrap; gap: .5rem .6rem; align-items: center; margin: 1.5rem 0 1.9rem; }
.chip {
  font-family: var(--mono); font-size: .78rem; padding: .3rem .65rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--ink-1); color: var(--text-dim); white-space: nowrap;
}
.chip--accent { border-color: #f6a72355; background: var(--amber-soft); color: var(--amber); }
.arrow { color: var(--text-mute); font-size: .85rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .7rem; }

.stats { display: flex; flex-wrap: wrap; gap: clamp(1.4rem, 4vw, 3rem); margin: clamp(2rem, 4vw, 3rem) 0 0; padding: clamp(1.2rem,2vw,1.6rem) 0 0; border-top: 1px solid var(--line-soft); }
.stats div { display: grid; gap: .1rem; }
.stats dt { color: var(--text-mute); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.stats dd { margin: 0; font-family: var(--mono); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

/* terminal */
.term { border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg,#0a1223,#080d18); box-shadow: 0 34px 90px -46px #000, inset 0 1px 0 #ffffff08; }
.term__bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.dot--r { background: #ff5f57; } .dot--y { background: #febc2e; } .dot--g { background: #28c840; }
.term__title { margin-left: 10px; color: var(--text-mute); font-size: 11.5px; }
.term__body { margin: 0; padding: 18px 18px 22px; font-size: 12.6px; line-height: 1.9; min-height: 208px; white-space: pre-wrap; overflow-wrap: anywhere; }
.term__body code { font-family: inherit; }
.prompt { color: var(--green); }
.term .out { display: block; color: var(--text-mute); }
.term .out b { color: var(--cyan); font-weight: 400; }
.caret { display: inline-block; width: 7px; height: 15px; background: var(--amber); vertical-align: -2px; animation: blink 1.1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0 } }

/* ── sections ── */
.sec { padding: var(--sec) 0; }
.sec--alt { background: linear-gradient(180deg, transparent, #0a0f1c98 12%, #0a0f1c98 88%, transparent); border-block: 1px solid var(--line-soft); }
.sec__h { font-size: clamp(1.9rem, 4vw, 2.9rem); max-width: 22ch; }
.sec__intro { color: var(--text-dim); max-width: 66ch; margin-top: -.3em; }
.section-label { display: flex; align-items: center; gap: .75rem; color: var(--text-mute); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; margin: 0 0 1.5rem; }
.section-label span { color: var(--amber); }
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); max-width: 180px; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: none; }

/* ── compare table ── */
.compare { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--ink-1); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.compare th, .compare td { padding: .95rem 1.15rem; text-align: left; border-bottom: 1px solid var(--line-soft); }
.compare thead th { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-mute); border-bottom-color: var(--line); }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: 0; }
.compare tbody th { font-weight: 450; color: var(--text-dim); width: 34%; }
.compare td.kw, .compare th.kw { color: var(--amber); }
.compare td.kw { font-weight: 500; }
.compare td.bad { color: var(--text-mute); }
.compare td.good { color: var(--text); }
.compare tbody tr:hover { background: #f6a72308; }

.callout { border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 0 var(--r) var(--r) 0; background: #f6a7230d; padding: 1.1rem 1.4rem; margin-top: 1.6rem; }
.callout p { margin: 0; color: var(--text-dim); }
.callout strong { color: var(--text); }
.callout--warn { border-left-color: var(--cyan); background: #4cc9f008; }

/* ── split / feature list ── */
.split { display: grid; gap: clamp(2rem, 4vw, 3.5rem); grid-template-columns: minmax(0,1fr) minmax(0,1.05fr); align-items: start; }
@media (max-width: 940px) { .split { grid-template-columns: 1fr; } }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.5rem; }
.feature-list p { margin: .35rem 0 0; color: var(--text-dim); }
.feature-list strong { color: var(--text); font-weight: 550; }
.tag { display: inline-block; font-size: .8rem; color: var(--cyan); background: #4cc9f014; border: 1px solid #4cc9f028; border-radius: 6px; padding: .1rem .5rem; }
.ticks { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: .6rem; color: var(--text-dim); }
.ticks li { padding-left: 1.5rem; position: relative; }
.ticks li::before { content: "▸"; position: absolute; left: 0; color: var(--amber); }

.diagram { margin: 0; border: 1px solid var(--line); border-radius: var(--r); padding: clamp(1rem,2vw,1.6rem); background: radial-gradient(120% 100% at 50% 0%, #0d1526, var(--ink-1)); }
.diagram svg { width: 100%; height: auto; }
.dg-box rect { fill: #0d1526; stroke: var(--line-strong); stroke-width: 1; rx: 8; }
.dg-box text { fill: var(--text); font-family: var(--mono); font-size: 14px; }
.dg-box .sub { fill: var(--text-mute); font-size: 10.5px; }
.dg-box--accent rect { fill: var(--amber-soft); stroke: var(--amber); }
.dg-box--accent text { fill: var(--amber); }
.dg-box--soft rect { fill: #ffffff06; stroke: var(--line); }
.dg-line path { stroke: var(--line-strong); stroke-width: 1.4; fill: none; }
.diagram figcaption { color: var(--text-mute); font-size: .82rem; margin-top: 1rem; text-align: center; }

/* ── steps ── */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.4rem; }
.steps h3 { font-size: 1.25rem; margin: 0; }
.step__head { display: flex; align-items: baseline; gap: .8rem; margin-bottom: .9rem; }
.step__num { color: var(--amber); font-size: .8rem; border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; }
.step__note { color: var(--text-dim); margin: .75rem 0 0; font-size: .94rem; max-width: 74ch; }

/* code blocks must not widen their grid/flex parent */
.steps > li, .split > *, .codes > *, .cli-grid > *, .compare > *, .docgrid > *, .cards > * { min-width: 0; }
pre { max-width: 100%; }

/* ── code blocks ── */
.code { position: relative; border: 1px solid var(--line); border-radius: var(--r); background: #070b14; overflow: hidden; }
.code pre { margin: 0; padding: 1.05rem 1.15rem; overflow-x: auto; font-size: 13px; line-height: 1.75; color: #c8d3ea; }
.code code { font-family: var(--mono); }
.code .copy {
  position: absolute; top: 9px; right: 9px; z-index: 2;
  font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-mute); background: #0e1626; border: 1px solid var(--line); border-radius: 6px;
  padding: 3px 8px; cursor: pointer; opacity: 0; transition: opacity .18s ease, color .18s ease, border-color .18s ease;
}
.code:hover .copy, .copy:focus-visible { opacity: 1; }
.code .copy:hover { color: var(--amber); border-color: var(--amber); }
.code .copy.done { color: var(--green); border-color: var(--green); opacity: 1; }
.code--wide { align-self: start; }

/* ── cli grid ── */
.cli-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 255px), 1fr)); margin: 2rem 0 2.4rem; }
.cli-card { border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.1rem; background: var(--ink-1); transition: border-color .2s, transform .2s, background .2s; }
.cli-card:hover { border-color: var(--line-strong); transform: translateY(-2px); background: var(--ink-2); }
.cli-card code { color: var(--amber); font-size: .87rem; }
.cli-card p { margin: .5rem 0 0; color: var(--text-dim); font-size: .89rem; line-height: 1.5; }

.codes { display: grid; gap: 1.4rem; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); align-items: start; }
@media (max-width: 940px) { .codes { grid-template-columns: 1fr; } }
.exitcodes { border: 1px solid var(--line); border-radius: var(--r); background: var(--ink-1); border-collapse: separate; border-spacing: 0; font-size: .87rem; overflow: hidden; }
.exitcodes caption { text-align: left; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-mute); padding: .8rem 1rem .3rem; }
.exitcodes td { padding: .5rem .9rem; border-top: 1px solid var(--line-soft); color: var(--text-dim); }
.exitcodes td:first-child { color: var(--amber); width: 1%; white-space: nowrap; }
.exitcodes td:nth-child(3) { color: var(--amber); width: 1%; white-space: nowrap; }

/* ── automations ── */
.filters { display: flex; flex-wrap: wrap; gap: 1rem 1.4rem; align-items: center; justify-content: space-between; margin: 2rem 0 1rem; }
.search { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--line); border-radius: 999px; padding: .45rem .9rem; background: var(--ink-1); min-width: min(340px, 100%); flex: 1 1 260px; max-width: 420px; }
.search:focus-within { border-color: var(--amber); }
.search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: .93rem; outline: none; }
.search input::placeholder { color: var(--text-mute); }
.search input::-webkit-search-cancel-button { display: none; }
.kbd { font-family: var(--mono); font-size: 10px; color: var(--text-mute); background: var(--ink-2); border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip-btn {
  font-family: var(--mono); font-size: .74rem; white-space: nowrap; cursor: pointer;
  border: 1px solid var(--line); background: var(--ink-1); color: var(--text-dim);
  padding: .28rem .62rem; border-radius: 999px; transition: all .16s ease;
}
.chip-btn:hover { color: var(--text); border-color: var(--line-strong); }
.chip-btn[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: #17100a; }
.chip-btn b { font-weight: 500; opacity: .6; margin-left: .3rem; }
.count { color: var(--text-mute); font-size: .78rem; letter-spacing: .06em; margin: 0 0 1.2rem; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: .85rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card { overflow-wrap: anywhere; }
.card {
  border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.1rem 1.05rem;
  background: linear-gradient(180deg, var(--ink-1), #090e1a);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: 0 18px 40px -30px #000; }
.card__top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .45rem; }
.card__name { font-family: var(--mono); font-size: .87rem; color: var(--amber); }
.card__kind { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-mute); border: 1px solid var(--line-soft); border-radius: 5px; padding: 1px 5px; }
.card__kind--python { color: var(--cyan); border-color: #4cc9f030; }
.card__cat { font-size: .71rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-mute); margin: 0 0 .4rem; }
.card p { margin: 0; color: var(--text-dim); font-size: .895rem; line-height: 1.55; }
.card[hidden] { display: none; }
.empty { color: var(--text-mute); border: 1px dashed var(--line); border-radius: var(--r); padding: 2.5rem 1rem; text-align: center; }

/* ── docs grid ── */
.docgrid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 275px), 1fr)); margin-top: 2rem; }
.doc {
  display: block; color: inherit; border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.15rem 1.2rem 1rem; background: var(--ink-1); position: relative;
  transition: border-color .2s, transform .2s, background .2s;
}
.doc:hover { text-decoration: none; border-color: var(--amber); transform: translateY(-2px); background: var(--ink-2); }
.doc h3 { font-size: 1.02rem; margin: 0 0 .35rem; }
.doc p { margin: 0 0 .9rem; color: var(--text-dim); font-size: .88rem; line-height: 1.5; }
.doc__go { font-family: var(--mono); font-size: .74rem; color: var(--amber); }

/* ── footer ── */
.foot { border-top: 1px solid var(--line-soft); padding: clamp(2.4rem, 5vw, 3.5rem) 0 2.5rem; background: #04060c; }
.foot__inner { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; align-items: flex-end; }
.foot__brand { font-family: var(--mono); font-weight: 600; font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; margin: 0 0 .5rem; }
.foot__line { margin: .15rem 0; color: var(--text-mute); font-size: .85rem; }
.foot__meta { text-align: right; }
@media (max-width: 720px) { .foot__meta { text-align: left; } }
.foot__self { color: var(--text-mute); font-size: .76rem; line-height: 1.7; margin: 0 0 .9rem; }
.foot__gen { color: var(--line-strong); font-size: .7rem; }

/* ── motion / contrast ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
@media (prefers-contrast: more) {
  :root { --text-dim: #c4cde0; --text-mute: #aab5cd; --line: #3b5178; }
}
