/* ══════════════════════════════════════════════════════════════════════
   kappaemme.dev — shared system v3 (/coffee, /grok-bot, /skills)
   Source of truth for Codex → assets/site.css. Spec: design/restyle/SPEC.md §v3
   Paper base; small dark objects and blue blocks re-scope the same tokens.
   Signature motif: the caret (nav, terminal, scan line, typed wordmark). Everything animates transform/opacity only.
   ══════════════════════════════════════════════════════════════════════ */

:root {
  color-scheme: light;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Palette (v3) */
  --paper:   #F2F2EF;               /* page ground */
  --paper-2: #E8E8E3;
  --card:    #FFFFFF;
  --ink:     #0A0A0A;
  --night:   #0A0A0A;               /* small dark accents */
  --panel:   #161616;               /* optional dark tile */

  /* Ground — scoped tokens (light by default; see the scopes below) */
  --bg:      var(--paper);
  --raise:   var(--card);           /* cards on paper */
  --raise-2: var(--paper-2);        /* nested (quote boxes) */
  --floor:   var(--paper);          /* the light footer under the page */
  --text:    var(--ink);
  --text-2:  rgba(10,10,10,.68);    /* ledes ≈ 6.7:1 */
  --text-3:  rgba(10,10,10,.60);    /* meta  ≈ 5.0:1 */
  --line:    rgba(10,10,10,.10);
  --line-2:  rgba(10,10,10,.18);
  --line-3:  rgba(10,10,10,.34);

  /* Accents */
  --lc:      #2474F7;               /* Limit Coach — the one strong colour */
  --lc-text: #1A5FD6;               /* LC for small text on paper (≈5.2:1) */
  --lc-glow: rgba(36,116,247,.5);
  --live:    #10A37F;               /* "live" green from the original site */
  --zac:     #0B193E;
  --vibe:    #613F6D;
  --me:      #8D85C0;
  --stripe:  #635BFF;

  /* Shape */
  --r:    16px;                     /* cards */
  --r-sm: 12px;                     /* buttons, screens */
  --r-xs: 7px;                      /* keycaps, chips */
  --r-tile: 28px;                   /* colour blocks (v3) */

  /* Motion */
  --ease-out:  cubic-bezier(.22, 1, .36, 1);
  --ease-soft: cubic-bezier(.2, .8, .2, 1);
  --ease-io:   cubic-bezier(.65, 0, .35, 1);
  --spring:    linear(0, .42 9%, .84 21%, 1.02 33%, 1.05 41%, 1.01 55%, .99 70%, 1);
  --enter: 0s;                      /* entrance offset (set while a scan/boot plays) */

  /* Layout */
  --wrap: 76rem;
  --gutter: 1.25rem;
  --section-y: 6rem;
  --floor-h: 34rem;
  --top-h: 64px;
}
@media (min-width: 640px)  { :root { --gutter: 2rem; } }
@media (min-width: 768px)  { :root { --section-y: 8rem; --floor-h: 30rem; } }
@media (min-width: 1024px) { :root { --section-y: 9rem; } }

/* ── Scopes (v3) ─────────────────────────────────────────────────────────
   Dark accents re-scope the tokens; blue tiles use ink so their small text
   meets AA while Limit Coach keeps its original blue. */
