/* ── Lenis base (required by Lenis 1.1.14, MIT) ──────────────
   Prepended to the verbatim cb-motion.css reference. These rules
   let Lenis own scroll easing without fighting native smoothing. */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: clip; }
.lenis.lenis-scrolling iframe { pointer-events: none; }

/*!
 * cb-motion.css — Cognition Blueprint motion layer styles
 * ─────────────────────────────────────────────────────────────────
 * Pairs with cb-motion.js. Two rules govern everything:
 *   1. Hidden states exist ONLY under html.cb-motion — no JS, or
 *      motion off, or reduced-motion = fully visible static page.
 *   2. Nothing here knows about specific blocks. Attributes only,
 *      so any block can opt in, reorder, and duplicate.
 * ─────────────────────────────────────────────────────────────────
 */

:root {
  --cb-ease: cubic-bezier(.24, 0, .16, 1.01);
}

/* ── Page transitions: the platform does barba's job in 2026 ──
   Cross-document view transitions; browsers without support get
   normal loads. Progressive enhancement, zero dependency.        */
@view-transition { navigation: auto; }
::view-transition-old(root) {
  animation: cb-vt-out .34s var(--cb-ease) both;
}
::view-transition-new(root) {
  animation: cb-vt-in .42s var(--cb-ease) both;
}
@keyframes cb-vt-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes cb-vt-in  { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ── Reveal states (choreographed by cb-motion.js) ──────────── */
html.cb-motion [data-reveal],
html.cb-motion .rv {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s var(--cb-ease), transform .7s var(--cb-ease);
}
html.cb-motion [data-reveal].in,
html.cb-motion .rv.in {
  opacity: 1;
  transform: none;
}

/* ── Split-text words ───────────────────────────────────────── */
/* .cb-w wraps each word, .cb-wi is the animated inner span; per-word
   delays set by JS. The reveal is fade + a short rise — NO overflow
   clip. The old rise-from-behind-a-mask (overflow:hidden on .cb-w +
   translateY(110%)) cropped the display face's *italic* ascenders and
   descenders at the display line-heights (0.93–0.95) — the r-top of
   "rning.", the tails of "fail stu", gold italic worst. Dropping the
   mask removes that whole class of bug: no glyph is ever clipped.
   Under static rendering neither class exists — safe. */
html.cb-motion .cb-w {
  display: inline-block;
}
html.cb-motion .cb-wi {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.42em);
  transition: opacity .7s var(--cb-ease), transform .8s var(--cb-ease);
}
html.cb-motion .cb-wi.in { opacity: 1; transform: none; }

/* A [data-split] headline shouldn't ALSO fade as a lump —
   the words carry the reveal. */
html.cb-motion [data-split],
html.cb-motion [data-split].in {
  opacity: 1;
  transform: none;
}

/* ── Marquee bands ──────────────────────────────────────────── */
[data-marquee] {
  overflow: hidden;
  white-space: nowrap;
}
.cb-marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 3.5rem;
  padding-right: 3.5rem;
  will-change: transform;
  animation: cb-marquee linear infinite;
}
[data-marquee]:hover .cb-marquee-track { animation-play-state: paused; }
@keyframes cb-marquee { to { transform: translateX(-50%); } }
html.cb-motion-off .cb-marquee-track { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .cb-marquee-track { animation: none; }
}

/* ── Marquee groups (PAGEKIT1 C2, F-9) ─────────────────────────
   [data-marquee="blocks"] comes from the Motion setting on a group: the
   server wraps its blocks in one .cb-marquee-track. Still, it is a
   wrapped row (no script, reduced motion, motion off); running
   (.is-running, set by cb-motion.js) it is one line of sets that loops,
   pausing on hover and on keyboard focus. Hand-written bands
   ([data-marquee] without "blocks") are untouched above.            */
