/* Lane & index page motion (Experiential, Broadcast, Print, Work).
   Every hidden starting state is scoped under html.lm, which lane-motion.js
   adds only when motion is allowed - without JS, or with reduced motion,
   nothing here applies and the pages render exactly as before. */

/* ---------- hero: headline words rise, the accent rule draws ---------- */
.lm .page-hero { position: relative; }
.lm .page-hero h1 .w { display: inline-block; opacity: 0; transform: translateY(.38em); }
.lm.lm-go .page-hero h1 .w { opacity: 1; transform: none;
  transition: opacity .6s ease var(--d), transform .8s cubic-bezier(.2,.7,.2,1) var(--d); }
.lm .page-hero .eyebrow, .lm .page-hero .page-hero-sub { opacity: 0; transform: translateY(10px); }
.lm.lm-go .page-hero .eyebrow { opacity: 1; transform: none; transition: opacity .6s ease .05s, transform .7s ease .05s; }
.lm.lm-go .page-hero .page-hero-sub { opacity: 1; transform: none; transition: opacity .7s ease var(--sub-d, .9s), transform .8s ease var(--sub-d, .9s); }
.lm .page-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px;
  background: var(--accent-light); transform: scaleX(0); transform-origin: left; }
.lm.lm-go .page-hero::after { transform: scaleX(1); transition: transform 1.4s cubic-bezier(.65,0,.35,1) .3s; }

/* ---------- section heads: the italic phrase arrives after the rest ---------- */
.lm .section-head h2 em { display: inline-block; opacity: 0; transform: translateY(.22em); }
.lm .section-head.in h2 em { opacity: 1; transform: none;
  transition: opacity .8s ease .35s, transform .8s cubic-bezier(.2,.7,.2,1) .35s; }

/* ---------- cards and work items: arrive in a staggered wave ---------- */
.lm .lm-r { opacity: 0; transform: translateY(24px);
  transition: opacity .7s ease var(--d, 0s), transform .8s cubic-bezier(.2,.7,.2,1) var(--d, 0s), border-color .25s; }
.lm .lm-r.lm-in { opacity: 1; transform: none; }
.lm .lm-r.lm-done { transition: border-color .25s, transform .25s; }
.lm .lm-r.lm-in .card-cta { animation: lm-nudge .7s ease calc(var(--d, 0s) + .6s) 1 both; }
@keyframes lm-nudge { 0%, 100% { transform: none; } 45% { transform: translateX(6px); } }
/* tags on the Work index pop in once their card lands */
.lm .lm-r .tag-row span { opacity: 0; transform: scale(.7); }
.lm .lm-r.lm-in .tag-row span { opacity: 1; transform: none;
  transition: opacity .3s ease calc(var(--d, 0s) + .35s + var(--t, 0s)), transform .45s cubic-bezier(.34,1.7,.64,1) calc(var(--d, 0s) + .35s + var(--t, 0s)); }
/* re-filtering the Work index replays the wave for the cards that remain */
.lm .lm-r.lm-pop { animation: lm-pop .6s cubic-bezier(.2,.7,.2,1) var(--d, 0s) both; }
@keyframes lm-pop { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- photos: open from the bottom, settle in scale ---------- */
.lm .photo-slot img { clip-path: inset(100% 0 0 0); transform: scale(1.08);
  transition: clip-path 1.1s cubic-bezier(.65,0,.35,1) var(--d, 0s), transform 1.8s cubic-bezier(.2,.7,.2,1) var(--d, 0s); }
.lm .photo-slot.lm-in img { clip-path: inset(0 0 0 0); transform: none; }
.lm .photo-note { opacity: 0; transition: opacity .6s ease .9s; }
.lm .photo-pair.lm-in .photo-note, .lm .lm-in > .photo-note { opacity: 1; }

/* ---------- video players wipe on like a cut ---------- */
.lm .video-frame { clip-path: inset(0 100% 0 0); transition: clip-path 1s cubic-bezier(.65,0,.35,1) .1s, box-shadow .25s; }
.lm .video-hero.lm-in .video-frame { clip-path: inset(0 0 0 0); }

/* ---------- chip stacks and client rosters ---------- */
.lm .stack span { opacity: 0; transform: scale(.75); }
.lm .stack.in span { opacity: 1; transform: none;
  transition: opacity .3s ease var(--d), transform .5s cubic-bezier(.34,1.7,.64,1) var(--d); }
.lm .roster-grid li { opacity: 0; transform: translateY(10px); }
.lm .roster-grid.in li { opacity: 1; transform: none; transition: opacity .45s ease var(--d), transform .55s ease var(--d); }

/* ---------- print: capability lists, posters, the six-step workflow ---------- */
.lm .do-list li { opacity: 0; transform: translateX(-12px); }
.lm .lm-r.lm-in .do-list li, .lm .card.in .do-list li { opacity: 1; transform: none; transition: opacity .4s ease var(--d), transform .5s ease var(--d); }
.lm .feature-posters img { opacity: 0; transform: translateY(36px); }
.lm .feature.in .feature-posters img { opacity: 1; transform: none;
  transition: opacity .6s ease var(--d), transform .9s cubic-bezier(.2,.7,.2,1) var(--d);
  animation: lm-light 1.3s ease calc(var(--d) + .8s) 1 both; }
@keyframes lm-light { 0% { filter: none; } 35% { filter: brightness(1.3) saturate(1.1); } 100% { filter: none; } }
.lm .workflow { position: relative; }
.lm .workflow::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 3px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; z-index: 1; }
.lm .workflow.in::before { transform: scaleX(1); transition: transform 2.6s linear .3s; }
.lm .workflow-step { opacity: .2; transition: opacity .5s ease var(--d), background .6s ease var(--d); }
.lm .workflow.in .workflow-step { opacity: 1; }
.lm .workflow-step .wf-num { display: inline-block; transform: scale(.4); }
.lm .workflow.in .workflow-step .wf-num { transform: none; transition: transform .5s cubic-bezier(.34,1.8,.64,1) var(--d); }