.k-dark, .k-term, .k-stage, .k-tile--night, .k-tile--panel {
  color-scheme: dark;
  --bg: var(--night); --raise: var(--panel); --raise-2: #1F1F1F;
  --text: #F3F3EF; --text-2: rgba(243,243,239,.68); --text-3: rgba(243,243,239,.52);
  --line: rgba(255,255,255,.10); --line-2: rgba(255,255,255,.18); --line-3: rgba(255,255,255,.32);
  --lc-text: #6AA1FF;
  color: var(--text);
}
.k-blue, .k-tile--blue {
  --bg: var(--lc); --raise: rgba(255,255,255,.12); --raise-2: rgba(10,10,10,.16);
  --text: var(--ink); --text-2: var(--ink); --text-3: var(--ink);
  --line: rgba(10,10,10,.20); --line-2: rgba(10,10,10,.32); --line-3: rgba(10,10,10,.55);
  --lc-text: var(--ink);
  color: var(--text);
}
/* Colour blocks — blue, white and cream, with optional small dark accents. */
.k-tile { position: relative; border-radius: var(--r-tile); overflow: hidden; }
.k-tile--blue  { background: var(--lc); }
.k-tile--white { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.k-tile--cream { background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); }
.k-tile--night { background: var(--night); }
.k-tile--panel { background: var(--panel); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top-h) + 1.5rem); -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); overscroll-behavior-y: none; overflow-x: clip; }
main [id] { scroll-margin-top: calc(var(--top-h) + 1.5rem); }
body {
  font-family: var(--font-sans); font-weight: 400; font-size: 1rem; line-height: 1.55; letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  padding-bottom: var(--floor-h);
}
html.menu-open { overflow: hidden; }
a { color: inherit; }
img, svg { display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
button { font: inherit; color: inherit; }
::selection { background: var(--lc); color: #fff; }
:focus-visible { outline: 2px solid var(--lc); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.k-skip { position: fixed; left: 1rem; top: -4rem; z-index: 100; padding: .7rem 1rem; border-radius: var(--r-sm); background: var(--text); color: var(--bg); font: 500 .85rem var(--font-mono); text-decoration: none; }
.k-skip:focus { top: 1rem; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* The page is a sheet resting on the floor: rounded bottom edge + hairline */
.site-content {
  position: relative; z-index: 10; background: var(--bg);
  border-radius: 0 0 28px 28px; box-shadow: 0 1px 0 0 var(--line-2);
}
@media (min-width: 768px) { .site-content { border-radius: 0 0 40px 40px; } }

.u-link {
  color: var(--text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
  text-decoration-color: var(--line-3); transition: text-decoration-color .2s, text-underline-offset .26s var(--ease-out);
}
.u-link:hover { text-decoration-color: var(--text); text-underline-offset: 2px; }

.ic { width: 1em; height: 1em; flex: none; }

/* ══════════════════════════════════════════════════════════════════════
   Top bar (replaces floating pill + chips)
   ══════════════════════════════════════════════════════════════════════ */
.k-top {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--top-h);
  border-bottom: 1px solid transparent;
  transition: background-color .35s, border-color .35s, opacity .3s;
  animation: top-in .5s var(--ease-out) calc(var(--enter) + .05s) backwards;
}
.k-top.is-scrolled {
  background: rgba(242,242,239,.82); border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
}
@keyframes top-in { 0% { opacity: 0; transform: translateY(-8px); } }
.k-top__in { display: flex; align-items: center; gap: 1.5rem; height: 100%; }
.k-brand { display: inline-flex; align-items: center; gap: .7rem; min-height: 44px; text-decoration: none; font: 500 .82rem/1 var(--font-mono); letter-spacing: .01em; }
.k-brand__mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow .25s, background-color .25s; }
.k-brand__mark img { width: 20px; height: 12px; }
.k-brand:hover .k-brand__mark { background: rgba(10,10,10,.05); box-shadow: inset 0 0 0 1px var(--line-3); }
.k-brand__back { width: 15px; height: 15px; color: var(--text-3); transition: transform .3s var(--ease-out), color .2s; }
.k-brand:hover .k-brand__back { transform: translateX(-2px); color: var(--text); }

.k-links { position: relative; display: none; align-items: center; margin-left: auto; }
.k-links a {
  position: relative; padding: .6rem .62rem; white-space: nowrap; text-decoration: none;
  font: 500 .78rem/1 var(--font-mono); letter-spacing: .01em; color: var(--text-3); transition: color .2s;
}
@media (min-width: 1280px) { .k-links a { padding: .6rem .8rem; } }
.k-links a:hover, .k-links a[aria-current] { color: var(--text); }
.k-links a .ic { display: inline-block; width: .8em; height: .8em; margin-left: .15em; vertical-align: -.05em; }
/* the nav caret: a 2px blue bar that slides under the current item */
.k-caret {
  position: absolute; left: 0; bottom: -2px; width: 100px; height: 2px; border-radius: 2px; background: var(--lc);
  transform-origin: 0 50%; transform: translateX(var(--cx, 0px)) scaleX(var(--cw, 0));
  opacity: 0; transition: transform .5s var(--ease-out), opacity .3s;
}
.k-caret.is-on { opacity: 1; }
.k-top__gh { display: none; align-items: center; gap: .45rem; min-height: 36px; padding: 0 .8rem; margin-left: .5rem; border-radius: 9px; box-shadow: inset 0 0 0 1px var(--line-2); font: 500 .76rem/1 var(--font-mono); text-decoration: none; color: var(--text-2); transition: color .2s, box-shadow .2s; }
.k-top__gh:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--line-3); }
.k-top__gh svg { width: 14px; height: 14px; }
@media (min-width: 1024px) { .k-links { display: flex; } .k-menu { display: none !important; } }
@media (min-width: 1280px) { .k-top__gh { display: inline-flex; } }
/* sub-pages: five links, visible from 640 */
.k-top--sub .k-links { display: flex; }
@media (max-width: 639px) {
  .k-top--sub .k-top__in { gap: .65rem; }
  .k-top--sub .k-brand { flex: none; }
  .k-top--sub .k-links { min-width: 0; justify-content: flex-end; }
  .k-top--sub .k-links .t { display: none; }
  .k-top--sub .k-links a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 .55rem; font-size: .74rem; }
}
@media (max-width: 389px) { .k-top--sub .k-top__in { gap: .4rem; } .k-top--sub .k-links a { padding: 0 .34rem; font-size: .72rem; } }
@media (max-width: 400px) { .k-top--sub .k-brand__back { display: none; } }
@media (min-width: 640px) { .k-top--sub .k-links .s { display: none; } }

