/* ==========================================================================
   kumulativ — marketing site
   Swiss/editorial system after optimism.io: warm off-white ground, dark
   full-bleed moments, very large display type at regular weight, pill
   controls, generous radii. Kumulativ keeps its own indigo accent.
   Hand-written CSS. No frameworks.
   ========================================================================== */

:root {
  /* ---- surface ---- */
  --bg: #FAFAF9;
  --bg-tint: #F3F3F1;
  --bg-dark: #111111;
  --bg-dark-2: #282827;

  /* ---- ink ---- */
  --ink: #111111;
  --ink-2: rgba(17, 17, 17, 0.60);
  --ink-3: rgba(17, 17, 17, 0.38);
  --on-dark: #FAFAF9;
  --on-dark-2: rgba(250, 250, 249, 0.60);
  --on-dark-3: rgba(250, 250, 249, 0.38);

  /* ---- line ---- */
  --line: #DFDFDC;
  --line-soft: rgba(17, 17, 17, 0.10);
  --line-on-dark: rgba(250, 250, 249, 0.16);
  --line-on-dark-soft: rgba(250, 250, 249, 0.08);

  /* ---- brand ---- */
  --accent: #5E5CE6;
  --accent-ink: #4F4DD6;
  --accent-wash: rgba(94, 92, 230, 0.10);

  /* ---- type ---- */
  --font: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --t-xxl: clamp(3.5rem, 6.6vw, 5.625rem);   /* 56 → 90 */
  --t-xxl-lh: 1.06;
  --t-xl: clamp(2.75rem, 5.2vw, 4.6875rem);  /* 44 → 75 */
  --t-xl-lh: 1.06;
  --t-l: clamp(2rem, 3.4vw, 3rem);           /* 32 → 48 */
  --t-l-lh: 1.12;
  --t-m: clamp(1.625rem, 2.5vw, 2.25rem);    /* 26 → 36 */
  --t-m-lh: 1.14;
  --t-s: clamp(1.25rem, 1.5vw, 1.5rem);      /* 20 → 24 */
  --t-s-lh: 1.3;
  --b-l: 1rem;                               /* 16/26 */
  --b-m: 0.875rem;                           /* 14/22 */
  --b-s: 0.75rem;                            /* 12/16 */
  --b-xs: 0.625rem;                          /* 10/12 */

  /* ---- geometry ---- */
  --shell: 1600px;
  --gutter: clamp(1.25rem, 4.4vw, 4rem);     /* 20 → 64 */
  --section: clamp(4.5rem, 8vw, 7.5rem);     /* 72 → 120 */
  --r-pill: 90px;
  --r-40: 40px;
  --r-20: 20px;
  --r-10: 10px;
  --r-6: 6px;
  --r-2: 2px;

  /* ---- motion (optimism's easing set) ---- */
  --e-quick: 0.22s;
  --e-med: 0.35s;
  --e-slow: 0.6s;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-std: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}
/* Native smooth scroll is only used as the no-JS fallback; the GSAP
   smooth-scroll takes over and sets .kf-smooth on <html>. */
html:not(.kf-smooth) { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--b-l);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.kf-modal-open { overflow: hidden; }

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
/* <i> is used structurally throughout (dots, bars, rules); real emphasis is
   <em>, which the accent picks out rather than italicising. */
i { font-style: normal; }
em { font-style: normal; color: var(--accent-ink); }
.kf-card-dark em, .kf-how em { color: #9C9BF0; }
::selection { background: var(--accent); color: var(--on-dark); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-2);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   Smooth-scroll shell. Inert until site.js opts in, so the page is a normal
   document without JS and under prefers-reduced-motion.
   -------------------------------------------------------------------------- */

html.kf-smooth #smooth-wrapper {
  position: fixed;
  inset: 0;
  overflow: hidden;
  will-change: transform;
}
html.kf-smooth #smooth-content { will-change: transform; }

