/* ============================================================
   marketing.css: shared foundation for the v0.5 homepage and the three
   Who We Serve sector pages (Contractors, Owner-operators & developers,
   Housebuilders). Class prefix mk-.

   Loaded on those four pages only (functions.php, tektome_enqueue_assets),
   after test-designs.css and before home.css (hm-) / sector.css (sc-).
   Design source: Claude Design "tektome.com Homepage v0.5" (Main.dc.html,
   Sector-*.dc.html), mapped onto the site's existing type scale
   (homepage.css / risk-review-coverage.css), not the design's raw sizes.
   Colours are tokens from colors_and_type.css; the only literals are the
   rgba() overlays, which have no token.

   ------------------------------------------------------------
   CLASS REFERENCE
   ------------------------------------------------------------
   Page and layout
     .mk-page            <main> wrapper. White ground, margin reset for
                         h1-h4/p/ul/ol/dl/dd/figure (zero specificity), and the
                         scope of the reduced-motion rule. Every mk-/hm-/sc-
                         element must sit inside it.
     .mk-wrap            1200px container, 40px gutters (24px at <=900px).
     .mk-sec             Section, 96px vertical padding (68px at <=900px).
       --grey            Light grey ground with grey rules top and bottom.
       --sky             Sky-50 ground with sky-300 rules top and bottom.
       --compact         40px padding (32px small): announcement / trust strips.

   Section header (site scale: .hp-eyebrow / .hp-h2 / .hp-body)
     .mk-head            Column, 16px gap, 40px below. --center centres it.
     .mk-eyebrow         Mono 12px, 0.2em, uppercase, arch purple.
     .mk-h2              Sans 300, clamp(28px, 3.4vw, 44px), 1.14.
       .accent           Span inside: arch purple, weight 400.
     .mk-lede            19px / 1.6 standfirst (under a centred h2).
     .mk-body            16.5px / 1.7 body copy, --fg-secondary.
     .mk-micro           Mono 11px uppercase tracked micro-label, purple-800.
     .mk-link            Text link, purple-800, 600, underlined, 44px target.

   Buttons and links
     .mk-btn             44px, 0 20px, radius 6px, 14.5px / 500 (as .hp-btn).
       --primary         Arch purple, hover purple-700.
       --light           White with purple-800 text (purple band). Hover purple-50.
       --ghost           White, purple-100 border. Hover purple-50.
     .mk-arrow           On any link/button: its <svg> nudges 3px right on hover.
     .mk-pills / .mk-pill  "Built for" pills on the dark hero (ul > li > a).

   Cards
     .mk-card            White, 1px grey border, radius 8px, 24px padding,
                         column with 12px gap.
       --top             3px arch-purple top border.
     .mk-card__icon      44px purple-50 tile, purple-800 24px icon inside.
     .mk-card__t         Card title, 18px / 600 / 1.32 (as .hp-case__t).
     .mk-card__x         Card body, 15px / 1.6, --fg-secondary.
     .mk-lift            Hover: lifts 3px, soft shadow, arch-purple border.

   Dark photo hero band (the design's 'Arch glow' theme)
     .mk-hero            The <section>. Dark ground, scrim (::before) and the
                         fading grid (::after) are drawn by the class itself.
       --home            Homepage size: h1 clamp(40px, 5.9vw, 88px), accent 600.
       --interior        Sector size:   h1 clamp(38px, 5vw, 66px),  accent 400.
     .mk-hero__photo     <img> filling the band (object-fit: cover). Set the
                         focal height with style="--mk-photo-y: 35%".
     .mk-hero__body      Column of hero content, left aligned.
     .mk-hero__crumbs    Breadcrumb <nav> (interior). Links white.
     .mk-hero__eyebrow   Mono 12.5px, 0.24em, sky-300.
       --rule            Adds the short leading rule the homepage eyebrow has.
     .mk-hero__title     The h1. Base white; <span class="accent"> sky-300.
     .mk-hero__lede      19px / 1.6, sky-100.
     .mk-hero__label     Mono "Built for" label, sky-200.
     .mk-hero__for       Wraps .mk-hero__label + .mk-pills (8px gap).
     .mk-hero__meta      Mono sector list under the lede (interior), sky-200.

   Purple "Book a demo" band
     Do not hand-write it: include template-parts/mk-demo-band.php (see that
     file). Classes: .mk-band (+ --grid), .mk-band__inner, __copy, __title,
     __lede, __note.

   ------------------------------------------------------------
   ANIMATION (all of the design's keyframes, renamed tk- -> mk-)
   ------------------------------------------------------------
   One-shot, played when their container scrolls into view:
     .mk-rise       fade up 14px, .8s            (design tk-rise)
     .mk-pop        scale-in with overshoot, .6s (tk-pop; SVG-safe)
     .mk-fade       opacity, .6s, default delay .35s (tk-fade)
     .mk-zoom       hero photo 1.06 -> 1 over 16s (tk-zoom)
     .mk-draw       SVG stroke drawing, 1.6s. The path MUST carry
                    pathLength="1" (tk-draw)
     .mk-bar        SVG bar grows up from its bottom, 1.1s (tk-bar)
     .mk-grow-x     grows from the left, 1.2s (tk-grow-x)
     .mk-grow-line  grows down from the top, 1.6s (tk-grow-line)
     .mk-scan       a sweep across its (overflow: hidden) parent, 2.6s, default
                    delay .6s, then gone (tk-scan)
   Continuous (run whenever motion is allowed, no trigger needed):
     .mk-pulse-ring (tk-pulse-ring), .mk-flow (dashed line flow, tk-flow),
     .mk-blink (tk-blink), .mk-spin (tk-spin)
   Stagger: style="--mk-d: .25s" on the element (or the design's inline
   animation-delay, which also wins). Delays count from the moment the
   container gets .is-in, so the design's numbers can be copied as they are.

   The trigger: put data-mk-anim on a container (normally the <section>, or a
   block inside it). marketing.js adds .is-in to it when it scrolls into view
   (the hero and anything else on the first screen: two frames after the
   first paint). Only then do the one-shot animations inside it run.
     - Without JS, with reduced motion, or if marketing.js never arrives (the
       head failsafe drops the arming after 3s), nothing is hidden: every
       element sits in its final state.
     - Before .is-in, armed content waits at opacity .01, never 0 (CLAUDE.md:
       Chrome ignores invisible paints for LCP).
     - Do not nest [data-mk-anim] containers.
     - Put data-mk-anim on the block whose children animate (the card grid,
       the list), not on a whole tall section, so the animation starts when
       that block is actually seen, on phones too.
     - After a tab or answer switch, call TKMarketing.replay(panel) (see
       marketing.js): it restarts that panel's animations with their delays.
     - Do not put a one-shot class on an element whose own transform matters
       (hm-/sc- rules): the start state sets transform. Wrap it instead.

   ------------------------------------------------------------
   MINIMAL MARKUP
   ------------------------------------------------------------
   Hero band (interior; the homepage uses .mk-hero--home, the eyebrow --rule,
   a .mk-hero__for pill group and no crumbs):

     <main class="mk-page sc-page">
       <section class="mk-hero mk-hero--interior" id="hero" data-mk-anim>
         <img class="mk-hero__photo mk-zoom" src="..." alt="" width="1920" height="1440"
              fetchpriority="high" style="--mk-photo-y: 40%">
         <div class="mk-wrap">
           <nav class="mk-hero__crumbs" aria-label="Breadcrumb">
             <a href="/">Home</a><span aria-hidden="true">/</span><span aria-current="page">Contractors</span>
           </nav>
           <div class="mk-hero__body">
             <p class="mk-hero__eyebrow">For contractors</p>
             <h1 class="mk-hero__title mk-rise">Catch the design errors <span class="accent">before they reach site.</span></h1>
             <p class="mk-hero__lede mk-rise" style="--mk-d: .1s">...</p>
             <p class="mk-hero__meta mk-rise" style="--mk-d: .15s">...</p>
             <a class="mk-btn mk-btn--primary mk-rise" style="--mk-d: .2s" href="#schedule-a-demo">Book a demo</a>
           </div>
         </div>
       </section>

   Section header:

       <section class="mk-sec" id="problem" data-mk-anim>
         <div class="mk-wrap">
           <div class="mk-head">
             <p class="mk-eyebrow">The problem</p>
             <h2 class="mk-h2">Avoidable design errors <span class="accent">repeat.</span></h2>
             <p class="mk-body">...</p>
           </div>
           ...
         </div>
       </section>

   Card (inside a [data-mk-anim] container for the rise):

       <article class="mk-card mk-card--top mk-lift mk-rise" style="--mk-d: .05s">
         <div class="mk-card__icon"><svg viewBox="0 0 24 24" ... aria-hidden="true">...</svg></div>
         <h3 class="mk-card__t">Errors fixed on the drawing, not on site</h3>
         <p class="mk-card__x">...</p>
       </article>

   Reveal container: any element with data-mk-anim, e.g.
       <div class="sc-cards" data-mk-anim> <article class="mk-card mk-rise" style="--mk-d:.15s"> ...
   A container that draws its own frame (background, border) should fade
   with its items (.mk-fade, --mk-d: 0s) or sit inside the container, so it
   never shows as an empty box while its items are armed.

   Demo band (PHP, last thing inside <main>):

       <?php get_template_part( 'template-parts/mk-demo-band', null, [
           'note' => 'Then see it on your own work: bring one package and one standard, and we show you what a review would catch.',
       ] ); ?>
     </main>

   All CTA buttons use href="#schedule-a-demo" (nav.jsx opens the demo modal).
   ============================================================ */