.k-menu {
  margin-left: auto; display: inline-flex; align-items: center; gap: .6rem; min-height: 44px; padding: 0 .9rem; border: 0; border-radius: 10px;
  background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer; font: 500 .8rem/1 var(--font-mono);
}
.k-menu i { position: relative; width: 14px; height: 8px; }
.k-menu i::before, .k-menu i::after { content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; transition: transform .35s var(--ease-out), top .35s var(--ease-out); }
.k-menu i::before { top: 0; } .k-menu i::after { top: 6.5px; }
.k-menu[aria-expanded="true"] i::before { top: 3.25px; transform: rotate(45deg); }
.k-menu[aria-expanded="true"] i::after { top: 3.25px; transform: rotate(-45deg); }

.k-sheet {
  position: fixed; inset: 0; z-index: 45; display: flex; flex-direction: column; overflow-y: auto;
  padding: calc(var(--top-h) + 1.5rem) var(--gutter) calc(env(safe-area-inset-bottom) + 1.75rem);
  background: var(--bg); opacity: 0; visibility: hidden;
  transition: opacity .3s var(--ease-out), visibility 0s linear .3s;
}
.k-sheet.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.k-sheet li { opacity: 0; transform: translateY(10px); transition: opacity .45s var(--ease-out), transform .55s var(--ease-out); transition-delay: calc(.04s + var(--i) * 32ms); }
.k-sheet.is-open li { opacity: 1; transform: none; }
.k-sheet a.k-sheet__l { display: flex; align-items: baseline; gap: .6rem; padding: .62rem 0; border-bottom: 1px solid var(--line); text-decoration: none; font-size: clamp(1.9rem, 8.6vw, 2.6rem); font-weight: 600; line-height: 1.05; letter-spacing: -.04em; }
.k-sheet a.k-sheet__l span { font: 500 .8rem/1 var(--font-mono); color: var(--lc-text); letter-spacing: 0; }
.k-sheet a.k-sheet__l[aria-current] { color: var(--text); }
.k-sheet__foot { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: auto; padding-top: 2rem; font: 500 .8rem var(--font-mono); }
.k-sheet__foot a { color: var(--text-2); text-decoration: none; }

/* ══════════════════════════════════════════════════════════════════════
   Type, headers, buttons
   ══════════════════════════════════════════════════════════════════════ */
.k-dim { color: var(--text-3); }
.k-eyebrow { font: 500 .8rem/1.3 var(--font-mono); color: var(--text-2); letter-spacing: .01em; }

/* un-numbered section header: a mono path, then the headline */
.k-path { display: flex; align-items: center; gap: .1rem; font: 500 .8rem/1 var(--font-mono); color: var(--text-2); }
.k-path b { font-weight: 500; color: var(--lc-text); }
.k-path .k-count { margin-left: auto; color: var(--text-3); }
.k-h2 { font-size: clamp(2.4rem, 5.8vw, 4.75rem); font-weight: 600; line-height: 1; letter-spacing: -.045em; text-wrap: balance; }
.k-lede { font-size: 1.08rem; line-height: 1.55; color: var(--text-2); max-width: 42ch; text-wrap: pretty; }
@media (min-width: 768px) { .k-lede { font-size: 1.16rem; } }

