/* ==========================================================================
   The Accord Game: component kit (redesign, Nov 2026)
   Needs tokens.css. Every class is prefixed "k-" so the kit can sit beside the
   current pages' styles while screens move over one by one.

   Rules the kit keeps:
   - Anything you can press is a real button or link, at least 44px tall, with
     a visible border or fill and an icon or a verb. Labels on images are dark
     tags with no border, so they never look pressable.
   - One solid orange thing per screen: the next action.
   - Every animation has a still version under prefers-reduced-motion.
   ========================================================================== */

/* ---------- page ---------- */
body.k {
  margin: 0; background: var(--mylar); color: var(--graphite);
  font: 400 var(--fs-body)/1.5 var(--font); font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}
.k *, .k *::before, .k *::after { box-sizing: border-box; }
.k button { font: inherit; }
.k a { color: inherit; }
.k :focus-visible { outline: 2px solid var(--chosen); outline-offset: 2px; }

/* ---------- type ---------- */
.k-label { font: 500 var(--fs-label)/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.k-title { margin: 0; font-family: var(--font); font-stretch: 66%; font-weight: 760; text-transform: uppercase; line-height: .95; font-size: var(--fs-h1); }
.k-h2 { margin: 0; font-size: var(--fs-h2); font-weight: 700; line-height: 1.15; letter-spacing: -.01em; }
.k-h3 { margin: 0; font-size: var(--fs-h3); font-weight: 700; line-height: 1.2; }
.k-lead { margin: 0; font-size: var(--fs-lead); line-height: 1.45; color: var(--ink-2); }
.k-muted { color: var(--shale); }
.k-small { font-size: var(--fs-small); }

/* ---------- buttons ---------- */
.k-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 40px; padding: 0 var(--s-4);
  border: 1.5px solid var(--graphite); background: var(--paper); color: var(--graphite);
  font-size: var(--fs-ui); font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.k-btn:hover { background: var(--graphite); color: var(--sheet); }
.k-btn[disabled] { opacity: .45; cursor: not-allowed; }
.k-btn--sm { min-height: 34px; padding: 0 var(--s-3); font-size: var(--fs-small); }
/* the next action: the one solid orange thing on a screen */
.k-btn--go {
  min-height: 56px; padding: 0 var(--s-5); justify-content: space-between;
  border: 0; background: var(--chosen); color: var(--graphite); font-size: var(--fs-lead);
}
.k-btn--go:hover { background: var(--graphite); color: var(--sheet); }
.k-dark .k-btn--go:hover { background: var(--sheet); color: var(--graphite); }
.k-btn--go .k-ui { transition: transform var(--t-mid) var(--ease); }
.k-btn--go:hover .k-ui { transform: translateX(4px); }
/* on graphite panels */
.k-btn--dark { border-color: var(--sheet); background: transparent; color: var(--sheet); }
.k-btn--dark:hover { background: var(--sheet); color: var(--graphite); }
/* adding a move: filled in its cost-group colour */
.k-btn--tier { border-color: var(--c); background: var(--c); color: #fff; }
.k-btn--tier:hover { border-color: var(--graphite); background: var(--graphite); }
.k-ui { flex: none; }

/* ---------- cost groups ---------- */
.k-tier-big   { --c: var(--tier-big);   --t: var(--tier-big-tint); }
.k-tier-mid   { --c: var(--tier-mid);   --t: var(--tier-mid-tint); }
.k-tier-quick { --c: var(--tier-quick); --t: var(--tier-quick-tint); }
.k-colhead {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  min-height: 36px; padding: 0 var(--s-3); background: var(--c); color: #fff;
}
.k-colhead b { font-size: 1rem; }
.k-colhead span { font-size: var(--fs-small); }

/* ---------- round banner: which round, which step, how much time ---------- */
.k-banner {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
  gap: var(--s-4); min-height: 64px; padding: var(--s-2) var(--gut);
  background: var(--sheet); border-bottom: 1px solid var(--graphite);
}
.k-round { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--s-3); row-gap: 1px; }
.k-round b { font-size: 1.25rem; white-space: nowrap; line-height: 1.1; }
.k-round .k-round-name { flex-basis: 100%; font-size: var(--fs-small); color: var(--shale); line-height: 1.1; }
.k-dots { display: flex; gap: 5px; }
.k-dots i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--shale); }
.k-dots i.is-done { background: var(--graphite); border-color: var(--graphite); }
.k-dots i.is-now { background: var(--chosen); border-color: var(--chosen); }
.k-steps { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: var(--s-3); }
.k-steps li { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-body); color: var(--shale); white-space: nowrap; }
.k-steps .k-num {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--shale);
  font-size: var(--fs-small); font-weight: 700;
}
.k-steps li.is-done .k-num { border: 0; background: var(--tier-mid); color: #fff; }
.k-steps li.is-now { color: var(--graphite); font-weight: 700; }
.k-steps li.is-now .k-num { border: 0; background: var(--chosen); color: var(--graphite); }
.k-steps li.is-now .k-num::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--chosen); animation: k-ring 2.4s ease-out infinite; }
.k-steps li.is-now .k-step-name { border-bottom: 2px solid var(--chosen); }
.k-steps .k-sep { width: 28px; border-top: 1px solid var(--contour); }
.k-steps .k-sep.is-done { border-top: 2px solid var(--tier-mid); }
.k-clock { display: flex; align-items: baseline; justify-content: flex-end; gap: var(--s-2); }
.k-clock b { font-size: 1.75rem; font-variant-numeric: tabular-nums; }
.k-clock b i { font-style: normal; color: var(--chosen); animation: k-blink 1s steps(1) infinite; }
.k-clock span { font-size: var(--fs-small); color: var(--shale); white-space: nowrap; }
@media (max-width: 720px) {
  .k-banner { grid-template-columns: 1fr auto; }
  .k-steps { grid-column: 1 / -1; grid-row: 2; }
  .k-steps .k-step-name { display: none; }
  .k-steps li.is-now .k-step-name { display: inline; }
  .k-steps .k-sep { flex: 1; width: auto; }
}