/* ---------- Page, container, sections ---------- */

.mk-page {
  --mk-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --mk-ease-io: cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--color-draft-white);
  color: var(--fg-primary);
  overflow-x: clip;
}
.mk-page :where(h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote) { margin: 0; }
/* Anchored sections (#who, #solution, #announcements) land below the 72px
   sticky header. */
.mk-page [id] { scroll-margin-top: 72px; }

.mk-wrap { position: relative; max-width: 1200px; margin: 0 auto; padding: 0 40px; }

.mk-sec { position: relative; padding: 96px 0; }
.mk-sec--grey {
  background: var(--color-light-gray);
  border-top: 1px solid var(--border-default);
  border-bottom: 1px solid var(--border-default);
}
.mk-sec--sky {
  background: var(--color-sky-50);
  border-top: 1px solid var(--color-sky-300);
  border-bottom: 1px solid var(--color-sky-300);
}
.mk-sec--compact { padding: 40px 0; }


/* ---------- Section header ---------- */

.mk-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  margin: 0 0 40px;
}
.mk-head:last-child { margin-bottom: 0; }
.mk-head--center { align-items: center; text-align: center; }

.mk-eyebrow {
  font-family: var(--font-mono);
  font-weight: var(--fw-medium);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-arch-purple);
}

