/* ── Case study page (2026-11-15) ──
   A 6-column grid inside the page gutter (24px desktop, 16px at 900px and below).
   Text blocks sit on that grid at a few set positions; media blocks come in a handful of fixed arrangements.
   Every media slot is an empty placeholder (.cx-ph) until real images are dropped in. */

.cx { --cx-gap: var(--gutter); --cx-space: clamp(80px, 9vw, 144px); --cx-sub: #8a8a8a; --cx-fill: #141414; --cx-line: rgb(255 255 255 / .12); color: var(--ink); }
.cx > * + * { margin-top: var(--cx-space); }
.cx-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--cx-gap); padding-inline: var(--gutter); }

/* the empty image slot */
.cx-ph { position: relative; display: block; width: 100%; height: 100%; min-height: 0; background: var(--cx-fill); border-radius: 4px; overflow: hidden; }
.cx-ph::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--cx-line); border-radius: inherit; pointer-events: none; }

/* small type shared by labels, meta and captions */
.cx-small { font: 400 14px/1.4 var(--apple); letter-spacing: -.01em; }
.cx-small--sub { color: var(--cx-sub); }

/* ── 1. hero ── */
.cx-hero__head { min-height: 420px; display: flex; flex-direction: column; padding-top: 96px; }
.cx-hero__title { margin-block: auto; padding: 0 var(--gutter) 48px; font: 500 clamp(34px, 9vw, 56px)/1.06 "Orbitron", var(--apple); letter-spacing: -.01em; color: #fff; overflow-wrap: anywhere; text-wrap: balance; }
.cx-hero__meta { padding-bottom: var(--gutter); }
.cx-meta--type { grid-column: 1 / 3; }
.cx-meta--stage { grid-column: 3 / 5; }
.cx-meta--deliv { grid-column: 5 / -1; }
.cx-meta--live { display: none; }
.cx-hero__meta dt { font-weight: 500; margin-bottom: .25em; }
.cx-hero__meta :is(dt, dd) { line-height: 1.55; }
.cx-hero__meta dd { color: var(--cx-sub); }
.cx-hero__meta a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.cx-hero__media { height: 173vw; }
.cx-hero__media .cx-ph { border-radius: 0; }

/* ── 2. title and text: a small label over a large line ── */
.cx-tt__in { grid-column: 1 / -1; }
.cx-tt__label { font: 400 18px/1.3 var(--apple); letter-spacing: -.01em; margin-bottom: 16px; color: #fff; }
.cx-tt__text { font: 400 28px/1.21 var(--apple); letter-spacing: -.02em; color: #fff; text-wrap: pretty; }
.cx-tt--mid .cx-tt__text, .cx-tt--right .cx-tt__text { font-size: 24px; line-height: 1.2; letter-spacing: -.03em; }
.cx-tt__note { margin-top: 24px; max-width: 34em; }

/* ── 3. media arrangements ── */
.cx-media { display: flex; flex-direction: column; gap: var(--cx-gap); padding-inline: var(--gutter); }
.cx-media .cx-ph { height: auto; }
.cx-cap { max-width: 100%; }
.cx-cap p + p { margin-top: 1em; }

/* one wide image */
.cx-one .cx-ph { aspect-ratio: 100 / 51.6; }

/* two: tall left, two stacked right (lower one is a caption) */
.cx-two-a > .cx-ph:nth-child(1) { aspect-ratio: 100 / 91; }
.cx-two-a > .cx-ph:nth-child(2) { aspect-ratio: 100 / 51.6; }

/* two: small left under a caption, large right */
.cx-two-b > .cx-ph:nth-child(2) { aspect-ratio: 100 / 114; }
.cx-two-b > .cx-ph:nth-child(3) { aspect-ratio: 100 / 73; }

/* three: one wide, then tall left and short right with a caption */
.cx-three > .cx-ph:nth-child(1) { aspect-ratio: 100 / 51; }
.cx-three > .cx-ph:nth-child(2) { aspect-ratio: 100 / 91; }
.cx-three > .cx-ph:nth-child(3) { aspect-ratio: 100 / 51.6; }

/* sideways strip of tall and wide frames */
.cx-strip { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none; padding-inline: var(--gutter); overscroll-behavior-x: contain; }
.cx-strip::-webkit-scrollbar { display: none; }
.cx-strip__item { flex: none; scroll-snap-align: start; }
/* real screenshots fill their frame from the top; positioned so they paint over the reveal layer (.cx-ph::before) */
.cx-strip__item .cx-ph > img { position: relative; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 0 0; }
.cx-strip__item--tall { width: 82%; height: 104vw; }
.cx-strip__item--wide { width: 89%; height: 71vw; align-self: center; }

/* ── 4. text rows (contribution, features) ── */
.cx-rows__list { grid-column: 1 / -1; display: grid; }
.cx-rows__list li { display: grid; gap: 8px; padding-block: 24px; border-top: 1px solid var(--cx-line); }
.cx-rows__list li:last-child { border-bottom: 1px solid var(--cx-line); }
.cx-rows__list h3 { font: 400 20px/1.3 var(--apple); letter-spacing: -.01em; color: #fff; }
.cx-rows__num { font: 400 12px/1.4 var(--mono); color: var(--cx-sub); }

/* ── 5. stat rows ── */
.cx-stats__title { grid-column: 1 / -1; font: 400 28px/1.21 var(--apple); letter-spacing: -.02em; color: #fff; margin-bottom: 56px; }
.cx-stats__list { grid-column: 1 / -1; }
.cx-stat { position: relative; display: flex; flex-direction: column; gap: 32px; padding-block: 48px; border-top: 1px solid var(--cx-line); }
.cx-stat__num { font: 240 96px/.85 var(--display); letter-spacing: -.015em; color: #fff; }
.cx-stat__label { font: 400 20px/1.2 var(--apple); color: #fff; }

/* ── 6. live link ── */
.cx-live { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-block: 24px; border-block: 1px solid var(--cx-line); color: #fff; }
.cx-live__url { font: 400 24px/1.2 var(--apple); letter-spacing: -.02em; }

/* ── 7. next case study ── */
.cx-next { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 80px; overflow: hidden; color: #fff; }
/* 2026-11-15: the line behind the card is an endless marquee running left to right ("… • Next case studies • …").
   Two identical halves sit in .cx-next__run, so sliding it from -50% to 0 loops without a seam. */
.cx-next__ticker { position: absolute; top: 50%; left: 0; right: 0; z-index: 0; transform: translateY(-50%); display: flex; overflow: hidden; font: 500 40px/1 "Orbitron", var(--apple); letter-spacing: -.01em; white-space: nowrap; color: rgb(255 255 255 / .9); pointer-events: none; }
.cx-next__run { display: flex; flex: none; width: max-content; will-change: transform; animation: cx-marquee 28s linear infinite; }
.cx-next__item { flex: none; padding-right: .6em; }
.cx-next__item::after { content: "•"; padding-left: .6em; }
@keyframes cx-marquee { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .cx-next__run { animation: none; } }
.cx-next__card { position: relative; z-index: 1; display: block; width: 61vw; }
.cx-next__card .cx-ph { aspect-ratio: 61 / 90; border-radius: 8px; transition: transform .6s var(--ease); }
.cx-next__card:hover .cx-ph, .cx-next__card:focus-visible .cx-ph { transform: scale(.98); }
.cx-next__name { display: block; margin-top: 24px; font: 400 18px/1.3 var(--apple); letter-spacing: -.01em; }
.cx-next__line { display: block; }

/* ── desktop ── */
@media (min-width: 901px) {
  .cx-small { font-size: 16px; }

  .cx-hero__head { min-height: 450px; }
  .cx-hero__title { font-size: clamp(64px, 7.2vw, 112px); }
  .cx-meta--stage { grid-column: 4 / 5; }
  .cx-meta--live { display: block; grid-column: 3 / 4; grid-row: 1; }
  .cx-hero__media { height: 58.2vw; }

  .cx-tt__in { grid-column: 1 / 6; }
  .cx-tt--mid .cx-tt__in { grid-column: 2 / 5; }
  .cx-tt--right .cx-tt__in { grid-column: 4 / -1; }
  .cx-tt__label { font-size: 20px; margin-bottom: 28px; }
  .cx-tt__text { font-size: clamp(40px, 3.8vw, 56px); }
  .cx-tt--mid .cx-tt__text, .cx-tt--right .cx-tt__text { font-size: clamp(30px, 2.7vw, 40px); }

  .cx-media { display: grid; }
  .cx-media .cx-ph { aspect-ratio: auto; }
  .cx-cap { width: clamp(220px, 14.8vw, 300px); }

  .cx-one .cx-ph { height: min(54vw, calc(100svh - 2 * var(--gutter))); }

  .cx-two-a { grid-template-columns: 1fr 1fr; grid-template-areas: "a b" "a c"; }
  .cx-two-a > .cx-ph:nth-child(1) { grid-area: a; height: min(47vw, 100svh); }
  .cx-two-a > .cx-ph:nth-child(2) { grid-area: b; height: 26.7vw; }
  .cx-two-a > .cx-cap { grid-area: c; justify-self: end; }

  .cx-two-b { grid-template-columns: .31fr .69fr; grid-template-areas: "a c" "b c"; }
  .cx-two-b > .cx-cap { grid-area: a; }
  .cx-two-b > .cx-ph:nth-child(2) { grid-area: b; height: 39vw; align-self: end; }
  .cx-two-b > .cx-ph:nth-child(3) { grid-area: c; height: min(51vw, 100svh); }

  .cx-three { grid-template-columns: 1fr 1fr; grid-template-areas: "a a" "b c" "b d"; }
  .cx-three > .cx-ph:nth-child(1) { grid-area: a; height: min(54vw, calc(100svh - 2 * var(--gutter))); }
  .cx-three > .cx-ph:nth-child(2) { grid-area: b; height: min(47vw, 100svh); }
  .cx-three > .cx-ph:nth-child(3) { grid-area: c; height: 26.7vw; }
  .cx-three > .cx-cap { grid-area: d; justify-self: end; }

  .cx-strip { gap: 12.8vw; }
  .cx-strip__item--tall { width: 23vw; height: 39.4vw; }
  .cx-strip__item--wide { width: 32vw; height: 31.7vw; }

  .cx-rows__list { grid-column: 2 / -1; }
  .cx-rows__list li { grid-template-columns: 2fr 3fr; gap: var(--cx-gap); padding-block: 32px; }
  .cx-rows--num .cx-rows__list li { grid-template-columns: 48px 2fr 3fr; }

  .cx-stats { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .cx-stats__title { grid-column: 2 / 8; font-size: clamp(40px, 3.8vw, 56px); margin-bottom: 112px; }
  .cx-stats__list { grid-column: 2 / 12; }
  .cx-stat { flex-direction: row; align-items: flex-end; justify-content: flex-end; gap: 72px; padding-block: 80px; }
  .cx-stat__num { font-size: clamp(84px, 9.3vw, 140px); }
  .cx-stat__label { width: 25.7%; flex: none; }

  .cx-live__url { font-size: 32px; }

  .cx-next { padding-top: 0; justify-content: center; }
  .cx-next__ticker { font-size: clamp(72px, 9vw, 150px); }
  .cx-next__card { width: 31.2vw; }
  .cx-next__name { font-size: 20px; }
}

/* ── services page extras: the film in the hero slot, the drawings stage and the team on the page gutter ── */
.cx-pad { padding-inline: var(--gutter); }
.cx-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cx-hero__media .cx-play { opacity: 0; transition: opacity .3s var(--ease), background .3s var(--ease); }
.cx-hero__media:hover .cx-play, .cx-play:focus-visible, .cx-play.is-paused { opacity: 1; }
@media (hover: none) { .cx-hero__media .cx-play { opacity: 1; } }
.cx--services .cx-hero__media { height: min(56.25vw, 100svh); }
.cx-svc { margin-top: calc(var(--cx-space) * .6) !important; }
.cx-quote__by { display: flex; align-items: center; gap: 14px; margin-top: 32px; }
.cx-quote__by img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; filter: grayscale(1); }
.cx-quote__name { color: #fff; font-weight: 500; }
blockquote.cx-tt__text { margin: 0; }
.cx-team .team__globe { margin-bottom: clamp(48px, 6vw, 96px); }
.cx--services .team { scroll-margin-top: 88px; }

/* ── motion (2026-11-15) ──
   The hero plays in on load: the title rises out of a mask, the meta row follows, the picture opens upward.
   It waits while the menu's cover is still lifting. Further down, assets/motion.js adds .is-in to each image slot
   as it scrolls into view, and the slot opens from the bottom while its fill settles from a slight zoom. */
@media (prefers-reduced-motion: no-preference) {
  .cx-hero__title { animation: cx-rise 1.1s cubic-bezier(.2, .7, .1, 1) .15s both; }
  .cx-hero__meta > div { animation: cx-fade .9s cubic-bezier(.2, .7, .1, 1) both; }
  .cx-hero__meta > div:nth-child(1) { animation-delay: .35s; }
  .cx-hero__meta > div:nth-child(2) { animation-delay: .42s; }
  .cx-hero__meta > div:nth-child(3) { animation-delay: .49s; }
  .cx-hero__meta > div:nth-child(4) { animation-delay: .56s; }
  .cx-hero__media { animation: cx-open 1.3s cubic-bezier(.7, 0, .2, 1) .3s both; }
  .cx-hero__media > .cx-ph { animation: cx-settle 1.8s cubic-bezier(.2, .7, .1, 1) .3s both; }
  html.has-menu-cover:not(.is-uncovering) :is(.cx-hero__title, .cx-hero__meta > div, .cx-hero__media, .cx-hero__media > .cx-ph) { animation-play-state: paused; }

  html.has-gsap .cx-media > .cx-ph, html.has-gsap .cx-strip__item > .cx-ph, html.has-gsap .cx-next__card > .cx-ph {
    clip-path: inset(100% 0 0 0 round 4px); transition: clip-path 1.2s cubic-bezier(.7, 0, .2, 1); }
  html.has-gsap .cx-ph.is-in { clip-path: inset(0 0 0 0 round 4px); }
  html.has-gsap .cx-next__card > .cx-ph.is-in { transition: clip-path 1.2s cubic-bezier(.7, 0, .2, 1), transform .6s var(--ease); }
  html.has-gsap .cx-ph::before { content: ""; position: absolute; inset: 0; background: inherit; transform: scale(1.12); transition: transform 1.8s cubic-bezier(.2, .7, .1, 1); }
  html.has-gsap .cx-ph.is-in::before { transform: none; }

  .cx-rows__list li { transition-delay: 0s; }
}
@keyframes cx-rise { from { opacity: 0; transform: translateY(60px); clip-path: inset(0 0 100% 0); } to { opacity: 1; transform: none; clip-path: inset(0 0 -20% 0); } }
@keyframes cx-fade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes cx-open { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes cx-settle { from { transform: scale(1.15); } to { transform: none; } }

@media (prefers-reduced-motion: reduce) { .cx-next__card .cx-ph { transition: none; } }

/* ── the strip can be dragged sideways with the mouse (assets/strip.js); snapping is off while it is held ── */
@media (hover: hover) and (pointer: fine) {
  .cx-strip { -webkit-user-select: none; user-select: none; }
  .cx-strip.is-dragging { scroll-snap-type: none; }
  .cx-strip img { -webkit-user-drag: none; }
}
