/* ============================================================
   Motion — words, boxes, rows, the ask (shared by both cuts; see src/motion.js)
   ============================================================ */
/* ============================================================
   Words — masked words that rise in with a stagger
   ============================================================ */
.is-split .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .06em; margin-bottom: -.06em; }
.is-split .w > span { display: inline-block; transform: translateY(112%) rotate(.6deg); opacity: 0; transition: transform 1.1s cubic-bezier(.22,1,.36,1), opacity .6s ease; transition-delay: calc(var(--i, 0) * 38ms); }
.is-split.is-in .w > span { transform: none; opacity: 1; }
.js-reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s ease, transform 1.1s cubic-bezier(.22,1,.36,1); }
.js-reveal.is-in { opacity: 1; transform: none; }

/* big labels */
.block__label--xl { font-size: clamp(52px, 9.6vw, 150px); letter-spacing: -.03em; line-height: .92; }
.block__label--xl em { font-style: italic; font-weight: 400; color: var(--accent-soft); }
.block__sub { font-family: var(--sans); font-weight: 300; font-size: clamp(14px, 1.05vw, 17px); color: var(--ink-dim); max-width: 38ch; margin-top: 18px; }
body.noir .block--cards .block__sub { text-align: right; }
.block--cards .block__sub { margin-left: auto; margin-right: auto; text-align: center; }
body.noir .block--cards .block__sub { margin-right: 0; }

/* ============================================================
   Boxes — fragments, revealed by clip-path from a corner
   ============================================================ */
.frags { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gutter); max-width: var(--max); margin: 0 auto; align-items: end; }
.box { margin: 0; display: grid; gap: 12px; }
.box--a { grid-column: 1 / span 7; } .box--b { grid-column: 8 / span 5; }
.box--c { grid-column: 1 / span 4; } .box--d { grid-column: 5 / span 4; } .box--e { grid-column: 9 / span 4; }
.box__media { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: #000; border: 1px solid var(--ink-faint); clip-path: inset(100% 0 0 100%); transition: clip-path 1.25s cubic-bezier(.22,1,.36,1); }
.box--b .box__media, .box--d .box__media { aspect-ratio: 1 / 1; clip-path: inset(0 100% 100% 0); }
.box--c .box__media { aspect-ratio: 3 / 4; }
.js-box.is-in .box__media { clip-path: inset(0 0 0 0); }
.box__media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.22,1,.36,1); }   /* no transform at rest: a transformed video layer costs a compositor pass */
.box:hover .box__media video { transform: scale(1.06); }
.box figcaption { display: flex; justify-content: space-between; gap: 12px; opacity: 0; transform: translateY(6px); transition: opacity .7s ease .5s, transform .9s cubic-bezier(.22,1,.36,1) .5s; }
.js-box.is-in figcaption { opacity: 1; transform: none; }
.box__kind { color: var(--accent-soft); }
body.is-light .box__media { background: #ece8df; }

/* ============================================================
   Rows — numbered, hairlines, ghost words on hover
   ============================================================ */
.rows { max-width: var(--max); margin: 0 auto; border-top: 1px solid var(--ink-faint); }
.rowx { position: relative; display: grid; grid-template-columns: 6ch 1fr auto; align-items: baseline; gap: var(--gutter); padding: 30px 0 26px; border-bottom: 1px solid var(--ink-faint); overflow: hidden; }
.rowx__num { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); letter-spacing: .08em; }
.rowx__title { font-family: var(--serif); font-size: clamp(30px, 4.2vw, 64px); line-height: 1; letter-spacing: -.02em; color: var(--ink); transform: translateY(110%); transition: transform 1.1s cubic-bezier(.22,1,.36,1), color .4s; }
.js-row.is-in .rowx__title { transform: none; }
.rowx__tag { justify-self: end; color: var(--ink-dim); position: relative; overflow: hidden; height: 1.2em; }
.rowx__tag > span { display: block; transition: transform .55s cubic-bezier(.22,1,.36,1); }
.rowx__tag > span + span { position: absolute; left: 0; top: 100%; color: var(--accent-soft); white-space: nowrap; }
.rowx:hover .rowx__tag > span { transform: translateY(-100%); }
.rowx:hover .rowx__num { color: var(--accent-soft); }
.rowx__num { transition: color .4s; }
.rowx__ghost { position: absolute; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-soft); opacity: 0; transition: opacity .5s ease, transform .8s cubic-bezier(.22,1,.36,1); pointer-events: none; }
.rowx__ghost--l { left: 8ch; transform: translate(-16px, -50%); }
.rowx__ghost--r { right: 34%; transform: translate(16px, -50%); }
.rowx:hover .rowx__ghost { opacity: 1; transform: translate(0, -50%); }
.rowx:hover .rowx__title { color: var(--accent-soft); }
.rows::after { content: ""; display: block; }
.rowx { transition: background .4s; }
.rowx:hover { background: rgba(61,90,254,.05); }

