/* kit.css: the four kept features' shared look (FAMILY.md), 28 Sep 2026.
   Tokens are final-6/demo.css's, unchanged, plus --faint (#8d8ca0, 5.1:1 on the page) and the Moon's cream.
   One webfont (TF Cormorant 500, upright only: no italic anywhere), Inter or the system sans for small words.
   Every class starts k- (the feature's plate) or kr- (the mini rail). */
@font-face { font-family: 'TF Cormorant'; font-style: normal; font-weight: 500; font-display: swap; src: url(../../tf-cormorant.woff2) format('woff2'); }

:root {
  color-scheme: dark;
  --page: #141d33; --band: #0d1427;
  --ink: #f6ecdc; --body: #ddd2bf; --muted: #b9b0a2; --faint: #8d8ca0;
  --gold: #e8c690; --line: #ffffff1a; --line-warm: #e8c6902e;
  --nx-zodiac: #d8b36a; --nx-chinese: #e0735a; --nx-numerology: #8fa8f0; --nx-tarot: #9fc7a8; --nx-moon: #cfd8f0;
  --serif: 'TF Cormorant', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --han: 'Noto Serif SC', 'Songti SC', 'SimSun', 'Microsoft YaHei', serif;
  /* the type steps: five sizes, nothing between them */
  --t-kick: 500 11px/1.3 var(--sans);        /* the plate's name, uppercase .16em */
  --t-small: 400 13px/1.45 var(--sans);      /* the second line, the tap layer's rows */
  --t-body: 400 15px/1.5 var(--sans);
  --t-line: 500 22px/1.28 var(--serif);      /* the one answer line under a picture */
  --t-big: 500 34px/1.08 var(--serif);       /* a date travelled to, a name's number in the tap layer */
  /* motion (kit.js BRKit.MOTION): mark 220, open 320, close 260, glide 700, jump 380, flip 600 */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --fig: min(100%, 420px);                  /* a picture's width on a phone; 440 px beside its words on a wide screen */
}
html { background: var(--page); }
body.k-body { margin: 0; background: var(--page); color: var(--body); font: var(--t-body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
* { box-sizing: border-box; }
.k-body * { font-variant-numeric: lining-nums; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ── the plate: one feature = kicker, one picture, one answer line, one quiet second line, a tap for more ── */
.k-plate { max-width: 1068px; margin: 0 auto; padding: 32px 16px; }
.k-plate + .k-plate { border-top: 1px solid var(--line); }
.k-kick { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font: var(--t-kick); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.k-kick i { width: 6px; height: 6px; border-radius: 50%; background: var(--dot, var(--gold)); flex: none; }
.k-fig { display: block; width: var(--fig); margin: 0 auto; position: relative; }
.k-fig svg { display: block; width: 100%; height: auto; overflow: visible; }
.k-line { margin: 16px 0 0; font: var(--t-line); color: var(--ink); text-align: center; text-wrap: balance; }
.k-line b { font-weight: 500; color: var(--gold); }           /* the gold rule: gold only for what is yours or joins two */
.k-sub { margin: 6px 0 0; font: var(--t-small); color: var(--muted); text-align: center; text-wrap: balance; }
.k-src { margin: 10px 0 0; font: 400 11px/1.45 var(--sans); color: var(--faint); text-align: center; }   /* a tradition label */
.k-big { font: var(--t-big); color: var(--ink); }
@media (min-width: 900px) {
  .k-plate--side .k-body2 { display: grid; grid-template-columns: 440px minmax(0, 1fr); gap: 48px; align-items: center; }
  .k-plate--side .k-fig { width: 440px; }
  .k-plate--side .k-line, .k-plate--side .k-sub, .k-plate--side .k-src { text-align: left; }
}

/* the tap: a pill that opens the rich layer in place, and the same pill (or Escape) closes it */
.k-more { display: flex; justify-content: center; margin-top: 14px; }
.k-plate--side .k-more { justify-content: flex-start; }
.k-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 0 18px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid #e8c69059; color: var(--gold); font: 500 13px/1 var(--sans); letter-spacing: .02em;
  transition: border-color 220ms var(--ease), background 220ms var(--ease);
}
.k-pill:hover { border-color: var(--gold); background: #e8c69012; }
.k-pill[aria-pressed="true"], .k-pill[aria-expanded="true"] { border-color: var(--gold); background: #e8c6901c; }
.k-pill--quiet { color: var(--muted); border-color: var(--line); }
.k-layer { overflow: hidden; opacity: 1; transition: opacity 320ms var(--ease); }
.k-layer[data-closing] { opacity: 0; transition-duration: 260ms; }
.k-rows { margin: 16px auto 0; max-width: 420px; display: grid; gap: 0; }
.k-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font: var(--t-small); color: var(--body); }
.k-row b { font-weight: 500; color: var(--ink); }
.k-row span:last-child { color: var(--muted); text-align: right; }

/* ── the forced-dark paint: a canvas holds the picture, the SVG on top holds the words and the tap targets ── */
.k-paint { position: relative; }
.k-paint > canvas { display: block; width: 100%; height: auto; }
.k-paint > svg.k-live { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
svg.k-live *:not(text):not(tspan) { fill-opacity: 0 !important; stroke-opacity: 0 !important; }
svg.k-live text { fill-opacity: 1 !important; }
svg.k-live text[data-paint] { fill-opacity: 0 !important; }
svg.k-live .k-hit { cursor: pointer; pointer-events: all; }
svg.k-live .k-hit:focus-visible { outline: none; }
svg.k-live .k-hit:focus-visible .k-hitring { stroke-opacity: 1 !important; }
svg text { font-family: var(--sans); }
.k-han { font-family: var(--han); }

/* ── the mini rail: standalone pages only; on the real page the left column (final-6 rail.js) does this ── */
.kr { max-width: 1068px; margin: 0 auto; padding: 12px 16px 4px; }
.kr-row { display: flex; flex-wrap: wrap; gap: 8px; }
.kr-tok {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 0 14px 0 10px; border-radius: 999px; cursor: pointer;
  background: #161f38; border: 1px solid #ffffff17; color: var(--muted); font: 500 13px/1 var(--sans);
  transition: border-color 220ms var(--ease), background 220ms var(--ease), color 220ms var(--ease);
}
.kr-tok svg { width: 22px; height: 22px; flex: none; opacity: .55; transition: opacity 220ms var(--ease); }
.kr-tok.is-on { border-color: var(--gold); background: #e8c6901c; color: var(--ink); }
.kr-tok.is-on svg { opacity: 1; }
.kr-tok[aria-disabled="true"] { opacity: .5; }
.kr-say { min-height: 18px; margin: 6px 0 0; font: var(--t-small); color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .k-body *, .k-body *::before, .k-body *::after { transition: none !important; animation: none !important; }
}
