/* ETC kit, part A: motion and story components (KIT-CONTRACT.md A1-A14). Uses etc.css tokens. */
:root { --k-ease: cubic-bezier(.16, 1, .3, 1); --k-spring: cubic-bezier(.34, 1.56, .64, 1); --k-navy: #0F2742; --k-top: 84px; }

/* A1 progress bar */
.k-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 80; pointer-events: none; }
.k-progress i { display: block; height: 100%; background: var(--brand); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* A2 masked headline: hidden state only when the kit runs with motion */
.k-motion [data-mask]:not(.is-done) { clip-path: inset(0 0 100% 0); transform: translateY(28px); }
.k-motion [data-mask].is-in:not(.is-done) { clip-path: inset(0 0 -0.35em 0); transform: none;
  transition: clip-path 1s var(--k-ease), transform 1s var(--k-ease); }

/* A3 stagger */
.k-motion [data-stagger]:not(.is-done) > :not([data-rv]) { opacity: 0; transform: translateY(18px); }
.k-motion [data-stagger].is-in:not(.is-done) > :not([data-rv]) { opacity: 1; transform: none;
  transition: opacity .7s ease, transform .8s var(--k-ease); transition-delay: calc(var(--k-i, 0) * 70ms); }

/* A4 counter */
[data-count] { font-variant-numeric: tabular-nums; }

/* A6 tint layer */
.k-tint { position: fixed; inset: 0; z-index: -1; pointer-events: none; background-color: var(--k-tint, transparent); transition: background-color .7s ease; }

/* A7 window band + ghost word */
.k-band { position: relative; overflow: hidden; overflow: clip; background:
  radial-gradient(60% 80% at 100% 0%, rgba(62, 169, 0, .22), transparent 60%),
  radial-gradient(55% 70% at 0% 100%, rgba(35, 110, 180, .35), transparent 62%), var(--k-navy);
  color: #CBD5E1; clip-path: inset(var(--k-wy, 0%) var(--k-wx, 0%) 0 var(--k-wx, 0%) round var(--k-wr, 0px)); }
.k-band h2, .k-band h3, .k-band h4, .k-band b, .k-band strong { color: #fff; }
.k-band a:not(.btn) { color: #fff; }
.k-band .eyebrow { color: #86EFAC; }
.k-band .answer, .k-band p { color: #CBD5E1; }
.k-band > .wrap { position: relative; z-index: 1; }
.k-ghost { position: absolute; top: 50%; left: 0; z-index: 0; pointer-events: none; white-space: nowrap; user-select: none;
  font: 800 clamp(110px, 17vw, 280px)/1 var(--font); letter-spacing: -.03em; color: transparent;
  -webkit-text-stroke: 1.5px rgba(15, 39, 66, .07); transform: translate3d(var(--k-gx, 0px), -50%, 0); }
.k-band .k-ghost { -webkit-text-stroke-color: rgba(255, 255, 255, .09); }
[data-ghost]:not(.k-band) { position: relative; overflow: hidden; overflow: clip; }
[data-ghost]:not(.k-band) > .wrap { position: relative; z-index: 1; }

/* A8 side dots */
.k-dots { position: fixed; right: 18px; top: 50%; transform: translateY(-50%); z-index: 55; list-style: none; margin: 0; padding: 8px 0;
  display: none; flex-direction: column; gap: 4px; opacity: 0; transition: opacity .3s; }
.k-dots.is-on { opacity: 1; }
@media (min-width: 1100px) { .k-dots { display: flex; } }
.k-dots a { position: relative; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; text-decoration: none; }
.k-dots a::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #94A3B8; transition: transform .25s var(--k-spring), background .25s; }
.k-dots a.is-active::before { background: var(--blue); transform: scale(1.5); box-shadow: 0 0 0 4px rgba(35, 110, 180, .16); }
.k-dots a span { position: absolute; right: 34px; top: 50%; transform: translate(6px, -50%); white-space: nowrap; opacity: 0; pointer-events: none;
  font: 600 12.5px/1 var(--font-ui); color: #fff; background: var(--k-navy); padding: 7px 10px; border-radius: 6px; transition: opacity .2s, transform .2s; }
.k-dots a:hover span, .k-dots a:focus-visible span { opacity: 1; transform: translate(0, -50%); }
.k-dots.on-dark a::before { background: rgba(255, 255, 255, .5); }
.k-dots.on-dark a.is-active::before { background: #86EFAC; box-shadow: 0 0 0 4px rgba(134, 239, 172, .2); }

/* A9 hub packets */
.hub .lines .k-packet { fill: #3EA900; stroke: #fff; stroke-width: .35; }
.hub .lines .k-packet:nth-of-type(even) { fill: #236EB4; }

/* A10 scroll-story */
.k-story__stage { position: relative; }
.k-story__steps { list-style: none; margin: 0 0 18px; padding: 0; display: none; position: relative; }
.k-story__cards { display: grid; gap: 18px; }
.k-story__card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 26px; box-shadow: var(--shadow);
  display: grid; gap: 4px 28px; grid-template-columns: 1fr; align-content: start; }
.k-story__card h3 { margin: 4px 0 6px; font-size: clamp(20px, 1.1rem + .5vw, 26px); }
.k-story__card > p { margin: 0 0 8px; }
.k-story__k { font: 700 12.5px/1.2 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--green-d); margin: 0; }
.k-story__screen { margin-top: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); padding: 14px; font: 500 13.5px/1.45 var(--font-ui); color: var(--ink); position: relative; }
.k-story__bar { display: none; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 16px; }
.k-story__bar span { display: block; height: 100%; width: 100%; background: var(--brand); transform-origin: 0 50%; transform: scaleX(var(--k-sp, 0)); }
.k-story__spacer { pointer-events: none; }
.k-story__hint { display: none; font: 500 13px/1.4 var(--font-ui); color: var(--muted); margin: 10px 0 0; }
.k-story__token { display: none; }

/* live (desktop, motion OK): pinned stage, one card at a time */
.k-story.is-live .k-story__stage { position: sticky; top: var(--k-top); }
.k-story.is-live .k-story__steps { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; padding-top: 30px; }
.k-story.is-live .k-story__steps::before { content: ""; position: absolute; left: 6%; right: 6%; bottom: 21px; height: 2px; background: var(--line); }
.k-story__steps li { position: relative; display: flex; justify-content: center; }
.k-story__steps button { position: relative; z-index: 1; min-height: 42px; width: 100%; padding: 8px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--muted); font: 600 13.5px/1.2 var(--font-ui); cursor: pointer; transition: background .3s, color .3s, border-color .3s, transform .3s var(--k-spring); }
.k-story__steps button:hover { border-color: var(--blue); color: var(--blue); }
.k-story__steps li.is-done button { color: var(--ink); border-color: #BFD3EA; }
.k-story__steps li.is-on button { background: var(--blue); border-color: var(--blue); color: #fff; transform: translateY(-2px); box-shadow: 0 8px 18px rgba(35, 110, 180, .25); }
.k-story.is-live .k-story__token { display: inline-flex; position: absolute; top: 0; left: 0; z-index: 2; align-items: center; gap: 6px; white-space: nowrap;
  font: 700 11.5px/1 var(--font-ui); color: var(--green-d); background: var(--green-bg); border: 1px solid #CDE8BD; padding: 6px 9px; border-radius: 999px;
  transform: translate3d(var(--k-tx, 0px), 0, 0) translateX(-50%); transition: transform .55s var(--k-ease); }
.k-story__token::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(62, 169, 0, .2); }
.k-story.is-live .k-story__cards { display: grid; }
.k-story.is-live .k-story__card { grid-area: 1 / 1; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 380px; align-content: center;
  opacity: 0; transform: translate3d(48px, 0, 0) scale(.985); pointer-events: none; transition: opacity .2s ease, transform .25s ease; }
.k-story.is-live .k-story__card.is-past { transform: translate3d(-48px, 0, 0) scale(.985); }
.k-story.is-live .k-story__card.is-on { opacity: 1; transform: none; pointer-events: auto;
  transition: opacity .45s .2s ease, transform .7s .2s var(--k-ease); }
.k-story.is-live .k-story__card > :not(.k-story__screen) { grid-column: 1; }
.k-story.is-live .k-story__screen { grid-column: 2; grid-row: 1 / span 8; margin: 0; align-self: center;
  box-shadow: 0 18px 40px -18px rgba(15, 39, 66, .35); background: #fff; }
.k-story.is-live .k-story__card.is-on .k-story__screen { animation: k-screen .8s .35s var(--k-ease) both; }
@keyframes k-screen { from { opacity: 0; transform: translateY(18px) rotate(-1.2deg); } }
.k-story.is-live .k-story__bar, .k-story.is-live .k-story__hint { display: block; }
@media (max-height: 780px) {
  .k-story.is-live .k-story__card { min-height: 320px; padding: 20px; }
  .k-story.is-live .k-story__steps { padding-top: 26px; margin-bottom: 12px; }
  .k-story.is-live .k-story__hint { display: none; }
}

/* A11 drag-to-compare */
.k-compare { --pos: 50%; position: relative; display: grid; border-radius: 18px; overflow: hidden; border: 1px solid var(--line);
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: ew-resize; min-height: 220px; box-shadow: var(--shadow); }
.k-compare__a, .k-compare__b { grid-area: 1 / 1; padding: 26px 26px 30px; display: flex; flex-direction: column; gap: 8px; }
.k-compare__a { background: #FFF5F2; align-items: flex-start; }
.k-compare__b { background: #EFF8EA; align-items: flex-end; text-align: right; clip-path: inset(0 0 0 var(--pos)); }
.k-compare__a > *, .k-compare__b > * { max-width: 46%; margin: 0; }
.k-compare__a > :first-child, .k-compare__b > :first-child { font: 700 12.5px/1.2 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; }
.k-compare__a > :first-child { color: #B42318; } .k-compare__b > :first-child { color: var(--green-d); }
.k-compare__handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; z-index: 2; background: var(--k-navy); pointer-events: none; }
.k-compare__handle::after { content: "\21C6"; position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  display: grid; place-items: center; background: var(--k-navy); color: #fff; font: 700 17px/1 var(--font-ui); box-shadow: 0 10px 22px -8px rgba(15, 39, 66, .7);
  transition: transform .2s var(--k-spring); }
.k-compare.is-drag .k-compare__handle::after { transform: scale(1.12); }
.k-compare__range { position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.k-compare:focus-within { outline: 3px solid var(--blue); outline-offset: 3px; }
.k-compare__hint { margin: 10px 0 0; font: 500 13px/1.4 var(--font-ui); color: var(--muted); }
@media (max-width: 600px) { .k-compare__a, .k-compare__b { padding: 20px 16px 24px; } .k-compare__a > *, .k-compare__b > * { max-width: 47%; } .k-compare { font-size: 14px; } }

/* A12 scroll-drawn road */
.k-road { position: relative; display: grid; gap: 26px; }
.k-road__svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.k-road__bed { fill: none; stroke: var(--line); stroke-width: 4; stroke-linecap: round; }
.k-road__line { fill: none; stroke-width: 4; stroke-linecap: round; }
.k-road__pin { fill: #fff; stroke: #CBD5E1; stroke-width: 3; transition: fill .3s, stroke .3s; }
.k-road__pin.is-on { fill: var(--green); stroke: #fff; }
.k-road__stop { position: relative; z-index: 1; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; box-shadow: var(--shadow);
  transition: border-color .4s, box-shadow .4s, transform .5s var(--k-ease), opacity .5s; }
.k-road.is-zig .k-road__stop { width: calc(50% - 64px); }
.k-road.is-zig div.k-road__stop:nth-of-type(odd) { justify-self: start; }
.k-road.is-zig div.k-road__stop:nth-of-type(even) { justify-self: end; }
.k-road.is-line .k-road__stop { margin-left: 40px; }
.k-motion .k-road.is-ready .k-road__stop:not(.is-on) { opacity: .55; transform: translateY(10px); }
.k-road__stop.is-on { border-color: #BFD3EA; box-shadow: 0 14px 34px -16px rgba(35, 110, 180, .45); }

/* A13 flip cards */
.k-flips { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.k-flip { -webkit-appearance: none; appearance: none; margin: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left;
  cursor: pointer; display: grid; border-radius: 16px; min-height: 230px; }
.k-flip__front, .k-flip__back { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: 16px; border: 1px solid var(--line); background: #fff; }
.k-flip__back { background: var(--k-navy); color: #CBD5E1; border-color: var(--k-navy); margin-top: 10px; }
.k-flip__back b, .k-flip__back strong { color: #fff; }
.k-flip__hint { margin-top: auto; font: 600 12.5px/1 var(--font-ui); color: var(--blue); display: inline-flex; gap: 6px; align-items: center; }
.k-flip__back .k-flip__hint { color: #86EFAC; }
.k-motion-ready .k-flip { perspective: 1200px; }
.k-motion-ready .k-flip__front, .k-motion-ready .k-flip__back { grid-area: 1 / 1; margin: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transition: transform .75s var(--k-ease), box-shadow .3s; }
.k-motion-ready .k-flip__back { transform: rotateY(180deg); }
.k-motion-ready .k-flip[aria-pressed="true"] .k-flip__front { transform: rotateY(-180deg); }
.k-motion-ready .k-flip[aria-pressed="true"] .k-flip__back { transform: rotateY(0deg); }
.k-motion-ready .k-flip:hover .k-flip__front { box-shadow: var(--shadow); }
.k-still .k-flip__front, .k-still .k-flip__back { transform: none !important; transition: opacity .25s ease; }
.k-still .k-flip__back { opacity: 0; }
.k-still .k-flip[aria-pressed="true"] .k-flip__front { opacity: 0; }
.k-still .k-flip[aria-pressed="true"] .k-flip__back { opacity: 1; }

/* A14 swipe strip */
.k-strip { position: relative; }
.k-strip__track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 2px; padding: 4px 2px 18px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.k-strip__track.is-drag { scroll-snap-type: none; cursor: grabbing; }
.k-strip__item { flex: 0 0 min(400px, 86%); scroll-snap-align: start; margin: 0; }
.k-strip__nav { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.k-strip__nav button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
  font: 700 18px/1 var(--font-ui); display: grid; place-items: center; transition: background .2s, color .2s, border-color .2s, opacity .2s; }
.k-strip__nav button:hover:not(:disabled) { background: var(--blue); color: #fff; border-color: var(--blue); }
.k-strip__nav button:disabled { opacity: .35; cursor: default; }
.k-motion .k-strip__item { transition: transform .5s var(--k-ease), opacity .5s; }

/* reduced motion and no-JS safety */
.k-still [data-mask], .k-still [data-stagger] > * { clip-path: none !important; transform: none !important; opacity: 1 !important; }
@media (prefers-reduced-motion: reduce) {
  .k-progress i, .k-tint, .k-story__card, .k-road__stop, .k-flip__front, .k-flip__back, .k-story__token { transition: none !important; animation: none !important; }
}