/* ---------- move card ---------- */
.k-card {
  display: flex; flex-direction: column; gap: var(--s-2); min-width: 0;
  background: var(--t, var(--sheet)); border: 1px solid var(--c, var(--contour)); border-top: 4px solid var(--c, var(--contour));
  padding: var(--s-2) var(--s-3) var(--s-3);
  transition: transform .22s var(--ease), background var(--t-mid), border-color var(--t-mid);
}
.k-card:hover { border-color: var(--graphite); }
.k-card-top { display: flex; align-items: center; gap: var(--s-3); }
.k-tile {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 38px; height: 38px; background: var(--c, var(--graphite)); color: #fff;
  transition: transform .22s var(--ease-pop), background var(--t-mid);
}
.k-card:hover .k-tile { transform: scale(1.06); }
.k-cost { font-size: var(--fs-small); line-height: 1.2; }
.k-cost b { font-weight: 700; }
.k-card-title { margin: 0; font-size: var(--fs-body); font-weight: 750; line-height: 1.17; }
.k-card-desc { margin: -4px 0 0; font-size: var(--fs-small); line-height: 1.27; color: var(--ink-2); flex: 1 1 auto; }
.k-card-acts { display: flex; gap: var(--s-2); margin-top: auto; }
.k-card-acts > * { flex: 1 1 0; min-width: 0; }
.k-tick { display: none; margin-left: auto; width: 22px; height: 22px; border-radius: 50%; background: var(--chosen); color: var(--graphite); align-items: center; justify-content: center; }
/* one button that reads Add, or Remove once the move is in your plan */
.k-card .k-when-off, .k-card .k-when-on { align-items: center; gap: 6px; }
.k-card .k-when-off { display: inline-flex; }
.k-card .k-when-on { display: none; }
/* in your plan */
.k-card.is-on { background: var(--chosen-tint); border-color: var(--chosen); }
.k-card.is-on .k-tile { background: var(--chosen); color: var(--graphite); animation: k-pop .45s var(--ease-pop); }
.k-card.is-on .k-tick { display: inline-flex; animation: k-pop .45s .05s var(--ease-pop) both; }
.k-card.is-on .k-when-off { display: none; }
.k-card.is-on .k-when-on { display: inline-flex; }
.k-card.is-on .k-btn--tier { background: var(--chosen); border-color: var(--chosen); color: var(--graphite); }
/* cannot be afforded now: says why, in place of its button */
.k-card.is-off { background: #EDEEE9; border-color: var(--contour); }
.k-card.is-off .k-tile { background: #8D968C; }
.k-card.is-off .k-dim { opacity: .55; }
.k-card.is-off .k-btn--tier { display: none; }
.k-card .k-why { display: none; }
.k-card.is-off .k-why { display: flex; }
.k-note {
  display: flex; align-items: center; padding: var(--s-2) var(--s-3);
  border: 1px dashed var(--shale); font-size: var(--fs-small); line-height: 1.3; color: var(--ink-2);
}

/* ---------- details box ---------- */
.k-scrim { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: var(--s-4); background: rgba(20, 27, 23, .55); animation: k-fade .2s ease both; }
.k-dialog { width: min(620px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--paper); border: 1.5px solid var(--graphite); animation: k-zoom .28s cubic-bezier(.34, 1.3, .64, 1) both; }
.k-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-2) var(--s-3) var(--s-2) var(--s-4); background: var(--c, var(--graphite)); color: #fff; }
.k-dialog-body { display: flex; flex-direction: column; gap: var(--s-4); padding: var(--s-4) var(--s-5) var(--s-5); }
.k-gain, .k-risk { padding: var(--s-3) var(--s-4) var(--s-4); font-size: var(--fs-body); line-height: 1.38; }
.k-gain { background: var(--gain-tint); } .k-gain .k-label { color: var(--gain); }
.k-risk { background: var(--risk-tint); } .k-risk .k-label { color: var(--risk); }
.k-li { display: flex; gap: var(--s-2); align-items: flex-start; margin-top: 7px; }
.k-li .k-ui { margin-top: 3px; }
@media (max-width: 600px) {
  .k-scrim { align-items: flex-end; padding: 0; }
  .k-dialog { width: 100%; border-width: 1.5px 0 0; animation: k-up .3s var(--ease) both; }
}

/* ---------- plan panel (dark) ---------- */
.k-dark { background: var(--graphite); color: var(--sheet); }
.k-plan { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-4); }
.k-pips { display: flex; gap: 5px; }
.k-pips i { width: 26px; height: 26px; border: 1.5px solid var(--shale); transition: background var(--t-mid); }
.k-pips i.is-on { background: var(--chosen); border-color: var(--chosen); animation: k-pop .4s var(--ease-pop); }
.k-money { display: flex; gap: 3px; }
.k-money i { flex: 1 1 0; height: 8px; border: 1px solid var(--shale); }
.k-money i.is-on { background: var(--better-on-dark); border-color: var(--better-on-dark); }
.k-planrow { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-2) 0; border-top: 1px solid var(--rule-dark); animation: k-slide .3s var(--ease) both; }
.k-swatch { width: 10px; height: 10px; flex: none; margin-top: 3px; background: var(--c); filter: brightness(1.7); }
.k-nudge { margin: 0; font-size: var(--fs-body); font-weight: 650; line-height: 1.35; }
.k-btn--go.is-ready { animation: k-ready 1.6s ease-out infinite; }

