/* The buying journey's skin.
 *
 * One rule governs this file: a person walks marketing site → signup → their
 * own Kairo in about four minutes, and it must feel like one product the whole
 * way. Until now it did not — the marketing site used #3b82f6, this page used
 * #38bdf8 and the app used #2f7fd6, three different blues on three surfaces of
 * the same purchase. The tokens below are the marketing site's, because that is
 * the one a customer sees first and the one already public.
 *
 * Shared with operator.html and connect.html, so every class they use
 * (brand mark card lede hint price ticks primary link err foot mono spin tag
 * btn-sm wide wrap big code addr row check steps) still exists.
 */
:root {
  /* ground and structure */
  --bg:        #05070c;   /* the marketing site's ground, exactly */
  --panel:     #0a0e17;
  --panel-2:   #111a27;
  --line:      #1e2a3d;
  --line-soft: #151f2e;

  /* type */
  --ink:       #e8eef8;
  --ink-2:     #c3d0e2;
  --dim:       #8b9cb6;

  /* the one blue, from the marketing site */
  --accent:       #3b82f6;   /* links, marks, focus */
  --accent-solid: #2f6fe0;   /* button fill — deeper, so white text clears 4.5:1 */
  --accent-hover: #4a8cf7;
  --accent-ink:   #ffffff;
  --accent-wash:  rgba(59,130,246,.12);

  /* semantics, kept clear of the accent */
  --good: #0f9d63;
  --warn: #c2664a;   /* the marketing site's warm tone, used once and sparingly */
  --bad:  #e5544b;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 18px 40px -28px rgba(0,0,0,.9);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter Tight", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* A quiet wash behind the fold so the page has depth without a hero image. */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 420px;
  background: radial-gradient(120% 100% at 50% 0%, rgba(59,130,246,.13), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── the field ─────────────────────────────────────────────────────────────
 *
 * Marks drifting behind the purchase, over a faint engineering grid. It is
 * the one place this page is allowed to be decorative, and it earns that by
 * costing nothing: only transform and opacity animate, both of which the
 * compositor handles without touching layout or paint. Nothing here reflows
 * while somebody is typing.
 *
 * Kept deliberately dim. This sits behind a form where a person enters a card
 * number, and anything competing with that text is a bug, not a flourish —
 * the brightest mark is at 7% and the grid at 2.5%.
 */
.field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  color: var(--accent);
  /* The grid. Two hairlines crossed, and a mask so it fades out rather than
     ending on a hard edge against the footer. */
  background-image:
    linear-gradient(to right, rgba(59,130,246,.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(59,130,246,.025) 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px;
  -webkit-mask-image: radial-gradient(130% 90% at 50% 12%, #000 35%, transparent 78%);
          mask-image: radial-gradient(130% 90% at 50% 12%, #000 35%, transparent 78%);
  animation: field-drift 120s linear infinite;
}

.field .k {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
  animation: k-float 1s ease-in-out infinite alternate;
}

/* Each mark gets its own duration and delay, all mutually prime-ish, so the
   set never visibly resets together — the giveaway that would make it read as
   a loop rather than as drift. */
.field .k1 { animation-duration: 29s; animation-delay:  -3s; --amp: 26px; --rot:  7deg; --o: .070; }
.field .k2 { animation-duration: 37s; animation-delay: -11s; --amp: 18px; --rot: -9deg; --o: .055; }
.field .k3 { animation-duration: 23s; animation-delay:  -7s; --amp: 22px; --rot: 11deg; --o: .045; }
.field .k4 { animation-duration: 43s; animation-delay: -19s; --amp: 30px; --rot: -6deg; --o: .060; }
.field .k5 { animation-duration: 31s; animation-delay: -13s; --amp: 14px; --rot: 13deg; --o: .038; }
.field .k6 { animation-duration: 47s; animation-delay:  -5s; --amp: 24px; --rot: -8deg; --o: .050; }

@keyframes k-float {
  from { opacity: calc(var(--o) * .55); transform: translate3d(0, calc(var(--amp) * -1), 0) rotate(calc(var(--rot) * -1)); }
  to   { opacity: var(--o);             transform: translate3d(0, var(--amp), 0) rotate(var(--rot)); }
}

@keyframes field-drift {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 64px 64px, 64px 64px; }
}

/* Motion is decoration here, so it is the first thing to go.
 *
 * Note this does NOT set animation:none. These keyframes animate opacity from
 * a dimmer start, so stopping them dead would strand every mark at its opening
 * frame — visible, and dimmer than intended, which is a worse result than
 * either moving or gone. Freezing them at the end state keeps the composition
 * and drops the movement.
 */
@media (prefers-reduced-motion: reduce) {
  .field { animation: none; }
  .field .k {
    animation-duration: 1ms;
    animation-iteration-count: 1;
    animation-fill-mode: forwards;
    animation-direction: normal;
  }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 30px 20px 72px; }
.wrap.wide { max-width: 900px; }

/* ── masthead ──────────────────────────────────────────────────────────── */
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
/* The real mark, not a letter K in a coloured box — which is what this was,
   on the one page where somebody hands over money. The SVG draws a square
   tile and CSS rounds it, so the corner radius stays one number no matter
   what size the mark is used at. */
.mark {
  width: 32px; height: 32px; border-radius: 10px;
  display: block; overflow: hidden;
  box-shadow: 0 2px 10px rgba(59,130,246,.35);
}
.brand b { font-size: 18.5px; letter-spacing: -.2px; font-weight: 700; }

/* ── the step rail ─────────────────────────────────────────────────────── */
.steps { display: flex; gap: 6px; margin: 0 0 24px; }
.steps i {
  height: 3px; flex: 1; border-radius: 99px; background: var(--line);
  transition: background .35s ease;
}
.steps i.on { background: var(--accent); }

/* ── type ──────────────────────────────────────────────────────────────── */
h1 {
  font-size: clamp(27px, 5.6vw, 34px); line-height: 1.16;
  margin: 0 0 10px; letter-spacing: -.7px; font-weight: 700;
  text-wrap: balance;
}
h2 { font-size: 19.5px; margin: 0 0 6px; letter-spacing: -.3px; font-weight: 650; }
.lede { color: var(--dim); margin: 0 0 22px; max-width: 46ch; }
.mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }

/* ── cards ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card.quiet { background: transparent; box-shadow: none; border-style: dashed; }

/* ── price ─────────────────────────────────────────────────────────────── */
.price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.price b {
  font-size: 38px; letter-spacing: -1.6px; font-weight: 750;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.price span { color: var(--dim); font-size: 14.5px; }

ul.ticks { list-style: none; padding: 0; margin: 14px 0 0; color: var(--ink-2); font-size: 14.7px; }
ul.ticks li { padding: 5px 0 5px 27px; position: relative; }
ul.ticks li::before {
  content: ""; position: absolute; left: 5px; top: 12px;
  width: 5px; height: 9px; border: solid var(--good);
  border-width: 0 2px 2px 0; transform: rotate(43deg);
}

/* ── forms ─────────────────────────────────────────────────────────────── */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 16px 0 6px; letter-spacing: .01em; }
input[type=text], input[type=email], input[type=tel], input[type=password] {
  width: 100%; padding: 12.5px 13px;
  border-radius: 11px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--ink);
  font-size: 16px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #5b6b83; }
input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }

.addr {
  display: flex; align-items: center; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 11px; overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.addr:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.addr input { border: 0; background: transparent; border-radius: 0; text-align: right; }
.addr input:focus { box-shadow: none; }
.addr span {
  padding: 0 13px 0 2px; color: var(--dim); white-space: nowrap;
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13.5px;
}

.hint { font-size: 13.2px; color: var(--dim); margin-top: 6px; }
.hint.ok  { color: var(--good); }
.hint.bad { color: var(--bad); }

.check { display: flex; gap: 11px; align-items: flex-start; margin: 20px 0 6px; color: var(--dim); font-size: 14px; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }

/* the 6-digit code */
input.code {
  text-align: center; letter-spacing: .42em; font-size: 27px; padding: 15px 10px;
  font-family: "JetBrains Mono", ui-monospace, monospace; font-weight: 500;
  text-indent: .42em;   /* re-centres text that letter-spacing pushes left */
}

/* ── buttons ───────────────────────────────────────────────────────────── */
button.primary, a.primary {
  display: block; width: 100%; margin-top: 20px; padding: 14.5px 16px;
  border: 0; border-radius: 12px;
  background: var(--accent-solid); color: var(--accent-ink);
  font-size: 16px; font-weight: 650; font-family: inherit;
  cursor: pointer; text-align: center; text-decoration: none;
  transition: background .15s, transform .06s;
}
button.primary:hover, a.primary:hover { background: var(--accent-hover); text-decoration: none; }
button.primary:active { transform: translateY(1px); }
button.primary:disabled { background: #1a2434; color: #5c6f8a; cursor: not-allowed; }
button.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 14px; padding: 0; }
.btn-sm {
  font: inherit; font-size: 13px; padding: 6px 11px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); cursor: pointer;
}
.btn-sm:hover { border-color: var(--accent); color: var(--accent); }

/* ── feedback ──────────────────────────────────────────────────────────── */
.err {
  background: rgba(229,84,75,.10); border: 1px solid rgba(229,84,75,.32);
  color: #f6c3bf; padding: 11px 13px; border-radius: 11px; margin-top: 14px; font-size: 14px;
}
.note {
  background: var(--accent-wash); border: 1px solid rgba(59,130,246,.28);
  color: var(--ink-2); padding: 11px 13px; border-radius: 11px; margin-top: 14px; font-size: 14px;
}
.tag {
  display: inline-block; font-size: 11.5px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 6px;
  background: var(--panel-2); color: var(--dim); border: 1px solid var(--line);
}
.big { font-size: 42px; text-align: center; line-height: 1; margin-bottom: 10px; }

.spin {
  display: inline-block; width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── policy pages ──────────────────────────────────────────────────────── */
.prose h2 { margin: 26px 0 7px; font-size: 17.5px; color: var(--ink); }
.prose h2:first-child { margin-top: 0; }
.prose p { margin: 0 0 4px; color: var(--ink-2); font-size: 15px; max-width: 66ch; }
.prose ul { color: var(--ink-2); font-size: 15px; padding-left: 20px; }

/* Anything still carrying a placeholder shouts, rather than shipping quietly. */
.todo {
  background: rgba(194,102,74,.14); border: 1px solid rgba(194,102,74,.5);
  color: #f0c3b2; padding: 2px 7px; border-radius: 6px; font-weight: 600;
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .88em;
}

/* ── foot ──────────────────────────────────────────────────────────────── */
.foot {
  margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line-soft);
  color: var(--dim); font-size: 13.4px; text-align: center; line-height: 1.9;
}
.foot a { color: var(--dim); }
.foot a:hover { color: var(--accent); }

@media (max-width: 460px) {
  .row { flex-direction: column; gap: 0; }
  .card { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