.mk-h2 {
  font-family: var(--font-sans);
  font-weight: var(--fw-light);
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.14;
  letter-spacing: -0.015em;
  color: var(--color-data-black);
  max-width: 21em;
  text-wrap: balance;
}
.mk-h2 .accent { color: var(--color-arch-purple); font-weight: var(--fw-regular); }
.mk-head--center .mk-h2 { max-width: 19.5em; }

.mk-lede {
  font-size: 19px;
  line-height: 1.6;
  color: var(--fg-secondary);
  max-width: 33.5em;
  text-wrap: pretty;
}
.mk-body {
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--fg-secondary);
  text-wrap: pretty;
}
.mk-body strong, .mk-lede strong { color: var(--color-data-black); font-weight: var(--fw-semibold); }

.mk-micro {
  font-family: var(--font-mono);
  font-weight: var(--fw-medium);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--purple-800);
}

.mk-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--purple-800);
  font-size: 15px;
  font-weight: var(--fw-semibold);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.mk-link:hover { color: var(--purple-800); text-decoration-thickness: 2px; }
.mk-link svg { width: 14px; height: 14px; flex: none; display: block; }


/* ---------- Buttons ---------- */

.mk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: var(--fw-medium);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--mk-ease, ease), color 0.2s var(--mk-ease, ease), border-color 0.2s var(--mk-ease, ease);
}
.mk-btn svg { width: 14px; height: 14px; flex: none; display: block; }
.mk-btn:focus-visible { outline: 3px solid var(--purple-100); outline-offset: 2px; }

.mk-btn--primary { background: var(--color-arch-purple); border-color: var(--color-arch-purple); color: var(--color-draft-white); }
.mk-btn--primary:hover { background: var(--purple-700); border-color: var(--purple-700); color: var(--color-draft-white); }

.mk-btn--light { background: var(--color-draft-white); border-color: var(--color-draft-white); color: var(--purple-800); }
.mk-btn--light:hover { background: var(--purple-50); border-color: var(--purple-50); color: var(--purple-800); }
.mk-btn--light:focus-visible { outline-color: var(--color-draft-white); }

.mk-btn--ghost { background: var(--color-draft-white); border-color: var(--purple-100); color: var(--color-arch-purple); }
.mk-btn--ghost:hover { background: var(--purple-50); border-color: var(--color-arch-purple); color: var(--color-arch-purple); }