/* --------------------------------------------------------------------------
   Primitives
   -------------------------------------------------------------------------- */

.kf-shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.kf-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 900px) { .kf-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.kf-mono {
  font-family: var(--mono);
  font-size: var(--b-s);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.kf-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--mono);
  font-size: var(--b-s);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 1.5rem;
}
.kf-num { color: var(--accent); font-family: var(--mono); }

.kf-title-xl { font-size: var(--t-xl); line-height: var(--t-xl-lh); }
.kf-title-l  { font-size: var(--t-l);  line-height: var(--t-l-lh); }
.kf-title-m  { font-size: var(--t-m);  line-height: var(--t-m-lh); }
.kf-title-s  { font-size: var(--t-s);  line-height: var(--t-s-lh); }
.kf-title-xl, .kf-title-l, .kf-title-m, .kf-title-s {
  font-weight: 400;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.kf-dim { color: var(--ink-2); }

.kf-lede {
  font-size: var(--b-l);
  line-height: 1.625;
  color: var(--ink-2);
  max-width: 34rem;
}

.kf-skip {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 300;
  background: var(--ink);
  color: var(--on-dark);
  padding: 0.75rem 1.25rem;
  border-radius: var(--r-pill);
  font-size: var(--b-m);
  text-decoration: none;
  transition: top var(--e-quick) var(--ease);
}
.kf-skip:focus { top: 1rem; }

/* --------------------------------------------------------------------------
   Buttons — pills, 14px, regular weight
   -------------------------------------------------------------------------- */

.kf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 14px 20px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: var(--b-m);
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  transition: background var(--e-quick) var(--ease-std),
              color var(--e-quick) var(--ease-std),
              border-color var(--e-quick) var(--ease-std),
              transform var(--e-quick) var(--ease);
}
.kf-btn:active { transform: scale(0.98); }
.kf-btn-lg { padding: 17px 26px; font-size: var(--b-l); }

/* solid: ink on light ground, paper on dark ground */
.kf-btn-solid { background: var(--ink); color: var(--on-dark); }
.kf-btn-solid:hover { background: var(--bg-dark-2); }

.kf-btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.kf-btn-outline:hover { background: var(--bg-tint); border-color: var(--ink-3); }

