/* eg-kit-motion.css: kit motion timings for the public pages (dark Espresso Glass). Sections A-D at the end (25 Oct 2026) add card
   animation, including articles (body.eg-cream, part D); everything above them is dark pages only.
   Source: "Sabrina Espresso" design kit, README section 3 (fast 200ms hover/press, standard 400ms, easing cubic-bezier(.2,.7,.2,1),
   no bounce) and section 9 (reduced motion = no movement, final states shown). Written 25 Oct 2026.
   Asked by Macky: "start implementing designs for cards, animations, photos + cards". Pairs with eg-kit-motion.js.
   CONTRACT FOR eg-kit.css (photo layers): eg-kit-motion.js sets --k-par (px, -40..40 desktop, -20..20 phones, 0 with reduced motion)
   on .k-photo-bg / .k-photo-band. The photo layer should use  transform: translateY(var(--k-par,0px))  and be oversized by 40px
   top and bottom (e.g. inset:-40px 0) so no edge shows. Do NOT set "transform" on .k-lift in eg-kit.css (tilt owns it); use "translate". */

/* Safe default: the custom property exists but moves nothing until JS updates it. */
.k-photo-bg, .k-photo-band { --k-par: 0px; }

/* Buttons: fast 200ms hover lift and press. */
html body.eg:not(.eg-cream) .btn {
  transition: transform .2s cubic-bezier(.2,.7,.2,1), box-shadow .2s cubic-bezier(.2,.7,.2,1),
              background .2s cubic-bezier(.2,.7,.2,1), border-color .2s cubic-bezier(.2,.7,.2,1);
}
html body.eg:not(.eg-cream) .btn:hover { transform: translateY(-1px); }
@media (pointer: fine) { html body.eg:not(.eg-cream) .btn:active { transform: scale(.98); } }

/* Photo cards: standard 400ms. */
html body.eg:not(.eg-cream) .card.k-photo { transition: transform .4s cubic-bezier(.2,.7,.2,1), border-color .4s cubic-bezier(.2,.7,.2,1); }

/* Scroll reveal (classes set by motion.js): kit standard 400ms and a smaller 14px rise. motion.js only toggles .rv/.in, so this is safe. */
html body.eg:not(.eg-cream) .rv {
  transform: translateY(14px);
  transition: opacity .4s cubic-bezier(.2,.7,.2,1), transform .4s cubic-bezier(.2,.7,.2,1), filter .4s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--d, 0s);
}
html body.eg:not(.eg-cream) .rv.in { opacity: 1; transform: none; filter: none; }

/* Tilt cards: tilt toward the pointer (JS sets --k-rx/--k-ry), 400ms ease back. Waits for the reveal to finish if the card has one. */
html body.eg:not(.eg-cream) .k-lift:not(.rv),
html body.eg:not(.eg-cream) .k-lift.rv.in {
  transform: perspective(900px) rotateX(var(--k-rx, 0deg)) rotateY(var(--k-ry, 0deg));
  transition: transform .4s cubic-bezier(.2,.7,.2,1), opacity .4s cubic-bezier(.2,.7,.2,1) var(--d, 0s),
              filter .4s cubic-bezier(.2,.7,.2,1) var(--d, 0s), border-color .4s cubic-bezier(.2,.7,.2,1);
}
html body.eg:not(.eg-cream) .k-lift.k-tilting { transition-duration: .2s, .4s, .4s, .4s; }

/* Count-up: steady digit widths while numbers run (class only present during the animation). */
.k-counting { font-variant-numeric: tabular-nums; }

/* Reduced motion: nothing moves, final states shown. */
@media (prefers-reduced-motion: reduce) {
  html body.eg:not(.eg-cream) .btn,
  html body.eg:not(.eg-cream) .btn:hover,
  html body.eg:not(.eg-cream) .btn:active,
  html body.eg:not(.eg-cream) .card.k-photo,
  html body.eg:not(.eg-cream) .k-lift:not(.rv),
  html body.eg:not(.eg-cream) .k-lift.rv.in,
  html body.eg:not(.eg-cream) .rv,
  html body.eg:not(.eg-cream) .rv.in { transform: none; transition: none; }
  html body.eg:not(.eg-cream) .rv { opacity: 1; filter: none; }
  .k-photo-bg, .k-photo-band { --k-par: 0px !important; }
}