/* ---------- work index filter buttons slide in ---------- */
.lm .work-filter button { opacity: 0; transform: translateY(8px); }
.lm.lm-go .work-filter button { opacity: 1; transform: none; transition: opacity .4s ease var(--d), transform .5s ease var(--d); }

@media (prefers-reduced-motion: reduce) {
  .lm * { animation: none !important; transition: none !important; }
}

/* ---------- case study cards: the work shows through on rollover ----------
   Each case-study card gets its photo as --thumb (matched by link target, so
   the same rule serves the Work index and every lane page). On hover the photo
   fades up behind the card from the right, under a cream wash that keeps the
   text on the left fully readable. Hover-capable pointers only. */
.card--link[href$="content-operations-system.html"] { --thumb: url("images/thumbs/content-operations-system.webp"); }
.card--link[href$="splunk-ar-filters.html"]         { --thumb: url("images/thumbs/splunk-ar-filters.webp"); }
.card--link[href$="thiz-iz-peelz.html"]             { --thumb: url("images/thumbs/thiz-iz-peelz.webp"); }
.card--link[href$="life-is-better-with-akamai.html"]{ --thumb: url("images/thumbs/life-is-better-with-akamai.webp"); }
.card--link[href$="be-kids.html"]                   { --thumb: url("images/thumbs/be-kids.webp"); }
.card--link[href$="150-year-old-startup-site.html"] { --thumb: url("images/thumbs/150-year-old-startup-site.webp"); }
.card--link[href$="t-mobile.html"]                  { --thumb: url("images/thumbs/t-mobile.webp"); }
.card--link[href$="samsung-unpacked.html"]          { --thumb: url("images/thumbs/samsung-unpacked.webp"); }
.card--link[href$="digital-signage.html"]           { --thumb: url("images/thumbs/digital-signage.webp"); }
.card--link[href$="shoe-launch.html"]               { --thumb: url("images/thumbs/shoe-launch.webp"); }
.card--link[href$="every-byte-counts.html"]         { --thumb: url("images/thumbs/every-byte-counts.webp"); }
.card--link[href$="gitty-up-buttercup.html"]        { --thumb: url("images/thumbs/gitty-up-buttercup.webp"); }

/* full-width cards (Work index): keep the description off the photo side */
.cards--1 .card--link p { max-width: 68ch; }

@media (hover: hover) {
  .card--link { position: relative; overflow: hidden; isolation: isolate; }
  .card--link::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background:
      linear-gradient(90deg, rgba(245,243,238,.97) 0%, rgba(245,243,238,.95) 60%, rgba(245,243,238,.6) 82%, rgba(245,243,238,.12) 100%),
      var(--thumb, none) right center / cover no-repeat;
    opacity: 0; transform: scale(1.06); transform-origin: right center;
    transition: opacity .45s ease, transform 1.2s cubic-bezier(.2,.7,.2,1);
  }
  .card--link:hover::before, .card--link:focus-visible::before { opacity: 1; transform: none; }
}
@media (hover: hover) and (prefers-reduced-motion: reduce) {
  .card--link::before { transform: none; transition: opacity .2s ease; }
}

/* ---------- discipline colour, carried through ----------
   style.css gives each discipline page a hue via <body data-lane> (--lane for
   rules, --lane-ink for text on cream). Here it also drives the headline
   accents, the motion, and the case-study cards. --lane-light is the same hue
   lifted for text on the navy hero. */
body[data-lane="experiential"] { --lane-light: oklch(0.78 0.13 80); }
body[data-lane="broadcast"]    { --lane-light: oklch(0.74 0.15 27); }
body[data-lane="operations"]   { --lane-light: oklch(0.76 0.12 165); }
body[data-lane="digital"]      { --lane-light: oklch(0.76 0.11 250); }
body[data-lane="print"]        { --lane-light: oklch(0.77 0.11 330); }