/* on a dark ground the pair inverts */
.kf-on-dark .kf-btn-solid { background: var(--on-dark); color: var(--ink); }
.kf-on-dark .kf-btn-solid:hover { background: #fff; }
.kf-on-dark .kf-btn-outline { color: var(--on-dark); border-color: var(--line-on-dark); }
.kf-on-dark .kf-btn-outline:hover { background: rgba(250, 250, 249, 0.08); border-color: var(--on-dark-3); }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.kf-head {
  /* Absolute by default: without JS the header can't re-theme itself as the
     ground changes from dark to light, so it rides away with the hero
     instead of sitting unreadable over the page. */
  position: absolute;
  inset-inline: 0;
  top: 0;
  z-index: 200;
  transition: background var(--e-med) var(--ease-std),
              border-color var(--e-med) var(--ease-std),
              color var(--e-med) var(--ease-std);
  border-bottom: 1px solid transparent;
  color: var(--on-dark);
}
html.kf-js .kf-head { position: fixed; }
.kf-head-inner {
  max-width: var(--shell);
  margin-inline: auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  gap: 2rem;
}
.kf-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: var(--b-l);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.kf-wordmark-mark {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.kf-head-nav {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}
.kf-head-nav a {
  padding: 10px 14px;
  border-radius: var(--r-2);
  font-size: var(--b-m);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity var(--e-quick) var(--ease-std), background var(--e-quick) var(--ease-std);
}
/* Neutral grey tint reads on both the dark and the light ground. */
.kf-head-nav a:hover { opacity: 1; background: rgba(128, 128, 128, 0.16); }

/* scrolled — frosted rail */
.kf-head.is-pinned {
  background: rgba(17, 17, 17, 0.72);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom-color: var(--line-on-dark-soft);
}
/* over light ground */
.kf-head[data-theme="light"] { color: var(--ink); }
.kf-head[data-theme="light"] .kf-btn-solid { background: var(--ink); color: var(--on-dark); }
.kf-head[data-theme="light"].is-pinned {
  background: rgba(250, 250, 249, 0.78);
  border-bottom-color: var(--line-soft);
}
/* dark ground pill inverts */
.kf-head[data-theme="dark"] .kf-btn-solid { background: var(--on-dark); color: var(--ink); }
.kf-head[data-theme="dark"] .kf-btn-solid:hover { background: #fff; }

@media (max-width: 900px) {
  .kf-head-nav { display: none; }
  .kf-head-cta { margin-left: auto; }
}

/* --------------------------------------------------------------------------
   Hero — dark card that shrinks into the statement behind it
   -------------------------------------------------------------------------- */

.kf-heroscroll {
  position: relative;
  height: 150vh;              /* scroll distance for the dissolve */
  background: var(--bg);
}
.kf-hero-pin {
  position: relative;
  height: 100vh;
  height: 100svh;
  width: 100%;
  overflow: hidden;
}

/* the statement revealed underneath */
.kf-hero-outro {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.kf-outro-title {
  font-size: var(--t-l);
  line-height: var(--t-l-lh);
  font-weight: 400;
  letter-spacing: -0.02em;
  max-width: 22ch;
}
.kf-outro-title .kf-dim { display: block; }

.kf-hero-card {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-dark);
  color: var(--on-dark);
  transform-origin: 50% 42%;
  will-change: transform, border-radius, opacity;
}
.kf-hero-canvas { position: absolute; inset: 0; z-index: 0; }
.kf-hero-canvas svg { width: 100%; height: 100%; }

.kf-hero-body {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-top: 96px;
}
.kf-hero-grid { width: 100%; }
.kf-hero-copy { grid-column: 1 / span 8; }
@media (max-width: 900px) { .kf-hero-copy { grid-column: 1 / -1; } }

.kf-hero-copy .kf-eyebrow { color: var(--on-dark-3); }
.kf-hero-title {
  font-size: var(--t-xl);
  line-height: var(--t-xl-lh);
  font-weight: 400;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
}
.kf-mask { display: block; overflow: hidden; padding-bottom: 0.04em; }
.kf-line { display: block; will-change: transform; }
.kf-line-dim { color: var(--on-dark-2); }

.kf-hero-sub {
  max-width: 40ch;
  font-size: var(--b-l);
  line-height: 1.625;
  color: var(--on-dark-2);
  margin-bottom: 2.5rem;
}
.kf-hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.kf-hero-cta .kf-btn-solid { background: var(--on-dark); color: var(--ink); }
.kf-hero-cta .kf-btn-solid:hover { background: #fff; }
.kf-hero-cta .kf-btn-outline { color: var(--on-dark); border-color: var(--line-on-dark); }
.kf-hero-cta .kf-btn-outline:hover { background: rgba(250, 250, 249, 0.08); border-color: var(--on-dark-3); }

.kf-hero-foot {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: 0 var(--gutter) 28px;
  color: var(--on-dark-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.kf-scrollcue { display: inline-flex; align-items: center; gap: 0.6rem; }
.kf-scrollcue i {
  width: 1px; height: 22px;
  background: currentColor;
  transform-origin: top;
  animation: kf-cue 2.2s var(--ease) infinite;
}
@keyframes kf-cue {
  0%   { transform: scaleY(0); opacity: 0; }
  35%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1) translateY(22px); opacity: 0; }
}
@media (max-width: 700px) { .kf-hero-foot .kf-scrollcue { display: none; } }

/* --------------------------------------------------------------------------
   Principles strip
   -------------------------------------------------------------------------- */

.kf-strip {
  position: relative;
  z-index: 2;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding-block: var(--section);
}
.kf-strip-label { margin-bottom: 2.5rem; }
.kf-strip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 5rem);
}
.kf-strip-item { border-top: 1px solid var(--line); padding-top: 1.5rem; }
.kf-strip-item .kf-num { display: block; margin-bottom: 2.5rem; }
.kf-strip-item h3 {
  font-size: var(--t-s);
  line-height: var(--t-s-lh);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.kf-strip-item p { font-size: var(--b-m); line-height: 1.6; color: var(--ink-2); }
@media (max-width: 900px) { .kf-strip-grid { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   Feature stack — cards that pile up
   -------------------------------------------------------------------------- */

.kf-stack { background: var(--bg-dark); color: var(--on-dark); padding-top: var(--section); }
.kf-stack-head { padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.kf-stack-head .kf-eyebrow { color: var(--on-dark-3); }

.kf-stack-track { position: relative; }

.kf-card {
  position: relative;
  height: 100vh;
  height: 100svh;
  padding-inline: var(--gutter);
}
/* The shell is what actually carries the surface. Keeping it separate from
   the pinned <section> means ScrollTrigger's pin transform and the recede
   animation never write to the same matrix. */
.kf-card-shell {
  display: flex;
  align-items: center;
  height: 100%;
  border-radius: var(--r-40);
  overflow: hidden;
  transform-origin: 50% 0;
  will-change: transform, opacity;
}
.kf-card-light .kf-card-shell { background: var(--bg); color: var(--ink); }
.kf-card-tint  .kf-card-shell { background: var(--bg-tint); color: var(--ink); }
.kf-card-dark  .kf-card-shell { background: var(--bg-dark-2); color: var(--on-dark); }

.kf-card-inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  width: 100%;
  max-width: calc(var(--shell) - var(--gutter) * 2);
  margin-inline: auto;
  padding: clamp(2.5rem, 5vw, 4.5rem) clamp(1.75rem, 3.5vw, 4rem);
}
.kf-card-copy .kf-eyebrow { color: inherit; opacity: 0.5; }
.kf-card-dark .kf-eyebrow { color: var(--on-dark-3); opacity: 1; }
.kf-card h3 { margin-bottom: 1.25rem; }
.kf-card .kf-lede { color: inherit; opacity: 0.62; margin-bottom: 2rem; }

.kf-points { display: grid; gap: 1px; border-top: 1px solid currentColor; }
.kf-points { border-color: var(--line-soft); }
.kf-card-dark .kf-points { border-color: var(--line-on-dark); }
.kf-points li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--b-m);
  line-height: 1.55;
  opacity: 0.72;
}
.kf-card-dark .kf-points li { border-bottom-color: var(--line-on-dark); }
.kf-points b {
  display: block;
  font-weight: 500;
  opacity: 1;
  margin-bottom: 0.15rem;
}

@media (max-width: 900px) {
  /* No pinning below 900px — the cards become a plain stacked column. */
  .kf-card { height: auto; padding-bottom: 12px; }
  .kf-card-shell { border-radius: var(--r-20); }
  .kf-card-inner { grid-template-columns: 1fr; }
  .kf-card-visual { order: -1; }
}

/* --------------------------------------------------------------------------
   Vignettes — the little product mock-ups
   -------------------------------------------------------------------------- */

.kf-vig {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-20);
  background: var(--bg);
  padding: clamp(1.5rem, 2.6vw, 2.25rem);
  will-change: transform;
}
.kf-card-tint .kf-vig { background: var(--bg); }
.kf-card-dark .kf-vig {
  background: var(--bg-dark);
  border-color: var(--line-on-dark);
  color: var(--on-dark);
}
.kf-v-meta {
  color: var(--ink-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: var(--b-xs);
}
.kf-card-dark .kf-v-meta { color: var(--on-dark-3); }

/* journal */
.kf-v-journal .kf-v-meta { display: block; margin-bottom: 1.5rem; }
.kf-v-line {
  height: 10px;
  border-radius: var(--r-6);
  background: var(--line);
  margin-bottom: 0.9rem;
}
.kf-v-line.w92 { width: 92%; }
.kf-v-line.w85 { width: 85%; }
.kf-v-line.w78 { width: 78%; }
.kf-v-line.w64 { width: 64%; }
.kf-v-line.w40 { width: 40%; margin-bottom: 0; }
.kf-v-row { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.9rem; }
.kf-chip {
  font-family: var(--mono);
  font-size: var(--b-xs);
  letter-spacing: 0.04em;
  color: var(--accent-ink);
  background: var(--accent-wash);
  border: 1px solid rgba(94, 92, 230, 0.28);
  border-radius: var(--r-pill);
  padding: 0.2rem 0.7rem;
}
.kf-v-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.kf-mood { display: flex; gap: 0.45rem; }
.kf-mood i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.kf-mood i.on { background: var(--accent); }

/* questions */
.kf-v-qtext {
  font-size: var(--t-s);
  line-height: 1.32;
  letter-spacing: -0.02em;
  margin: 1.25rem 0 2.25rem;
}
.kf-v-slider { display: flex; align-items: center; gap: 1rem; }
.kf-v-slider .kf-mono { color: var(--ink-3); white-space: nowrap; font-size: var(--b-xs); }
.kf-v-track {
  position: relative;
  flex: 1;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
}
.kf-v-dot {
  position: absolute;
  top: 50%; left: 62%;
  width: 14px; height: 14px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-wash);
}

/* network */
.kf-v-network { color: var(--on-dark); }
.kf-v-network svg { width: 100%; height: auto; }
.kf-v-inspector {
  position: absolute;
  right: clamp(1rem, 2vw, 1.75rem);
  bottom: clamp(1rem, 2vw, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 11rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line-on-dark);
  border-radius: var(--r-10);
  background: rgba(40, 40, 39, 0.8);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.kf-v-inspector-name { font-size: var(--b-m); }
.kf-v-spark { width: 100%; height: 20px; }

/* companions */
.kf-v-chat { display: flex; flex-direction: column; gap: 0.75rem; }
.kf-bubble {
  max-width: 88%;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-20);
  background: var(--bg-tint);
  font-size: var(--b-m);
  line-height: 1.55;
  color: var(--ink-2);
}
.kf-bubble-user {
  align-self: flex-end;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-dark);
}
.kf-v-who {
  display: block;
  color: var(--accent-ink);
  letter-spacing: 0.16em;
  font-size: var(--b-xs);
  margin-bottom: 0.35rem;
}
.kf-shimmer {
  display: block;
  height: 9px;
  width: 55%;
  margin-top: 0.7rem;
  border-radius: var(--r-6);
  background: linear-gradient(90deg, var(--line) 25%, rgba(17,17,17,0.06) 50%, var(--line) 75%);
  background-size: 200% 100%;
  animation: kf-shimmer 1.6s linear infinite;
}
@keyframes kf-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* --------------------------------------------------------------------------
   Numbers
   -------------------------------------------------------------------------- */

.kf-numbers { background: var(--bg); padding-block: var(--section); }
.kf-numbers-title { margin-bottom: clamp(3rem, 6vw, 5rem); }
.kf-numbers-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-20);
  overflow: hidden;
}
.kf-stat {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
  min-height: 16rem;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  background: var(--bg);
}
.kf-stat-label { font-size: var(--b-m); line-height: 1.5; }
.kf-stat-label .kf-dim { font-size: var(--b-s); }
.kf-stat-value {
  font-size: var(--t-xxl);
  line-height: 1;
  font-weight: 400;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 780px) { .kf-numbers-grid { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   Horizontal gallery
   -------------------------------------------------------------------------- */

.kf-gallery { background: var(--bg-tint); padding-block: var(--section); overflow: hidden; }
.kf-gallery-head { padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.kf-gallery-viewport { width: 100%; }
.kf-gallery-rail {
  display: flex;
  gap: 20px;
  padding-inline: var(--gutter);
  will-change: transform;
}
/* Without JS (or with reduced motion) the rail is a normal swipe row. */
html:not(.kf-hgallery) .kf-gallery-viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
html:not(.kf-hgallery) .kf-gcard { scroll-snap-align: center; }

.kf-gcard {
  flex: none;
  width: min(80vw, 520px);
  padding: clamp(1.5rem, 2.2vw, 2rem);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-20);
}
.kf-gcard .kf-vig {
  background: var(--bg-tint);
  margin-bottom: 1.75rem;
  height: 320px;   /* tall enough for the 12x5 heatmap plus its mood line */
  overflow: hidden;
}
.kf-gcard h3 { margin-bottom: 0.75rem; }
.kf-gcard > p { font-size: var(--b-m); line-height: 1.6; color: var(--ink-2); }

/* swipe cards */
.kf-v-cards { padding: 0; border: 0; background: none !important; }
.kf-swipe {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(70%, 210px);
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-20);
  background: var(--bg);
}
.kf-swipe-b1 { transform: rotate(5deg) translateX(5%); opacity: 0.6; }
.kf-swipe-b2 { transform: rotate(-6deg) translateX(-6%); opacity: 0.35; }
.kf-swipe-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.4rem;
  padding: 1.25rem;
  transform: rotate(-1.5deg);
  box-shadow: 0 24px 48px -28px rgba(17, 17, 17, 0.4);
}
.kf-swipe-emoji { font-size: 2rem; margin-bottom: auto; }
.kf-swipe-title { font-size: var(--b-l); letter-spacing: -0.02em; }
.kf-swipe-actions {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: var(--b-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.kf-swipe-actions .acc { color: var(--accent); }

/* patterns */
.kf-heatmap {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 6px;
  margin: 1rem 0;
}
.kf-heatmap i { aspect-ratio: 1; border-radius: var(--r-2); background: var(--line); }
.kf-heatmap i.l1 { background: rgba(94, 92, 230, 0.30); }
.kf-heatmap i.l2 { background: rgba(94, 92, 230, 0.60); }
.kf-heatmap i.l3 { background: var(--accent); }
.kf-moodline { width: 100%; height: 36px; }

/* finance */
.kf-v-finance { font-size: var(--b-s); color: var(--ink-2); }
.kf-fin-row { display: flex; align-items: baseline; gap: 0.8rem; padding-block: 0.4rem; }
.kf-fin-row i { flex: 1; border-bottom: 1px dotted var(--line); transform: translateY(-3px); }
.kf-fin-row .acc { color: var(--accent-ink); }
.kf-fin-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 62px;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.kf-fin-bars i { flex: 1; height: var(--h); background: var(--line); border-radius: var(--r-2) var(--r-2) 0 0; }
.kf-fin-bars i.acc { background: var(--accent); }

/* peers */
.kf-v-peers { display: flex; flex-direction: column; gap: 1.5rem; align-items: center; }
.kf-peer-pair { display: flex; align-items: center; gap: 1rem; width: 100%; }
.kf-peer-node {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  font-family: var(--mono);
  font-size: var(--b-s);
  color: var(--ink-2);
  flex: none;
}
.kf-peer-node-b { border-color: var(--accent); color: var(--accent-ink); }
.kf-peer-wire { position: relative; flex: 1; height: 1px; background: var(--line); overflow: hidden; }
.kf-peer-wire i {
  position: absolute;
  top: -1px; left: 0;
  width: 30%; height: 3px;
  border-radius: 3px;
  background: var(--accent);
  animation: kf-wire 2.4s var(--ease) infinite;
}
@keyframes kf-wire {
  from { left: -30%; }
  to   { left: 100%; }
}
.kf-peer-result { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; text-align: center; }
.kf-peer-score { font-size: 3rem; line-height: 1; letter-spacing: -0.04em; }
.kf-peer-score i { color: var(--accent); font-size: 1.75rem; }

/* --------------------------------------------------------------------------
   Local model — tabs
   -------------------------------------------------------------------------- */

.kf-local { background: var(--bg); padding-block: var(--section); }
.kf-local-title { margin-bottom: 1.5rem; }
.kf-local-lede { margin-bottom: clamp(2.5rem, 5vw, 4rem); }

.kf-tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}
.kf-tab {
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: var(--b-m);
  color: var(--ink-2);
  transition: background var(--e-quick) var(--ease-std),
              color var(--e-quick) var(--ease-std),
              border-color var(--e-quick) var(--ease-std);
}
.kf-tab:hover { border-color: var(--ink-3); color: var(--ink); }
.kf-tab.is-active { background: var(--ink); border-color: var(--ink); color: var(--on-dark); }

.kf-tabpanels { position: relative; }
/* Without JS the tab bar is inert, so show every panel rather than stranding
   three quarters of the spec behind buttons that do nothing. */
.kf-tablist { display: none; }
html.kf-js .kf-tablist { display: flex; }
html.kf-js .kf-tabpanel { display: none; }
html.kf-js .kf-tabpanel.is-active { display: block; }
.kf-spec {
  display: grid;
  grid-template-columns: minmax(0, 10rem) minmax(0, 1fr);
  gap: clamp(1rem, 4vw, 4rem);
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.kf-spec span {
  color: var(--accent-ink);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: var(--b-xs);
  padding-top: 0.35rem;
}
.kf-spec p { font-size: var(--b-l); color: var(--ink-2); max-width: 46ch; }
@media (max-width: 700px) {
  .kf-spec { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* --------------------------------------------------------------------------
   How it works
   -------------------------------------------------------------------------- */

.kf-how { background: var(--bg-dark); color: var(--on-dark); padding-block: var(--section); }
.kf-how .kf-eyebrow { color: var(--on-dark-3); }
.kf-how .kf-lede { color: var(--on-dark-2); }
.kf-how-head {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: end;
  padding-bottom: clamp(3rem, 6vw, 5rem);
}
.kf-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-on-dark);
  border-top: 1px solid var(--line-on-dark);
  border-bottom: 1px solid var(--line-on-dark);
}
.kf-step {
  background: var(--bg-dark);
  padding: clamp(1.75rem, 3vw, 2.5rem) clamp(1.25rem, 2.5vw, 2rem);
}
.kf-step .kf-num { display: block; color: #9C9BF0; margin-bottom: clamp(3rem, 7vw, 6rem); }
.kf-step h3 { margin-bottom: 0.75rem; }
.kf-step p { font-size: var(--b-m); line-height: 1.6; color: var(--on-dark-2); }
@media (max-width: 900px) {
  .kf-how-head { grid-template-columns: 1fr; align-items: start; }
  .kf-steps { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Download
   -------------------------------------------------------------------------- */

.kf-download { background: var(--bg); padding-block: var(--section); }
.kf-download-head { max-width: 44rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.kf-download-head .kf-title-xl { margin-bottom: 1.25rem; }
.kf-download-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.kf-dl-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  text-align: left;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: var(--r-20);
  background: var(--bg-tint);
  transition: background var(--e-med) var(--ease-std),
              border-color var(--e-med) var(--ease-std),
              transform var(--e-med) var(--ease);
}
.kf-dl-card:hover { border-color: var(--ink); transform: translateY(-4px); }
.kf-dl-os { font-size: var(--t-s); letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.kf-dl-file { color: var(--ink-2); }
.kf-dl-meta { color: var(--ink-3); }
.kf-dl-go {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.75rem;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--on-dark);
  font-size: var(--b-m);
}
.kf-dl-go i { transition: transform var(--e-med) var(--ease); }
.kf-dl-card:hover .kf-dl-go i { transform: translateX(4px); }
.kf-download-note { margin-top: 2rem; color: var(--ink-3); letter-spacing: 0.08em; }
@media (max-width: 780px) { .kf-download-grid { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.kf-foot {
  background: var(--bg-dark);
  color: var(--on-dark);
  padding-top: var(--section);
  overflow: hidden;
}
.kf-foot-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: clamp(3rem, 6vw, 5rem);
}
.kf-foot-line {
  font-size: var(--t-m);
  line-height: var(--t-m-lh);
  letter-spacing: -0.02em;
}
.kf-foot-line .kf-dim { color: var(--on-dark-2); }
.kf-foot-nav { display: flex; flex-wrap: wrap; gap: 1.75rem; align-self: flex-end; }
.kf-foot-nav a {
  font-size: var(--b-m);
  color: var(--on-dark-2);
  text-decoration: none;
  transition: color var(--e-quick) var(--ease-std);
}
.kf-foot-nav a:hover { color: var(--on-dark); }
.kf-foot-mark {
  font-size: clamp(4rem, 19vw, 19rem);
  line-height: 0.82;
  letter-spacing: -0.05em;
  color: rgba(250, 250, 249, 0.10);
  user-select: none;
  margin-bottom: 1.5rem;
}
.kf-foot-fine {
  padding-bottom: 2.5rem;
  color: var(--on-dark-3);
  letter-spacing: 0.08em;
}

/* --------------------------------------------------------------------------
   Download modal
   -------------------------------------------------------------------------- */

.kf-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}
.kf-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: kf-fade var(--e-med) var(--ease);
}
.kf-modal-card {
  position: relative;
  width: min(100%, 440px);
  border-radius: var(--r-20);
  background: var(--bg);
  color: var(--ink);
  padding: 2.25rem;
  box-shadow: 0 40px 100px -30px rgba(17, 17, 17, 0.45);
  animation: kf-rise var(--e-med) var(--ease);
}
@keyframes kf-fade { from { opacity: 0; } }
@keyframes kf-rise { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
.kf-modal-close {
  position: absolute;
  top: 1rem; right: 1.25rem;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink-3);
  transition: color var(--e-quick) var(--ease-std);
}
.kf-modal-close:hover { color: var(--ink); }
.kf-modal-card h3 {
  font-size: var(--t-s);
  line-height: var(--t-s-lh);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}
.kf-modal-meta { display: block; color: var(--ink-3); margin-bottom: 1.5rem; }
.kf-captcha { min-height: 78px; display: grid; place-items: start; }
.kf-dev-banner {
  border: 1px dashed var(--line);
  border-radius: var(--r-10);
  padding: 0.8rem 1rem;
  color: var(--ink-3);
  letter-spacing: 0.06em;
}
.kf-btn-block { width: 100%; margin-top: 1.1rem; }
.kf-modal-note { margin-top: 1.1rem; font-size: var(--b-s); line-height: 1.5; color: var(--ink-3); }

.kf-dl-state { text-align: left; }
.kf-dl-check {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent-wash);
  color: var(--accent-ink);
  margin-bottom: 1.1rem;
}
.kf-dl-check svg { width: 22px; height: 22px; }
.kf-dl-state-title { font-size: var(--b-l); margin-bottom: 0.35rem; }
.kf-dl-state-text { color: var(--ink-2); font-size: var(--b-m); line-height: 1.55; }
.kf-dl-state-fine { display: block; margin-top: 0.9rem; color: var(--ink-3); }
.kf-dl-state-error .kf-dl-state-title { color: #B4451F; }

form.htmx-request { opacity: 0.55; pointer-events: none; }