/* people numbered */
.person__num { color: var(--accent-soft); }

/* the ask */
.close { gap: 18px; }
.close__ask { font-family: var(--sans); font-weight: 300; font-size: clamp(18px, 1.6vw, 26px); color: var(--ink); opacity: .85; margin: 24px 0 0; }
.close__big { font-family: var(--serif); font-style: italic; font-size: clamp(64px, 11vw, 170px); line-height: .9; letter-spacing: -.03em; color: var(--ink); margin: 0; }
.close__line { margin-top: 8px; }

@media (max-width: 900px) {
  .box--a, .box--b, .box--c, .box--d, .box--e { grid-column: 1 / -1; }
  .box--b .box__media, .box--d .box__media, .box--c .box__media { aspect-ratio: 4 / 3; }      /* one rhythm on a phone */
  .rowx { grid-template-columns: 5ch 1fr; padding: 22px 0 20px; }
  .rowx__title { font-size: clamp(26px, 8.4vw, 40px); }
  .rowx__tag { grid-column: 2; justify-self: start; height: auto; overflow: visible; white-space: normal; line-height: 1.5; }
  .rowx__tag > span + span { display: none; }                                                  /* no hover on touch: show the tag, not the answer */
  .rowx__ghost { display: none; }
  .block--cards .block__sub, body.noir .block--cards .block__sub { text-align: left; margin-left: 0; margin-right: auto; }
  .block__label--xl { font-size: clamp(44px, 14vw, 72px); }
  .close__big { font-size: clamp(56px, 17vw, 96px); }
  .is-split .w > span { transition-delay: calc(var(--i, 0) * 22ms); }                         /* shorter lines, quicker stagger */
}

/* studio: the About tag sits above its column instead of in the gutter */
.col--body .mono-tag { position: static; display: block; margin-bottom: 14px; }

/* ============================================================
   Decrypt + peek — the typographic hover
   ============================================================ */