.k-section { padding-top: var(--section-y); }
.k-head { display: grid; gap: 1.1rem; margin-bottom: 2.25rem; }
@media (min-width: 1024px) {
  .k-head { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 2rem; row-gap: 1.5rem; align-items: end; margin-bottom: 3.25rem; }
  .k-head .k-path { grid-column: 1 / -1; }
  .k-head .k-h2 { grid-column: 1 / span 7; }
  .k-head .k-lede { grid-column: 8 / -1; padding-bottom: .3rem; }
}

/* keycap buttons (replace pills) */
.k-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .85rem;
  min-height: 3.25rem; padding: 0 .55rem 0 1.25rem; border: 0; border-radius: var(--r-sm); cursor: pointer; white-space: nowrap;
  background: var(--text); color: var(--bg); text-decoration: none;
  font: 600 1rem/1 var(--font-sans); letter-spacing: -.01em;
  transition: background-color .2s, transform .3s var(--ease-out), box-shadow .3s;
}
.k-btn:hover { background: color-mix(in srgb, var(--text) 84%, var(--bg)); transform: translateY(-1px); box-shadow: 0 10px 30px -14px color-mix(in srgb, var(--text) 45%, transparent); }
.k-btn:active { transform: translateY(0); }
.k-key {
  display: inline-grid; place-items: center; min-width: 2.15rem; height: 2.15rem; padding: 0 .45rem; border-radius: var(--r-xs);
  font: 500 .82rem/1 var(--font-mono); background: color-mix(in srgb, currentColor 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 26%, transparent), inset 0 -2px 0 color-mix(in srgb, currentColor 22%, transparent);
  transition: transform .15s;
}
.k-btn:active .k-key { transform: translateY(1px); box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 26%, transparent); }
.k-key svg { width: 14px; height: 14px; }
.k-btn--ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.k-btn--ghost:hover { background: color-mix(in srgb, var(--text) 5%, transparent); box-shadow: inset 0 0 0 1px var(--line-3); }
.k-btn--ghost .k-key { background: color-mix(in srgb, var(--text) 5%, transparent); box-shadow: inset 0 0 0 1px var(--line-2), inset 0 -2px 0 var(--line); }
.k-btn--plain { padding: 0 1.25rem; }
.k-btn > svg { width: 17px; height: 17px; }
/* busy state while the scan transition runs: label becomes a typed mono line */
.k-btn[data-busy] .k-btn__label, .k-btn[data-busy] .k-key { opacity: 0; }
.k-btn__busy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .1rem; font: 500 .86rem/1 var(--font-mono); opacity: 0; pointer-events: none; }
.k-btn[data-busy] .k-btn__busy { opacity: 1; }
.k-btn__busy::after { content: ""; width: .5em; height: 1.05em; margin-left: .2rem; background: currentColor; animation: caret-blink .9s steps(1) infinite; }

.k-tag { display: inline-flex; align-items: center; gap: .4rem; padding: .34rem .55rem; border-radius: var(--r-xs); white-space: nowrap; font: 500 .7rem/1 var(--font-mono); letter-spacing: .02em; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.k-live { display: inline-flex; align-items: center; gap: .45rem; font: 500 .72rem/1 var(--font-mono); color: var(--text-2); }
.k-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px rgba(16,163,127,.18); }
@media (prefers-reduced-motion: no-preference) { .k-live i { animation: live 2.4s ease-in-out infinite; } }
@keyframes live { 50% { opacity: .35; } }
@keyframes caret-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.k-card { background: var(--raise); border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); }