/* =====================================================================================================================
   CARD ANIMATION (25 Oct 2026). Macky asked: "please remember to add animation to cards like this" - all public pages and
   new articles. Kit speeds: hover 200-400ms, data drawings 1.2-2.2s once, easing cubic-bezier(.2,.7,.2,1), no bounce.
   Everything below ends on the normal look, so the page is complete without JavaScript; reduced motion = no animation.
   ===================================================================================================================== */

/* A. Home hero card (decorative). Shows its full content (rings, line, bars) from the first frame (Macky, 26 Oct 2026: "show its
      full content immediately on load ... never starting from an empty card"). On top only a light settle under 400ms: the bars
      grow the last few percent from their final shape, the rings ease the last 4% into place. Nothing fades from empty.
      Then the rings breathe very slowly and the warm glow drifts; eg-kit-motion.js adds .k-off while the card is off screen
      so those loops pause. Reduced motion: no animation at all (end of file). */
@keyframes k-hc-bar   { from { transform: scaleY(.86); } to { transform: none; } }
@keyframes k-hc-ring  { from { transform: scale(.96); } to { transform: none; } }
@keyframes k-hc-breathe { 0%, 100% { transform: none; } 50% { transform: scale(1.035); } }
@keyframes k-hc-glow  { from { transform: translate3d(-3%, 0, 0); opacity: .85; } to { transform: translate3d(3%, 4%, 0); opacity: 1; } }
html body.eg:not(.eg-cream) .pdf-hero-card .hc-bars i {
  transform-origin: 50% 100%;
  animation: k-hc-bar .3s cubic-bezier(.2,.7,.2,1) both;
  animation-delay: calc(var(--k-n, 0) * .015s);
}
html body.eg:not(.eg-cream) .pdf-hero-card .hc-bars i:nth-child(2) { --k-n: 1; }
html body.eg:not(.eg-cream) .pdf-hero-card .hc-bars i:nth-child(3) { --k-n: 2; }
html body.eg:not(.eg-cream) .pdf-hero-card .hc-bars i:nth-child(4) { --k-n: 3; }
html body.eg:not(.eg-cream) .pdf-hero-card .hc-bars i:nth-child(5) { --k-n: 4; }
html body.eg:not(.eg-cream) .pdf-hero-card .hc-bars i:nth-child(6) { --k-n: 5; }
html body.eg:not(.eg-cream) .pdf-hero-card .hc-bars i:nth-child(7) { --k-n: 6; }
/* rings: settle (.35s), then a 6s breath that never stops abruptly */
html body.eg:not(.eg-cream) .pdf-hero-card .hc-rings i {
  animation: k-hc-ring .35s cubic-bezier(.2,.7,.2,1) both, k-hc-breathe 6s ease-in-out infinite;
  animation-delay: 0s, calc(.6s + var(--k-n, 0) * .4s);
}
html body.eg:not(.eg-cream) .pdf-hero-card .hc-rings i:nth-child(2) { --k-n: 1; }
html body.eg:not(.eg-cream) .pdf-hero-card .hc-rings i:nth-child(3) { --k-n: 2; }
html body.eg:not(.eg-cream) .pdf-hero-card .hc-glow {
  will-change: transform;
  animation: k-hc-glow 14s ease-in-out infinite alternate;
}
/* off screen: the slow loops pause (the once-only entrance has already finished by then) */
html body.eg:not(.eg-cream) .pdf-hero-card.k-off .hc-rings i,
html body.eg:not(.eg-cream) .pdf-hero-card.k-off .hc-glow { animation-play-state: paused; }

/* B. Home "Four products" drawings (the ::after picture in each row, drawn in eg-pdf.css). Always fully shown (26 Oct 2026:
      never start from an empty card). eg-kit-motion.js adds .k-arm (start position) and .k-in when the row scrolls into view;
      the only movement is a light 350ms settle (8px rise, or 2-3% scale). Without JavaScript neither class is added. */
html body.eg.eg .pdf-prod .feat.k-arm::after {
  translate: 0 8px;
  transition: translate .35s cubic-bezier(.2,.7,.2,1), scale .35s cubic-bezier(.2,.7,.2,1);
}
html body.eg.eg .pdf-prod .feat.k-arm.k-in::after { translate: none; }
/* 03 web mock and 04 rings: a 2-3% scale settle instead of the rise */
html body.eg.eg :is(.pdf-prod-3, .pdf-prod-4) .feat.k-arm::after      { translate: none; scale: .975; }
html body.eg.eg :is(.pdf-prod-3, .pdf-prod-4) .feat.k-arm.k-in::after { scale: none; }
/* subtle life after the entrance: the dial and the rings glow a touch brighter and back, every 6s (paused off screen) */
@keyframes k-glow-soft { 0%, 100% { filter: none; } 50% { filter: brightness(1.08) saturate(1.05); } }
html body.eg.eg :is(.pdf-prod-2, .pdf-prod-4) .feat.k-arm.k-in.k-live::after { animation: k-glow-soft 6s ease-in-out infinite; }
html body.eg.eg :is(.pdf-prod-2, .pdf-prod-4) .feat.k-arm.k-in.k-live.k-off::after { animation-play-state: paused; }