.mk-arrow svg { transition: transform 0.2s var(--mk-ease, ease); }
.mk-arrow:hover svg { transform: translateX(3px); }


/* ---------- Cards ---------- */

.mk-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--color-draft-white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  color: var(--fg-primary);
}
.mk-card--top { border-top: 3px solid var(--color-arch-purple); }

.mk-card__icon {
  flex: none;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--purple-50);
  border-radius: var(--radius-md);
  color: var(--purple-800);
}
.mk-card__icon svg { width: 24px; height: 24px; display: block; }

.mk-card__t {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: var(--fw-semibold);
  line-height: 1.32;
  letter-spacing: 0;
  color: var(--color-data-black);
}
.mk-card__x {
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg-secondary);
}

.mk-lift { transition: transform 0.2s var(--mk-ease, ease), box-shadow 0.2s, border-color 0.2s; }
.mk-lift:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(16, 16, 16, 0.08);
  border-color: var(--color-arch-purple);
}


/* ---------- Dark photo hero band ('Arch glow') ---------- */

.mk-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 72px 0 80px;
  background: var(--color-data-black);
  color: var(--color-draft-white);
}
.mk-hero--home { padding: 88px 0 96px; }
/* The sector designs' padding-block 2.5rem 3.5rem. */
.mk-hero--interior { padding: 40px 0 56px; }

.mk-hero__photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center var(--mk-photo-y, 40%);
}
/* The scrim: near-black on the copy side, opening to arch purple on the right. */
.mk-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(16, 16, 16, 0.95) 0%, rgba(16, 16, 16, 0.86) 42%, rgba(81, 86, 219, 0.78) 100%);
  pointer-events: none;
}
/* The 48px grid, faded out towards the copy (design .tk-grid-dark). */
.mk-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 55%, #000 100%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 55%, #000 100%);
  pointer-events: none;
}

.mk-hero__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}
.mk-hero--interior .mk-hero__body { gap: 20px; }

.mk-hero__crumbs {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-sky-100);
}
.mk-hero__crumbs a { color: var(--color-draft-white); text-decoration: underline; text-underline-offset: 0.2em; }
.mk-hero__crumbs a:hover { color: var(--color-draft-white); text-decoration-thickness: 2px; }
.mk-hero__crumbs [aria-hidden="true"] { margin: 0 8px; }

.mk-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-weight: var(--fw-medium);
  font-size: 12.5px;
  line-height: 1.5;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--color-sky-300);
}
.mk-hero--interior .mk-hero__eyebrow { color: var(--color-sky-200); }
.mk-hero__eyebrow--rule::before {
  content: "";
  flex: none;
  width: 28px;
  height: 1px;
  background: currentColor;
}

.mk-hero__title {
  font-family: var(--font-sans);
  font-weight: var(--fw-light);
  color: var(--color-draft-white);
  text-wrap: balance;
}
.mk-hero__title .accent { color: var(--color-sky-300); }

.mk-hero--home .mk-hero__title {
  font-size: clamp(40px, 5.9vw, 88px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  max-width: 14em;
}
.mk-hero--home .mk-hero__title .accent { font-weight: var(--fw-semibold); }
/* Eyebrow and title sit closer together than the rest of the stack. */
.mk-hero--home .mk-hero__eyebrow + .mk-hero__title { margin-top: -8px; }

.mk-hero--interior .mk-hero__title {
  font-size: clamp(38px, 5vw, 66px);
  line-height: 1.05;
  letter-spacing: -0.022em;
  max-width: 11.5em;
}
.mk-hero--interior .mk-hero__title .accent { font-weight: var(--fw-regular); }

.mk-hero__lede {
  font-size: 19px;
  line-height: 1.6;
  color: var(--color-sky-100);
  max-width: 33.5em;
  text-wrap: pretty;
}
.mk-hero--interior .mk-hero__lede { max-width: 30.5em; }

.mk-hero__for { display: flex; flex-direction: column; gap: 8px; }
.mk-hero__label,
.mk-hero__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--color-sky-200);
}
.mk-hero__label { font-weight: var(--fw-medium); letter-spacing: 0.2em; }
.mk-hero__meta { letter-spacing: 0.14em; }

.mk-hero .mk-btn:focus-visible,
.mk-hero a:focus-visible { outline: 2px solid var(--color-draft-white); outline-offset: 3px; }

