/* ==========================================================
   Big motion moments: rolling numbers, giant services list,
   pixel photos, sliced headlines, photo trail, footer word.
   ========================================================== */

/* Rolling numbers. Without JS or with reduced motion this stays a plain grid. */
.rollnums { position: relative; color: #fff; background: var(--red); padding: clamp(60px, 8vw, 110px) var(--gutter); }
.rollnums .kick { color: inherit; }
.rollnums .kick::before { background: #fff; }
.rollnums__list { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; margin: 0; padding: 0; }
.rollnums__list b { display: block; font-size: clamp(52px, 6.6vw, 104px); font-weight: 500; line-height: 1; letter-spacing: -0.05em; }
.rollnums__list h3 { margin-top: 14px; font-size: 18px; font-weight: 500; letter-spacing: -0.015em; }
.rollnums__list p { margin-top: 4px; font-size: 15px; line-height: 1.45; color: rgba(255,255,255,.86); }
.rollnums__pill, .rollnums__dots { display: none; }

.rollnums.is-live { height: 340svh; padding: 0; background: none; }
.is-live .rollnums__pin { position: sticky; top: 0; height: 100svh; overflow: hidden; display: grid; place-items: center; padding: 0 var(--gutter); background: var(--roll, var(--red)); }
.rollnums.is-live .kick { position: absolute; left: var(--gutter); top: clamp(84px, 13svh, 120px); margin: 0; }
.is-live .rollnums__pill { display: block; position: relative; z-index: 1; width: clamp(240px, 34vw, 500px); height: clamp(112px, 15vw, 210px); border-radius: 999px; overflow: hidden; color: #141414; background: #fff; box-shadow: 0 30px 80px -28px rgba(0,0,0,.45); }
.rollnums__reel { will-change: transform; }
.rollnums__reel span { display: grid; place-items: center; height: clamp(112px, 15vw, 210px); font-size: clamp(66px, 10vw, 148px); font-weight: 500; line-height: 1; letter-spacing: -0.055em; font-variant-numeric: tabular-nums; }
.is-live .rollnums__list { position: absolute; inset: 0; display: block; pointer-events: none; }
.is-live .rollnums__list li { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr clamp(240px, 34vw, 500px) 1fr; column-gap: clamp(24px, 4vw, 64px); align-items: center; padding: 0 var(--gutter); opacity: var(--o, 0); }
.is-live .rollnums__list b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.is-live .rollnums__list h3 { grid-column: 1; margin: 0; font-size: clamp(24px, 3vw, 44px); line-height: 1.06; letter-spacing: -0.035em; text-align: right; transform: translateY(var(--y, 0)); }
.is-live .rollnums__list p { grid-column: 3; margin: 0; max-width: 28ch; font-size: clamp(15px, 1.25vw, 18px); transform: translateY(calc(var(--y, 0) * -1)); }
.is-live .rollnums__dots { position: absolute; left: 0; right: 0; bottom: clamp(26px, 6svh, 56px); display: flex; justify-content: center; gap: 8px; }
.rollnums__dots i { width: 9px; height: 9px; border-radius: 2px; background: #fff; opacity: .35; transition: opacity .25s; }
.rollnums__dots i.on { opacity: 1; }

/* Giant services list */
.sv .svc-list a { padding: clamp(16px, 1.8vw, 26px) clamp(8px, 1.4vw, 20px); font-size: clamp(32px, 6vw, 96px); line-height: 1.08; letter-spacing: -0.05em; transition: color .3s, padding .45s var(--ease); }
.sv .svc-list a > span:first-child { flex: 0 0 auto; font-size: 14px; letter-spacing: 0; transition: color .3s; }
.sv .svc-list li:hover a { padding-left: clamp(8px, 1.4vw, 20px); }
.sv .svc-list li:hover a > span:first-child { color: #fff; }
.sv .svc-list li { position: relative; isolation: isolate; }
.sv .svc-list li::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--red); transform: scaleY(0); transform-origin: 50% 100%; transition: transform .45s var(--ease); }
.sv .svc-list li:hover::before { transform: scaleY(1); }
.sv .svc-list em { position: relative; transition: color .3s; }
.sv .svc-list li:hover em { color: #fff; }
.sv .svc-list:hover li:not(:hover) a { color: rgba(255,255,255,.34); }
.sv .svc-list a .roll, .sv .svc-list a .roll > span { flex: 0 0 auto; margin: 0; width: auto; font: inherit; letter-spacing: inherit; color: inherit; opacity: 1; white-space: nowrap; }
.sv .svc-list a .roll { padding-bottom: .08em; }
.sv .svc-list a:hover > .roll > span { transform: translateY(-135%); }
/* the photo sits at the right end of the hovered row, in place of its description */
.sv .svc-preview { --pw: clamp(140px, 13vw, 240px); left: calc(50% + min(656px, 50% - var(--gutter)) - var(--pw) / 2 - 12px) !important; top: var(--row-y, 50%) !important; width: var(--pw); aspect-ratio: 16 / 10; transition: opacity .25s, transform .45s var(--ease), top .45s var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .sv .svc-list li:hover em { opacity: 0; }
  .sv .svc-list em { transition: color .3s, opacity .2s; }
}

/* Pixel photos: a canvas sits over the project photo */
.scard:hover .scard__img img { transform: none; }
.px-canvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; }

/* Sliced headline: three slices slide into line */
.slice-h { position: relative; }
.slice-h.is-cut > .slice-h__src { visibility: hidden; }
.slice-h__part { position: absolute; left: 0; top: 0; width: 100%; pointer-events: none; clip-path: inset(var(--a) -5% var(--b) -5%); transform: translateX(var(--from)); opacity: 0; transition: transform 1s cubic-bezier(.16,1,.3,1), opacity .35s; }
.slice-h.is-in .slice-h__part { transform: none; opacity: 1; }

/* Testimonials: the card you hover keeps the light */
.t-track .vid { transition: opacity .35s, filter .35s; }
.t-track:hover .vid:not(:hover) { opacity: .5; filter: grayscale(1); }

/* Photo trail in the contact card */
.contact__card { position: relative; overflow: hidden; isolation: isolate; }
.contact__card > * { position: relative; z-index: 1; }
.contact__card > .trail { position: absolute; left: 0; top: 0; z-index: 0; width: clamp(130px, 13vw, 190px); aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; pointer-events: none; box-shadow: 0 18px 40px -14px rgba(0,0,0,.55); will-change: transform, opacity; }

/* Footer word: letters rise, and lift under the cursor */
.foot__word { overflow: hidden; padding: .06em 0 .12em; }
.foot__word span { display: inline-block; transform: translateY(112%); transition: transform 1.1s cubic-bezier(.16,1,.3,1), color .25s; transition-delay: calc(var(--i) * 28ms), 0s; }
.foot__word.in span { transform: none; }
.foot__word.done span { transition: transform .4s cubic-bezier(.3,1.5,.5,1), color .25s; }
.foot__word.done span:hover { transform: translateY(-7%); color: var(--red); }

@media (max-width: 760px) {
  .foot__bar { flex-wrap: wrap; gap: 8px 20px; }
  .sv .svc-list a { gap: 12px; }
  .sv .svc-list a > span:first-child { font-size: 12px; }
  .rollnums__list { grid-template-columns: 1fr 1fr; }
  .is-live .rollnums__list li { grid-template-columns: 1fr; grid-template-rows: 1fr auto 1fr; justify-items: center; row-gap: 20px; }
  .is-live .rollnums__list h3 { grid-column: 1; grid-row: 1; align-self: end; text-align: center; font-size: 26px; }
  .is-live .rollnums__list p { grid-column: 1; grid-row: 3; align-self: start; text-align: center; }
  .is-live .rollnums__list li::before { content: ""; grid-row: 2; height: clamp(112px, 15vw, 210px); }
}
@media (prefers-reduced-motion: reduce) {
  .foot__word span { transform: none; transition: none; }
  .sv .svc-list li::before { transition: none; }
}

/* comfortable tap targets on phones */
@media (max-width: 760px) {
  .topbar__burger { width: 44px; height: 44px; }
  .topbar__burger span { left: 14px; right: 14px; }
  .topbar__burger span:first-child { top: 18px; }
  .topbar__burger span:last-child { top: 24px; }
  .topbar__logo { display: inline-flex; align-items: center; min-height: 44px; }
  .dash-link { min-height: 44px; padding-top: 12px; }
  .side-card a[href^="mailto"] { display: inline-block; padding: 12px 0; }
}

/* logo: the red corner of the 8 lifts off once when the page loads */
.logo, .topbar__logo { display: inline-flex; align-items: center; gap: .5em; }
.lm { flex: none; width: auto; height: 1.75em; overflow: visible; }
.lm__bit { animation: lm-rise .8s cubic-bezier(.3,1.5,.5,1) .9s both; }
@keyframes lm-rise { to { transform: translate(20px, -20px); } }
@media (prefers-reduced-motion: reduce) { .lm__bit { animation: none; transform: translate(20px, -20px); } }

/* smooth wheel scrolling */
html.lenis, html.lenis body { height: auto; }
.lenis-smooth { scroll-behavior: auto !important; }
.lenis-stopped { overflow: clip; }
/* the 3D blobs fade in once they have loaded */
.hero__3d { opacity: 0; transition: opacity .9s; }
.hero__3d.on { opacity: 1; }
