/* krnali.io
 *
 * Engineering instrument, not SaaS marketing. Closer to a terminal than a landing
 * page (spec 6). Near-black shell, one lighter surface, one border tone, two greys.
 * ONE accent, used sparingly. Semantic colour appears ONLY inside finding cards and
 * is never the sole carrier of meaning: every state carries a word as well.
 *
 * Nothing here shares a token, a scale or a component with the KeyFlux system. That
 * is the clean IP line (spec 6), not a taste preference.
 */

:root {
  --shell:  #08090b;
  --surface:#0e1013;
  --raised: #14171c;
  --border: #21262e;

  --text:   #e6e9ee;
  --muted:  #8b94a3;

  /* Rivers from a mountain. Cold, precise, non-alarming: it suits a tool whose
     whole pitch is that it does not panic. */
  --accent: #6fb3d6;
  --accent-ink: #071016;

  /* Semantic, finding cards only. */
  --warn:   #d9a441;
  --fail:   #d4574e;
  --unknown:#7b8494;

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

  --wrap: 1080px;
  --r: 6px;
}

*, *::before, *::after { box-sizing: border-box; }

/* The nav is sticky, so an anchor jump would otherwise park the target heading
   underneath it. Every jump target clears the nav height plus a little air. */
:target, [id] { scroll-margin-top: 88px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--shell);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  letter-spacing: -0.005em;
}

.wrap { width: min(var(--wrap), calc(100% - 3rem)); margin-inline: auto; }
.mono { font-family: var(--mono); font-size: .82rem; letter-spacing: 0; }
.muted { color: var(--muted); }

h1, h2 { letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 .6em; font-weight: 600; }
h1 { font-size: clamp(1.9rem, 4.4vw, 3.1rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
p { margin: 0 0 1rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Focus is visible everywhere. Keyboard navigation is a requirement (spec 7). */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.sr-only, .skip {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip:focus {
  position: fixed; top: .75rem; left: .75rem;
  width: auto; height: auto; clip-path: none;
  background: var(--accent); color: var(--accent-ink);
  padding: .6rem .9rem; border-radius: var(--r); z-index: 20;
}

/* ---------- nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--shell) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
}
/* Solid on scroll, without JavaScript. */
.nav { border-bottom-color: var(--border); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }

.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand__mark {
  display: block; height: 40px; width: auto;
  /* The mark carries its own colour: white peak, blue rivers. It is not tinted
     with the accent, because the accent was chosen to sit beside it. */
}
.brand__word { font-family: var(--mono); font-size: 1.05rem; letter-spacing: .01em; white-space: nowrap; }

.nav__links { display: flex; align-items: center; gap: 1.4rem; }
/* :not(.btn) matters. `.nav__links a` is specificity (0,1,1) and `.btn` is
   (0,1,0), so without it the muted link colour wins over the button's ink and the
   nav CTA renders light-on-light. Measured 1.33:1 before this, against 8.31:1 for
   the identical button in the hero. */
.nav__links a:not(.btn) { color: var(--muted); font-size: .92rem; }
.nav__links a:not(.btn):hover { color: var(--text); text-decoration: none; }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  background: var(--accent); color: var(--accent-ink);
  padding: .72rem 1.15rem; border-radius: var(--r);
  font-weight: 600; font-size: .95rem; border: 1px solid var(--accent);
  cursor: pointer;
}
.btn:hover { text-decoration: none; filter: brightness(1.07); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--muted); filter: none; }
.btn--sm { padding: .45rem .8rem; font-size: .88rem; }

/* ---------- hero ---------- */

.hero { padding: clamp(3rem, 9vw, 6.5rem) 0 clamp(2.5rem, 6vw, 4rem); }
.hero__grid { display: grid; gap: 3rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 940px) { .hero__grid { grid-template-columns: 1.25fr .75fr; } }

.lede { font-size: 1.09rem; color: var(--muted); max-width: 60ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.6rem 0 1.1rem; }
.hint { margin: 0; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 1.1rem 1.2rem;
}
.card--ghost { opacity: .82; }
.card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .7rem; }
.card__title { font-size: .97rem; margin: 0 0 .9rem; }

.pill {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .04em;
  padding: .18rem .5rem; border-radius: 999px; border: 1px solid;
}
/* The word carries the meaning; colour only reinforces it (spec 7). */
.pill--warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: .3rem .9rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ---------- proof ---------- */

.proof { padding: clamp(2.5rem, 7vw, 5rem) 0; border-top: 1px solid var(--border); }
.section-lede { color: var(--muted); max-width: 62ch; margin-bottom: 1.8rem; }

.terminal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden;
}
.terminal__bar {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .6rem .9rem; background: var(--raised);
  border-bottom: 1px solid var(--border);
}
.terminal__body {
  margin: 0; padding: 1.1rem .9rem;
  overflow-x: auto; line-height: 1.7;
  font-size: .78rem; white-space: pre;
  tab-size: 2;
}
.terminal__body .k { color: var(--muted); }
.terminal__body .v { color: var(--text); }
.terminal__body .w { color: var(--warn); }
.terminal__body .a { color: var(--accent); }

.caption { color: var(--muted); max-width: 62ch; margin-top: 1.4rem; font-size: .97rem; }

/* ---------- cohort ---------- */

.cohort {
  padding: clamp(2.5rem, 7vw, 5rem) 0;
  border-top: 1px solid var(--border);
  background:
    radial-gradient(120% 100% at 50% 0%,
      color-mix(in srgb, var(--accent) 9%, transparent), transparent 62%),
    var(--shell);
}
.cohort__inner { max-width: 60ch; }
.cohort p { color: var(--muted); }