/* ---------- indicators (neutral: bar length is the only variable) ---------- */
.k-inds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-4); row-gap: var(--s-2); }
.k-ind-head { font-size: var(--fs-small); font-weight: 700; padding-bottom: 3px; border-bottom: 1px solid var(--rule); }
.k-dark .k-ind-head { border-color: var(--shale); }
.k-ind { display: flex; flex-direction: column; gap: 3px; }
.k-ind-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-2); font-size: var(--fs-small); }
.k-ind-row b { font-size: 1rem; font-variant-numeric: tabular-nums; }
.k-bar { height: 3px; background: var(--rule); }
.k-dark .k-bar { background: var(--rule-dark); }
.k-bar > i { display: block; height: 3px; background: currentColor; transform-origin: left; animation: k-grow 1.1s .3s var(--ease) both; }
/* change since last round, coloured only by whether it helps this table */
.k-delta { font: 500 var(--fs-small)/1 var(--font-mono); margin-left: var(--s-2); }
.k-delta.is-better { color: var(--better); } .k-delta.is-worse { color: var(--worse); }
.k-dark .k-delta.is-better { color: var(--better-on-dark); } .k-dark .k-delta.is-worse { color: var(--worse-on-dark); }

/* ---------- scene (valley image with slow camera, pins, tags) ---------- */
.k-scene { position: relative; overflow: hidden; background: var(--rule); }
.k-scene-cam { position: absolute; inset: 0; animation: k-cam 28s ease-in-out infinite alternate; }
.k-scene-cam img { width: 100%; height: 100%; object-fit: cover; display: block; }
.k-cloud { position: absolute; left: 0; top: 10%; width: 380px; height: 160px; border-radius: 50%; background: rgba(20, 27, 23, .15); filter: blur(42px); animation: k-cloud 60s linear infinite; pointer-events: none; }
.k-pin { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--chosen); }
.k-pin::after { content: ""; position: absolute; left: -2px; top: -2px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--chosen); box-sizing: border-box; animation: k-ring 2.2s ease-out infinite; }
.k-tag { position: absolute; transform: translate(-50%, -100%); padding: 3px 8px; background: var(--graphite); color: var(--sheet); white-space: nowrap; font: 500 var(--fs-label)/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.k-tag--news { background: var(--chosen); color: var(--graphite); }

/* ---------- motion ---------- */
.k-deal { animation: k-deal .35s var(--ease) both; animation-delay: calc(var(--i, 0) * 25ms); }
.k-rise { animation: k-rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes k-deal  { from { opacity: 0; transform: translateY(6px); } }
@keyframes k-rise  { from { opacity: 0; transform: translateY(6px); } }
@keyframes k-pop   { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes k-slide { from { opacity: 0; transform: translateX(16px); } }
@keyframes k-grow  { from { transform: scaleX(0); } }
@keyframes k-fade  { from { opacity: 0; } }
@keyframes k-zoom  { from { opacity: 0; transform: scale(.94) translateY(10px); } }
@keyframes k-up    { from { transform: translateY(100%); } }
@keyframes k-ring  { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(3.2); opacity: 0; } }
@keyframes k-ready { 0% { box-shadow: 0 0 0 0 rgba(242, 84, 27, .7); } 100% { box-shadow: 0 0 0 14px rgba(242, 84, 27, 0); } }
@keyframes k-cam   { from { transform: scale(1.03); } to { transform: scale(1.1) translate(-1.2%, -.8%); } }
@keyframes k-cloud { from { transform: translateX(-420px); } to { transform: translateX(110vw); } }
@keyframes k-blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) {
  .k *, .k *::before, .k *::after { animation: none !important; transition: none !important; }
}