body[data-lane] .page-hero .eyebrow,
body[data-lane] .page-hero h1 em { color: var(--lane-light); }
body[data-lane] .eyebrow:not(.page-hero .eyebrow) { color: var(--lane-ink); }
body[data-lane] .section-head h2 em { color: var(--lane-ink); }
body[data-lane] .card .card-meta { color: var(--lane-ink); }
body[data-lane] .workflow-step .wf-num { color: var(--lane-ink); }
.lm .page-hero::after { background: var(--lane-light, var(--accent-light)); }
body[data-lane] .workflow::before { background: var(--lane); }

/* case-study cards: on a discipline page they take that page's colour; on the
   Work index each card takes its own discipline (the first one it lists),
   matching the filter dots */
body[data-lane] .card--link { --card-c: var(--lane); --card-ink: var(--lane-ink); }
.card--link[data-medium^="experiential"] { --card-c: oklch(0.62 0.125 80); --card-ink: oklch(0.53 0.11 80); }
.card--link[data-medium^="broadcast"]    { --card-c: oklch(0.60 0.19 27);  --card-ink: oklch(0.52 0.17 27); }
.card--link[data-medium^="print"]        { --card-c: oklch(0.64 0.13 330); --card-ink: oklch(0.54 0.13 330); }
.card--link[data-medium^="digital"]      { --card-c: oklch(0.64 0.13 250); --card-ink: oklch(0.53 0.13 250); }
.card--link[data-medium^="operations"]   { --card-c: oklch(0.60 0.13 165); --card-ink: oklch(0.51 0.13 165); }
.card--link[data-medium] .card-meta { color: var(--card-ink); }
.card--link:hover { border-color: var(--card-c, var(--accent)); }
.card--link:hover .card-cta { color: var(--card-ink, var(--accent)); }

@media (hover: hover) {
  /* a bar in the card's colour draws down its left edge on rollover */
  .card--link::after { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 4px; pointer-events: none;
    background: var(--card-c, var(--accent)); transform: scaleY(0); transform-origin: top;
    transition: transform .45s cubic-bezier(.2,.7,.2,1); }
  .card--link:hover::after, .card--link:focus-visible::after { transform: none; }
}

/* two- and three-up cards: the text spans the whole card, so the photo stays
   further back and only really shows at the far right edge */
@media (hover: hover) {
  .cards--2 .card--link:not(.card--wide)::before,
  .cards--3 .card--link::before {
    background:
      linear-gradient(90deg, rgba(245,243,238,.97) 0%, rgba(245,243,238,.94) 62%, rgba(245,243,238,.72) 86%, rgba(245,243,238,.38) 100%),
      var(--thumb, none) right center / cover no-repeat;
  }
}

/* Work index filter: a case study that spans several disciplines takes the
   colour of the one being filtered for (body[data-filter] is set by the
   filter script), instead of its first-listed discipline */
body[data-filter="experiential"] .card--link[data-medium~="experiential"] { --card-c: oklch(0.62 0.125 80); --card-ink: oklch(0.53 0.11 80); }
body[data-filter="broadcast"]    .card--link[data-medium~="broadcast"]    { --card-c: oklch(0.60 0.19 27);  --card-ink: oklch(0.52 0.17 27); }
body[data-filter="print"]        .card--link[data-medium~="print"]        { --card-c: oklch(0.64 0.13 330); --card-ink: oklch(0.54 0.13 330); }
body[data-filter="digital"]      .card--link[data-medium~="digital"]      { --card-c: oklch(0.64 0.13 250); --card-ink: oklch(0.53 0.13 250); }
body[data-filter="operations"]   .card--link[data-medium~="operations"]   { --card-c: oklch(0.60 0.13 165); --card-ink: oklch(0.51 0.13 165); }
.card--link[data-medium] .card-meta, .card--link[data-medium] .card-cta { transition: color .35s ease; }
.card--link[data-medium] .card-cta { color: var(--card-ink); }

/* ---------- quiet cross-links between discipline pages ----------
   A small text link inside an ordinary card, deliberately lower-key than the
   case-study cards (no full-card link, no hover photo, no colour bar), so the
   case studies stay the main thing to click on each page. */
.card-xlink { display: inline-flex; align-items: center; gap: .45rem; margin-top: 1.2rem;
  font-family: var(--mono); font-size: var(--label, .68rem); letter-spacing: .12em; text-transform: uppercase;
  color: var(--warm-mid); text-decoration: none; border-bottom: 1px solid var(--rule); padding-bottom: 3px;
  transition: color .2s ease, border-color .2s ease; }
.card-xlink:hover, .card-xlink:focus-visible { color: var(--lane-ink, var(--accent)); border-color: currentColor; }
.card-xlink span { transition: transform .2s ease; }
.card-xlink:hover span { transform: translateX(3px); }
.section--dark .card-xlink { color: rgba(245,243,238,.68); border-color: rgba(245,243,238,.25); }
.section--dark .card-xlink:hover, .section--dark .card-xlink:focus-visible { color: var(--lane-light, var(--accent-light)); }

/* dark bands on a discipline page: use the lifted shade, not the cream-ground ink */
body[data-lane] .section--dark .section-kicker,
body[data-lane] .section--dark .eyebrow,
body[data-lane] .section--dark .section-head h2 em,
body[data-lane] .section--dark .card .card-meta { color: var(--lane-light); }