/* hairline rows */
.k-row {
  position: relative; display: grid; align-items: center; column-gap: 1rem; row-gap: .5rem; padding: 1.15rem 0;
  grid-template-columns: minmax(0, 1fr) 2.5rem; grid-template-areas: "main go" "meta go"; color: inherit; text-decoration: none;
}
.k-row::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--line); transform-origin: 0 50%; }
@media (min-width: 768px) { .k-row { grid-template-columns: minmax(0, 1fr) auto 2.5rem; grid-template-areas: "main meta go"; column-gap: 1.5rem; padding: 1.3rem 0; } }
.k-row__main { grid-area: main; min-width: 0; }
.k-row__name { display: block; font-size: 1.12rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; overflow-wrap: anywhere; transition: color .2s; }
@media (min-width: 768px) { .k-row__name { font-size: 1.22rem; } }
.k-row__desc { display: block; margin-top: .25rem; font-size: .97rem; line-height: 1.45; color: var(--text-2); text-wrap: pretty; }
.k-row__meta { grid-area: meta; display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.k-go { grid-area: go; justify-self: end; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line-2); transition: background-color .25s, color .25s, box-shadow .25s; }
.k-go svg { width: 14px; height: 14px; transition: transform .3s var(--ease-out); }
a:hover > .k-go, a:focus-visible > .k-go { background: var(--text); color: var(--bg); box-shadow: none; }
a:hover > .k-go svg { transform: translate(1px, -1px); }

/* hairlines that draw in */
@media (prefers-reduced-motion: no-preference) {
  .k-grow::before { transform: scaleX(0); transition: transform 1.1s var(--ease-soft) calc(var(--i, 0) * 90ms); }
  .is-in .k-grow::before, .k-grow.is-in::before { transform: scaleX(1); }
}

/* ══════════════════════════════════════════════════════════════════════
   Entrance + scroll reveal
   ══════════════════════════════════════════════════════════════════════ */
.k-rise { animation: rise .75s var(--ease-out) calc(var(--enter) + var(--d, 0s)) both; }
@keyframes rise { 0% { opacity: 0; transform: translateY(16px); } 100% { opacity: 1; transform: none; } }
.reveal--armed { opacity: 0; transform: translateY(26px); }
.reveal--armed, .reveal--armed .reveal__art { transition: opacity .85s var(--ease-out), transform .9s var(--ease-out); will-change: opacity, transform; }
.reveal--armed .reveal__art { opacity: 0; transform: translateY(14px) scale(.96); transition-delay: .12s; }
.reveal--in, .reveal--in .reveal__art { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) { [data-parallax] { will-change: transform; } }

/* ══════════════════════════════════════════════════════════════════════
   Bots (inline SVG from grok-bot/bots.data.js — exact Grok Bot avatars)
   ══════════════════════════════════════════════════════════════════════ */
.gbot { overflow: visible; width: 100%; height: auto; }
.gbot__bob, .gbot__blink, .gbot__squash { transform-box: fill-box; transform-origin: 50% 50%; }
.gbot__squash { transform-origin: 50% 100%; }
@media (prefers-reduced-motion: no-preference) {
  .gbot--alive .gbot__bob   { animation: bot-bob 3.6s ease-in-out infinite; animation-delay: var(--bob-delay, 0s); }
  .gbot--alive .gbot__blink { animation: bot-blink 5.6s infinite; animation-delay: var(--blink-delay, 0s); }
  .gbot.is-hop  .gbot__squash { animation: bot-hop .62s var(--ease-out); }
  .gbot.is-boop .gbot__squash { animation: bot-boop .8s var(--ease-out); }
  .gbot.is-blink2 .gbot__blink { animation: bot-blink2 .42s ease-in-out; }
}
@keyframes bot-bob   { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5%); } }
@keyframes bot-blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.12); } }
@keyframes bot-blink2 { 0%, 100% { transform: scaleY(1); } 25%, 30% { transform: scaleY(.1); } 50% { transform: scaleY(1); } 70%, 75% { transform: scaleY(.1); } }
@keyframes bot-hop  { 0% { transform: none; } 18% { transform: scale(1.1, .88); } 42% { transform: translateY(-14%) scale(.94, 1.08); } 66% { transform: translateY(0) scale(1.05, .95); } 100% { transform: none; } }
@keyframes bot-boop { 0% { transform: none; } 15% { transform: scale(1.16, .82); } 45% { transform: translateY(-26%) scale(.92, 1.1) rotate(-7deg); } 70% { transform: translateY(0) scale(1.08, .92); } 100% { transform: none; } }