/* "Built for" pills */
.mk-pills { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; padding: 0; list-style: none; }
.mk-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-pill);
  color: var(--color-draft-white);
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: var(--fw-medium);
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.2s, border-color 0.2s;
}
.mk-pill:hover { background: rgba(255, 255, 255, 0.14); border-color: var(--color-draft-white); color: var(--color-draft-white); }
.mk-pill svg { width: 17px; height: 17px; flex: none; display: block; color: var(--color-sky-300); }


/* ---------- Purple "Book a demo" band (template-parts/mk-demo-band.php) ---------- */

.mk-band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 64px 0;
  background: var(--color-arch-purple);
  color: var(--color-draft-white);
}
/* 40px grid fading in from the right (design .tk-grid-band). */
.mk-band--grid::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: linear-gradient(270deg, #000 0%, transparent 80%);
          mask-image: linear-gradient(270deg, #000 0%, transparent 80%);
  pointer-events: none;
}
.mk-band__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.mk-band__copy {
  flex: 1 1 28rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mk-band__title {
  font-family: var(--font-sans);
  font-weight: var(--fw-light);
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.14;
  letter-spacing: -0.015em;
  color: var(--color-draft-white);
  text-wrap: balance;
}
.mk-band__lede {
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--color-draft-white);
  max-width: 38em;
  text-wrap: pretty;
}
.mk-band__note {
  font-size: 15px;
  line-height: 1.6;
  color: var(--purple-50);
  max-width: 42em;
  text-wrap: pretty;
}
.mk-band .mk-btn { flex: none; }


/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .mk-wrap { padding: 0 24px; }
  .mk-sec { padding: 68px 0; }
  .mk-sec--compact { padding: 32px 0; }
  .mk-hero { padding: 56px 0 64px; }
  .mk-hero--home { padding: 64px 0 72px; }
  .mk-hero--interior { padding: 32px 0 56px; }
  .mk-band { padding: 52px 0; }
}
/* Phones: the copy runs into the right tenth of the band, where the 0.78
   arch purple let the photo's light sky through (hero ledes 3.6:1). The
   right stop is purple-800 (#3934BB) at 0.86 there; every hero's text then
   passes AA (ledes 5.3:1 or more) and the building still shows. */
@media (max-width: 767px) {
  .mk-hero::before {
    background: linear-gradient(90deg, rgba(16, 16, 16, 0.95) 0%, rgba(16, 16, 16, 0.86) 42%, rgba(57, 52, 187, 0.86) 100%);
  }
}
/* No phone overrides for the hero lede (19px at every width, as the site's
   hero ledes and the designs) or the band button (keeps its own width, left
   under the copy, as the hero button does). */


/* ============================================================
   Animation
   ============================================================ */