[data-marquee="blocks"] { white-space: normal; }
[data-marquee="blocks"] > .cb-marquee-track {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 2.5rem;
  max-width: none;
  margin: 0;
  padding: 0;
  animation: none;
  will-change: auto;
}
[data-marquee="blocks"] > .cb-marquee-track > *,
[data-marquee="blocks"] .cb-marquee-set > * { margin: 0; }
[data-marquee="blocks"].is-running {
  /* the band's ends fade, so a word leaves softly instead of being cut */
  -webkit-mask-image: linear-gradient(90deg, transparent, black 6%, black 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, black 6%, black 94%, transparent);
}
[data-marquee="blocks"].is-running > .cb-marquee-track {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0;
  white-space: nowrap;
  will-change: transform;
  animation: cb-marquee linear infinite;
}
[data-marquee="blocks"] .cb-marquee-set {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2.5rem;
  padding-right: 2.5rem;
}
[data-marquee="blocks"]:hover > .cb-marquee-track,
[data-marquee="blocks"]:focus-within > .cb-marquee-track { animation-play-state: paused; }
html.cb-motion [data-marquee="blocks"] [data-reveal],
html.cb-motion [data-marquee="blocks"] .rv { opacity: 1; transform: none; }
html.cb-motion-off [data-marquee="blocks"] > .cb-marquee-track { animation: none; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) {
  [data-marquee="blocks"] > .cb-marquee-track { animation: none !important; flex-wrap: wrap !important; }
}

/* ── Draw (PAGEKIT1 C2) ─────────────────────────────────────────
   A rule down the left edge; the items sit beside it. Still, the rule is
   drawn and every item shown; moving, the rule grows down and the items
   follow it in turn (delays set by cb-motion.js).                     */
[data-draw] { position: relative; padding-left: 1.25rem; }
[data-draw]::before {
  content: "";
  position: absolute;
  left: 0; top: 0.25em; bottom: 0.25em;
  width: 2px;
  background: var(--wp--preset--color--gold, currentColor);
  opacity: 0.45;
  transform-origin: top;
}
html.cb-motion [data-draw]::before { transform: scaleY(0); transition: transform 1.1s var(--cb-ease); }
html.cb-motion [data-draw].in::before { transform: none; }
html.cb-motion [data-draw] > * {
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity .6s var(--cb-ease), transform .6s var(--cb-ease);
}
html.cb-motion [data-draw].in > * { opacity: 1; transform: none; }

/* ── Sticky media (PAGEKIT1 C2) ─────────────────────────────────
   Wide screens only, and only with motion on: the picture (or the first
   column) stays in view while the words beside it scroll.             */
@media (min-width: 782px) {
  html.cb-motion [data-sticky].wp-block-media-text { align-items: start; }
  html.cb-motion [data-sticky] > .wp-block-media-text__media,
  html.cb-motion [data-sticky].wp-block-columns > .wp-block-column:first-child {
    position: sticky;
    top: calc(var(--wp-admin--admin-bar--height, 0px) + 6rem);
    align-self: start;
  }
}

/* ── Scroll-snap sliders ────────────────────────────────────── */
.cb-slider-rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cb-slider-rail::-webkit-scrollbar { display: none; }
.cb-slide {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  flex: 0 0 auto;
}

/* ── Brand preloader (markup pattern: see preloader.html) ───── */
[data-preloader] {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--ink, #1A1812);
  cursor: pointer;
}
[data-preloader].cb-pre-run { display: flex; }
[data-preloader] .cb-pre-word {
  position: absolute;
  font-family: var(--ff-display, "IBM Plex Serif", Georgia, "Times New Roman", serif);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(34px, 6vw, 84px);
  color: var(--white, #EDE9E1);
  opacity: 0;
  animation: cb-pre-word .52s var(--cb-ease) both;
}
[data-preloader] .cb-pre-word:last-child { color: var(--gold-light, #C8A96E); }
@keyframes cb-pre-word {
  0%   { opacity: 0; transform: translateY(18px); }
  28%  { opacity: 1; transform: none; }
  86%  { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-14px); }
}
[data-preloader] .cb-pre-word:last-child {
  animation-name: cb-pre-word-hold; /* the brand word stays */
}
@keyframes cb-pre-word-hold {
  0%   { opacity: 0; transform: translateY(18px); }
  40%  { opacity: 1; transform: none; }
  100% { opacity: 1; transform: none; }
}
[data-preloader].cb-pre-out {
  transition: transform .65s var(--cb-ease);
  transform: translateY(-100%);
}