/* actor = a bot standing on the stage, with a hairline ring under it */
.k-actor { position: relative; display: grid; justify-items: center; }
.k-actor__body { position: relative; z-index: 1; width: 100%; cursor: pointer; touch-action: manipulation; }
@media (prefers-reduced-motion: no-preference) { .k-actor__body { will-change: transform; } }
.k-actor__ring {
  width: 74%; height: 0; padding-bottom: 14%; margin-top: -6%; border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line-2); transform-origin: 50% 50%;
}
@media (prefers-reduced-motion: no-preference) { .k-actor__ring { animation: ring-breathe 3.6s ease-in-out infinite; animation-delay: var(--bob-delay, 0s); } }
@keyframes ring-breathe { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.9); opacity: .65; } }
.k-actor[data-bot="limit-coach"] .k-actor__ring { box-shadow: inset 0 0 0 1px rgba(36,116,247,.55); }

.k-who { display: inline-flex; align-items: center; gap: .5rem; font: 500 .8rem/1 var(--font-mono); color: var(--text); }
.k-who i { width: 8px; height: 8px; border-radius: 50%; background: var(--text); flex: none; }
.k-who--lc i { background: var(--lc); box-shadow: 0 0 10px var(--lc-glow); }
.k-who small { font-size: inherit; color: var(--text-3); }