/* C. Card hover for all public pages (mouse/trackpad only): a 3px lift with the "translate" property (eg-pdf.css locks
      "transform" on cards), a slightly brighter edge, 300ms. Not used on: the .k-lift card (already lifted, tilts),
      step lists, the stats strip, legal text, FAQ accordions, the menu drop-downs, and anything people type into (it must not move).
      Insights index cards (.mg-item, .mg-side) get the same lift on top of their own photo zoom (eg-insights.css). */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  html body.eg:not(.eg-cream) .surface-public :is(.card, .glass, .tier, .cap, .post, .mg-item, .mg-side):not(.k-lift, .step, .stats, .legal, details, form, .pdf-hero-card, .dd-menu):not(:has(input, textarea, select)) {
    transition: translate .3s cubic-bezier(.2,.7,.2,1), border-color .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s cubic-bezier(.2,.7,.2,1),
                opacity .4s cubic-bezier(.2,.7,.2,1) var(--d, 0s), transform .4s cubic-bezier(.2,.7,.2,1) var(--d, 0s),
                filter .4s cubic-bezier(.2,.7,.2,1) var(--d, 0s);
  }
  html body.eg:not(.eg-cream) .surface-public :is(.card, .glass, .tier, .cap, .post, .mg-item, .mg-side):not(.k-lift, .step, .stats, .legal, details, form, .pdf-hero-card, .dd-menu):not(:has(input, textarea, select)):not(#k):hover {
    translate: 0 -3px !important;
    border-color: rgba(255, 238, 214, .34) !important;
  }
  /* the .k-lift card keeps its own lift and tilt; it only gets the brighter edge */
  html body.eg:not(.eg-cream) .surface-public .k-lift:not(#k):hover { border-color: rgba(255, 240, 220, .3) !important; }
}

/* D. Articles (cream magazine look, body.eg-cream): the same calm hover on related posts and the side cards; the boxed
      panels inside the article text only brighten their edge (the text inside never moves). The gentle reveal is
      .k-rv (start) -> .k-in, set by eg-kit-motion.js only on cards that motion.js has not already given a reveal. */
html body.eg.eg-cream .k-rv { translate: 0 8px; }   /* 26 Oct 2026: cards stay fully visible; only a light 350ms rise */
html body.eg.eg-cream .k-rv.k-in {
  translate: none;
  transition: translate .35s cubic-bezier(.2,.7,.2,1) var(--k-d, var(--d, 0s));
}
html body.eg.eg-cream .art-panel.k-rv { translate: none; }   /* body text never moves */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  html body.eg.eg-cream :is(.mz-rel, .side .card, .art-panel) {
    transition: translate .3s cubic-bezier(.2,.7,.2,1), border-color .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s cubic-bezier(.2,.7,.2,1),
                opacity .6s cubic-bezier(.2,.7,.2,1) var(--k-d, var(--d, 0s)), transform .4s cubic-bezier(.2,.7,.2,1), filter .4s cubic-bezier(.2,.7,.2,1);
  }
  html body.eg.eg-cream :is(.mz-rel, .side .card):not(#k):hover {
    translate: 0 -3px !important;
    box-shadow: 0 18px 36px -18px rgba(60, 40, 20, .35);
  }
  html body.eg.eg-cream .art-panel:hover { border-color: rgba(138, 102, 56, .5); }
}

/* Reduced motion for A-D: no animation at all, nothing lifts, every drawing shows in its final state. */
@media (prefers-reduced-motion: reduce) {
  html body.eg .pdf-hero-card *, html body.eg .pdf-hero-card *::before, html body.eg .pdf-hero-card *::after { animation: none !important; }
  html body.eg.eg .pdf-prod .feat::after { animation: none !important; transition: none !important; opacity: 1 !important; translate: none !important;
    scale: none !important; filter: none !important; clip-path: none !important; }
  html body.eg.eg-cream .k-rv { opacity: 1 !important; translate: none !important; transition: none !important; }
}