.signup { margin-top: 1.6rem; }
.signup__row { display: flex; gap: .6rem; flex-wrap: wrap; }
.signup input {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--r);
  padding: .7rem .85rem; font: inherit; font-size: .95rem;
  min-width: 0; flex: 1 1 16rem;
}
.signup input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.signup input:focus-visible { border-color: var(--accent); }
.signup__opt { display: block; margin-top: .9rem; color: var(--muted); font-size: .9rem; }
.signup__opt input { margin-top: .4rem; max-width: 10rem; display: block; }
.signup__note { margin: .9rem 0 0; font-size: .86rem; }
.signup__done { margin-top: 1.2rem; color: var(--accent); }

/* ---------- footer ---------- */

.foot { border-top: 1px solid var(--border); padding: 1.6rem 0; }
.foot__inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.foot__inner nav { display: flex; gap: 1.1rem; }
.foot__inner a { color: var(--muted); }

/* Almost no motion, by direction (spec 6). Respect the setting anyway. */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- problem (block 3) ---------- */
.problem { padding: clamp(2.5rem,7vw,5rem) 0; border-top: 1px solid var(--border); }
.beat { font-size: clamp(1.25rem,2.6vw,1.85rem); font-weight: 500; margin: 0 0 1.1rem; max-width: 24ch; letter-spacing: -.02em; }
.beat__close { font-size: 1.02rem; max-width: 54ch; margin-top: 2rem; }

/* ---------- products (block 4) ---------- */
.products { padding: clamp(2.5rem,7vw,5rem) 0; border-top: 1px solid var(--border); }
.prod { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 1.5rem 1.6rem; }
.prod--live { border-color: color-mix(in srgb, var(--accent) 32%, var(--border)); }
.prod + .prod, .prod__pair { margin-top: 1.1rem; }
.prod__pair { display: grid; gap: 1.1rem; grid-template-columns: 1fr; }
@media (min-width: 860px) { .prod__pair { grid-template-columns: 1fr 1fr; } }
.prod__head { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; flex-wrap: wrap; }
.prod h3 { margin: 0; font-size: 1.2rem; letter-spacing: -.01em; }
.prod p { color: var(--muted); }
.prod__state { font-size: .92rem; margin-bottom: 0; }
/* The label is a word first. Colour only reinforces it. */
.pill--live { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.pill--dev  { color: var(--muted);  border-color: var(--border); }
.feats { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: .35rem; }
@media (min-width: 700px) { .feats { grid-template-columns: 1fr 1fr; } }
.feats li { color: var(--text); font-size: .8rem; }
.feats li::before { content: "· "; color: var(--accent); }

/* ---------- how (block 6) ---------- */
.how { padding: clamp(2.5rem,7vw,5rem) 0; border-top: 1px solid var(--border); }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 1.4rem; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(4,1fr); gap: 1.6rem; } }
.steps li { counter-increment: s; color: var(--muted); font-size: .96rem; }
.steps li::before { content: counter(s); display: block; font-family: var(--mono); color: var(--accent); font-size: .8rem; margin-bottom: .5rem; }
.steps b { color: var(--text); font-weight: 600; }

/* ---------- boundaries (block 7) ---------- */
.bounds { padding: clamp(2.5rem,7vw,5rem) 0; background: var(--surface); border-block: 1px solid var(--border); }
.bounds__grid { display: grid; gap: 1.8rem; }
@media (min-width: 860px) { .bounds__grid { grid-template-columns: repeat(3,1fr); } }
.bounds h3 { font-size: 1.02rem; margin: 0 0 .5rem; }
.bounds p { color: var(--muted); font-size: .95rem; margin: 0; }

/* ---------- honest state (block 8) ---------- */
.honest { padding: clamp(2.5rem,7vw,5rem) 0; }
.honest__inner { max-width: 62ch; }
.honest p { color: var(--muted); }
.honest__line { color: var(--text); font-size: 1.1rem; margin-top: 1.4rem; }

/* ---------- fit (block 9) ---------- */
.fit { padding: clamp(2.5rem,7vw,5rem) 0; border-top: 1px solid var(--border); }
.fit__grid { display: grid; gap: 2rem; }
@media (min-width: 760px) { .fit__grid { grid-template-columns: 1fr 1fr; } }
.fit h3 { font-size: 1rem; margin: 0 0 .7rem; }
.fit ul { margin: 0; padding-left: 1.1rem; color: var(--muted); }
.fit li { margin-bottom: .4rem; }

/* ---------- install (block 10) ---------- */
.install { padding: clamp(2.5rem,7vw,5rem) 0; border-top: 1px solid var(--border); }
.install__inner { max-width: 62ch; }
.install p { color: var(--muted); }
code { font-family: var(--mono); font-size: .86em; background: var(--raised); padding: .12em .38em; border-radius: 4px; color: var(--text); }

/* ---------- faq (block 13) ---------- */
.faq { padding: clamp(2.5rem,7vw,5rem) 0; border-top: 1px solid var(--border); }
.faq__inner { max-width: 66ch; }
.faq details { border-bottom: 1px solid var(--border); padding: .9rem 0; }
.faq summary { cursor: pointer; font-size: 1rem; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+"; color: var(--accent); font-family: var(--mono); margin-right: .7rem; }
.faq details[open] summary::before { content: "\2212"; }
.faq details p { color: var(--muted); margin: .7rem 0 0 1.55rem; font-size: .95rem; }