.dc { display: inline-block; min-width: .32em; text-align: center; }
.dc.is-x { color: var(--accent-soft); font-family: var(--mono); font-size: .78em; vertical-align: .08em; }
.rowx__title { display: flex; align-items: center; gap: .22em; flex-wrap: wrap; }
.rowx__title [data-decrypt] { display: inline-block; }
.rowx__peek { display: inline-block; position: relative; height: .9em; width: 0; overflow: hidden; vertical-align: middle; flex: none;
  margin-left: -.22em; transition: width .2s cubic-bezier(.23,1,.32,1), margin-left .2s cubic-bezier(.23,1,.32,1); border-radius: 2px; background: #000; }   /* closed: takes no room, not even the gap */
.rowx__peek video { position: absolute; inset: 0; height: 100%; width: 1.5em; object-fit: cover; }
.rowx:hover .rowx__peek { width: 1.5em; margin-left: 0; transition-duration: .45s; }
.rowx__num::before { content: attr(data-n); }
.rowx:hover .rowx__num::before { content: "(+)"; }
.bar__links a .dc.is-x { font-size: .95em; vertical-align: 0; }

/* fragments: poster still, clip on hover */
.box__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.box__media video { opacity: 0; transition: opacity .5s ease; }
.box.is-live .box__media video { opacity: 1; }

/* work grid: spans from the markup; the poster scales on hover */
.frags--work .box { grid-column: span var(--span, 4); }
.frags--work .box__media { aspect-ratio: 16 / 10; clip-path: inset(100% 0 0 100%); }
.frags--work .box:nth-child(even) .box__media { clip-path: inset(0 100% 100% 0); }
.frags--work .js-box.is-in .box__media { clip-path: inset(0 0 0 0); }
.frags--work .box__poster { transition: transform 1.2s cubic-bezier(.22,1,.36,1); }
.frags--work .box:hover .box__poster { transform: scale(1.05); }
.rowx__peek img { position: absolute; inset: 0; height: 100%; width: 1.5em; object-fit: cover; }
.rowx__title { max-width: 100%; }
@media (max-width: 900px) { .frags--work .box { grid-column: 1 / -1; } }

.frags--work .box[style*='--span:12'] .box__media { aspect-ratio: 21 / 9; }   /* the wide closer */

/* captions read on the field: a hairline above, a quiet backing behind the words */
.frags--work .box figcaption { border-top: 1px solid var(--ink-faint); padding-top: 10px; margin-top: -2px; }
.frags--work .box figcaption .mono-tag { background: var(--bg); padding: 3px 6px 2px; margin-left: -6px; color: var(--ink); }
.frags--work .box figcaption .box__kind { color: var(--accent-soft); margin-left: 0; margin-right: -6px; }
body.is-light .frags--work .box figcaption .mono-tag { background: var(--bg); }

/* the visitor's word */
.say { display: flex; align-items: center; gap: 14px; margin-top: 26px; border-bottom: 1px solid var(--ink-faint); padding-bottom: 10px; width: min(420px, 100%); }
.say__label { white-space: nowrap; color: var(--accent-soft); }
.say__input { flex: 1; background: none; border: 0; color: var(--ink); font-family: var(--serif); font-size: clamp(20px, 1.8vw, 28px); padding: 4px 0; outline: none; min-width: 0; }
.say__input::placeholder { color: var(--ink-dim); opacity: .7; }
.say__go { color: var(--accent-soft); font-family: var(--mono); font-size: 18px; padding: 4px 8px; transition: transform .4s cubic-bezier(.22,1,.36,1), color .3s; }
.say__go:hover { transform: translateX(6px); color: var(--ink); }
.say.is-sent { border-bottom-color: var(--accent); }
.block__head--center .say { margin-left: auto; margin-right: auto; justify-content: center; }

.box { position: relative; } .box__link, .rowx__link { position: absolute; inset: 0; z-index: 3; font-size: 0; }
.rowx { position: relative; }

/* depixelate: the still resolves out of big cells */
.depix { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; pointer-events: none; z-index: 2; transition: opacity .26s ease; }
.depix.is-done { opacity: 0; }

/* leaving for a case: the copy and chrome fade while the field splits (see initLeave) */
html.is-leaving main, html.is-leaving .bar, html.is-leaving .bar__brand, html.is-leaving .bar__cta, html.is-leaving .frame { opacity: 0 !important; transition: opacity .42s ease !important; }
html.is-leaving body::after { content: ''; position: fixed; inset: 0; z-index: 50; background: #05060a; opacity: 0; animation: leave-fade .46s ease forwards; pointer-events: none; }
@keyframes leave-fade { to { opacity: 1; } }

/* phones: nothing may be wider than the screen — captions wrap, grid children may shrink, the work boxes take the full row */
@media (max-width: 900px) {
  .frags { grid-template-columns: 1fr; }
  .frags .box { grid-column: 1 / -1 !important; min-width: 0; }
  .box figcaption { flex-wrap: wrap; }
  .box figcaption .mono-tag, .founder figcaption .mono-tag, .rowx .mono-tag { white-space: normal; line-height: 1.5; }
  .say { width: 100%; min-width: 0; } .say__input { min-width: 0; flex: 1; }
  .team > * { min-width: 0; }
}