/* Black terminal scan: 380ms cover, 620ms navigation, 480ms arrival reveal. */
.k-scan { position: fixed; inset: 0; z-index: 3600; pointer-events: none; visibility: hidden; overflow: hidden; color: #F2F2EF; }
.k-scan__fill { position: absolute; inset: 0; background: #0A0A0A; transform-origin: 50% 0; transform: scaleY(0); }
.k-scan__line { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: #2474F7; box-shadow: 0 0 16px 2px var(--lc-glow), 0 0 2px #2474F7; transform: translateY(-6px); }
.k-scan__prompt { position: absolute; z-index: 1; top: 50%; left: 50%; display: flex; align-items: center; gap: 0; max-width: calc(100vw - 2rem); font: 500 clamp(.95rem, 3vw, 1.3rem)/1.2 var(--font-mono); white-space: nowrap; transform: translate(-50%, -50%); opacity: 0; }
.k-scan__sig { margin-right: .45em; color: #2474F7; }
.k-scan.is-skill-command .k-scan__sig { margin-right: 0; }
.k-scan__cmd { display: inline-block; }
.k-scan__cursor { flex: none; width: .5em; height: 1em; background: #2474F7; opacity: 0; }
.k-scan.is-out { visibility: visible; pointer-events: auto; }
.k-scan.is-out .k-scan__fill { transition: transform .38s var(--ease-io); transform: scaleY(1); }
.k-scan.is-out .k-scan__line { transition: transform .38s var(--ease-io); transform: translateY(100vh); }
.k-scan.is-out .k-scan__prompt { animation: scan-prompt-in .08s linear .27s both; }
.k-scan.is-out .k-scan__cursor { animation: scan-cursor .45s steps(1) .3s infinite; }
@keyframes scan-prompt-in { to { opacity: 1; } }
@keyframes scan-cursor { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
html[data-scan="in"] .k-scan { visibility: visible; pointer-events: auto; }
html[data-scan="in"] .k-scan__fill { transform: none; animation: scan-fill-in .48s var(--ease-io) forwards; }
html[data-scan="in"] .k-scan__line { transform: translateY(0); animation: scan-line-in .48s var(--ease-io) forwards; }
@keyframes scan-fill-in { to { transform: translateY(100%); } }
@keyframes scan-line-in { 85% { opacity: 1; } to { transform: translateY(100vh); opacity: 0; } }
html[data-scan="in"] { --enter: .38s; }

/* ══════════════════════════════════════════════════════════════════════
   The floor (footer) — light, revealed under the page; typed wordmark
   ══════════════════════════════════════════════════════════════════════ */
.k-floor { position: fixed; inset: auto 0 0; z-index: 0; height: var(--floor-h); overflow: hidden; background: var(--floor); color: var(--text); }
.k-floor__in { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; padding-top: 3.25rem; padding-bottom: calc(env(safe-area-inset-bottom) + 1.25rem); }
.k-floor__top { display: grid; gap: 1.75rem; }
@media (min-width: 900px) { .k-floor__top { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 3rem; align-items: start; } }
.k-floor__lead { max-width: 34ch; font-size: 1rem; line-height: 1.5; color: var(--text-2); text-wrap: pretty; }
.k-floor__nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 1.5rem; }
@media (min-width: 640px) { .k-floor__nav { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.k-floor__nav p { margin-bottom: .55rem; font: 500 .7rem/1 var(--font-mono); color: var(--text-3); }
.k-floor__nav a { display: inline-block; padding: .2rem 0; font: 500 .84rem/1.35 var(--font-mono); color: var(--text-2); text-decoration: none; transition: color .2s; }
.k-floor__nav a:hover { color: var(--text); }
.k-floor__nav a::before { content: "→ "; color: var(--text-3); opacity: 0; margin-left: -1.1em; transition: opacity .2s, margin .3s var(--ease-out); }
.k-floor__nav a:hover::before { opacity: 1; margin-left: 0; }
.k-floor__nav-x { display: none; }
@media (min-width: 640px) { .k-floor__nav-x { display: block; } }

/* the wordmark types itself in as the page lifts, then a blue caret blinks */
.k-mark {
  display: inline-flex; align-items: baseline; margin-top: auto; padding-top: 1.5rem; max-width: 100%;
  font: 500 clamp(2.3rem, 10.2vw, 9.75rem)/.92 var(--font-mono); letter-spacing: -.045em; color: var(--text); text-decoration: none; white-space: nowrap;
}
.k-mark__c { --p: clamp(0, calc((var(--reveal, 1) - .42 - var(--i) * .03) * 12), 1); display: inline-block; opacity: var(--p); transform: translateY(calc((1 - var(--p)) * .2em)); }
.k-mark__c.is-dim { color: var(--text-3); }
.k-mark__caret { --p: clamp(0, calc((var(--reveal, 1) - .86) * 10), 1); width: .5em; height: .78em; margin-left: .08em; align-self: center; translate: 0 .06em; background: var(--lc); opacity: var(--p); box-shadow: 0 0 24px var(--lc-glow); }
@media (prefers-reduced-motion: no-preference) { .k-floor.is-typed .k-mark__caret { animation: caret-blink 1.1s steps(1) .2s infinite; } }
.k-mark:hover .k-mark__c.is-dim, .k-mark:focus-visible .k-mark__c.is-dim { color: var(--text); }
.k-floor__status {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line);
  font: 500 .72rem/1.3 var(--font-mono); color: var(--text-3);
}
.k-floor__status a { color: var(--text-2); text-decoration: none; white-space: nowrap; }
.k-floor__status a:hover { color: var(--text); }
.k-floor__made { display: none; }
@media (min-width: 768px) { .k-floor__made { display: inline; } }
.k-rise-f { --p: clamp(0, calc((var(--reveal, 1) - .05 - .08 * var(--i, 0)) * 6), 1); opacity: var(--p); transform: translateY(calc((1 - var(--p)) * 18px)); }
.k-floor:focus-within .k-rise-f, .k-floor:focus-within .k-mark__c, .k-floor:focus-within .k-mark__caret { opacity: 1; transform: none; }
body[data-floor-open] .k-top { opacity: 0; pointer-events: none; }

@media (max-width: 639px) {
  :root { --floor-h: 46rem; }
  .k-floor__top > *, .k-floor__nav > * { min-width: 0; }
  .k-floor__nav a { display: flex; align-items: center; min-width: 44px; min-height: 44px; padding: .3rem 0; font-size: .94rem; overflow-wrap: anywhere; }
  .k-floor__nav a::before { content: none; }
  .k-floor__status a { display: inline-flex; align-items: center; min-height: 44px; }
  .k-mark { font-size: clamp(2rem, 8.6vw, 3.5rem); }
  .k-sheet__foot a { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
  .k-btn { max-width: 100%; min-width: 0; padding-top: .5rem; padding-bottom: .5rem; white-space: normal; line-height: 1.25; text-align: center; }
  .k-key { flex: none; }
  .k-go { width: 2.75rem; height: 2.75rem; }
  .k-row { grid-template-columns: minmax(0, 1fr) 2.75rem; }
  .k-row__desc { font-size: 1rem; }
}

/* ══════════════════════════════════════════════════════════════════════
   Reduced motion
   ══════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; }
  .k-rise, .k-top { animation: none !important; }
  .reveal--armed, .reveal--armed .reveal__art { opacity: 1; transform: none; }
  html[data-scan] .k-scan { display: none; }
  body { padding-bottom: 0; }
  .k-floor { position: static; height: auto; }
  .k-floor__in { padding-top: 4rem; }
}