@keyframes mk-rise      { from { opacity: 0.01; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes mk-zoom      { from { transform: scale(1.06); } to { transform: scale(1); } }
@keyframes mk-pulse     { 0% { transform: scale(0.7); opacity: 0.75; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes mk-draw      { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes mk-grow-y    { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes mk-grow-x    { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes mk-pop       { 0% { opacity: 0.01; transform: scale(0.4); } 70% { opacity: 1; transform: scale(1.1); } 100% { opacity: 1; transform: scale(1); } }
@keyframes mk-flow      { to { stroke-dashoffset: -18; } }
@keyframes mk-blink     { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes mk-scan      { 0% { transform: translateX(-100%); opacity: 1; } 85% { opacity: 1; } 100% { transform: translateX(560%); opacity: 0; } }
@keyframes mk-fade      { from { opacity: 0.01; } to { opacity: 1; } }
@keyframes mk-spin      { to { transform: rotate(360deg); } }

/* Resting (final) state. This is what shows without JS, with reduced motion,
   in print, and once an animation has finished: the one-shots use
   animation-fill-mode: backwards, so afterwards the element is back on these
   rules (which is also what lets .mk-lift's hover transform work on a card
   that rose in). */
.mk-draw { stroke-dasharray: 1; }
.mk-bar { transform-box: fill-box; transform-origin: bottom; }
.mk-grow-x { transform-box: fill-box; transform-origin: left; }
.mk-grow-line { transform-box: fill-box; transform-origin: top; }
.mk-pop,
.mk-pulse-ring,
.mk-spin { transform-box: fill-box; transform-origin: center; }
.mk-scan { opacity: 0; pointer-events: none; }

@media screen and (prefers-reduced-motion: no-preference) {

  /* Armed (html.mk-anim, set in <head>) and not yet in view: hold the start
     state. Opacity .01, never 0. */
  .mk-anim [data-mk-anim]:not(.is-in) :is(.mk-rise, .mk-pop, .mk-fade) { opacity: 0.01; }
  .mk-anim [data-mk-anim]:not(.is-in) .mk-rise { transform: translateY(14px); }
  .mk-anim [data-mk-anim]:not(.is-in) .mk-pop { transform: scale(0.4); }
  .mk-anim [data-mk-anim]:not(.is-in) .mk-zoom { transform: scale(1.06); }
  .mk-anim [data-mk-anim]:not(.is-in) .mk-draw { stroke-dashoffset: 1; }
  .mk-anim [data-mk-anim]:not(.is-in) :is(.mk-bar, .mk-grow-line) { transform: scaleY(0); }
  .mk-anim [data-mk-anim]:not(.is-in) .mk-grow-x { transform: scaleX(0); }

  /* In view: play. var(--mk-d) is the stagger, counted from .is-in. */
  .mk-anim [data-mk-anim].is-in .mk-rise      { animation: mk-rise 0.8s var(--mk-ease) var(--mk-d, 0s) backwards; }
  .mk-anim [data-mk-anim].is-in .mk-pop       { animation: mk-pop 0.6s var(--mk-ease) var(--mk-d, 0s) backwards; }
  .mk-anim [data-mk-anim].is-in .mk-fade      { animation: mk-fade 0.6s ease var(--mk-d, 0.35s) backwards; }
  .mk-anim [data-mk-anim].is-in .mk-zoom      { animation: mk-zoom 16s var(--mk-ease) var(--mk-d, 0s) backwards; }
  .mk-anim [data-mk-anim].is-in .mk-draw      { animation: mk-draw 1.6s var(--mk-ease-io) var(--mk-d, 0s) backwards; }
  .mk-anim [data-mk-anim].is-in .mk-bar       { animation: mk-grow-y 1.1s var(--mk-ease) var(--mk-d, 0s) backwards; }
  .mk-anim [data-mk-anim].is-in .mk-grow-x    { animation: mk-grow-x 1.2s var(--mk-ease) var(--mk-d, 0s) backwards; }
  .mk-anim [data-mk-anim].is-in .mk-grow-line { animation: mk-grow-y 1.6s var(--mk-ease-io) var(--mk-d, 0s) backwards; }
  .mk-anim [data-mk-anim].is-in .mk-scan      { animation: mk-scan 2.6s var(--mk-ease-io) var(--mk-d, 0.6s) backwards; }

  /* Already on screen when the script arrived late (after the head
     failsafe had shown everything): stay put rather than blink and replay.
     .mk-live marks a part TKMarketing.replay() has restarted since. */
  .mk-anim [data-mk-anim].is-in.is-static :is(.mk-rise, .mk-pop, .mk-fade, .mk-zoom, .mk-draw, .mk-bar, .mk-grow-x, .mk-grow-line, .mk-scan):not(.mk-live, .mk-live *) { animation: none; }

  /* TKMarketing.replay(el) on a non-container: restart what is inside. */
  .mk-replay :is(.mk-rise, .mk-pop, .mk-fade, .mk-zoom, .mk-draw, .mk-bar, .mk-grow-x, .mk-grow-line, .mk-scan),
  .mk-replay:is(.mk-rise, .mk-pop, .mk-fade, .mk-zoom, .mk-draw, .mk-bar, .mk-grow-x, .mk-grow-line, .mk-scan) { animation: none !important; }

  /* Continuous: no trigger needed. */
  .mk-pulse-ring { animation: mk-pulse 2.4s var(--mk-ease) var(--mk-d, 0s) infinite; }
  .mk-flow       { animation: mk-flow 1.2s linear infinite; }
  .mk-blink      { animation: mk-blink 1.6s ease-in-out var(--mk-d, 0s) infinite; }
  .mk-spin       { animation: mk-spin 18s linear infinite; }
}

/* Reduced motion: every final state, no movement (the design's rule, scoped
   to the page so the site header, footer and modal keep their own rules). */
@media (prefers-reduced-motion: reduce) {
  .mk-page *,
  .mk-page *::before,
  .mk-page *::after { animation: none !important; transition: none !important; }
  .mk-page .mk-draw { stroke-dashoffset: 0 !important; }
  .mk-page .mk-scan { display: none !important; }
}
