/* UK Digital Partners: 3D design for inner pages (loaded only on pages with body.v2i). */
body.v2i {
  --wb: clamp(110px, 15vw, 250px)
}

/* Hero: reserve room for the 3D word now, so nothing moves when the 3D arrives */
.v2i main > section:first-of-type {
  position: relative;
  overflow: hidden;
  padding-bottom: calc(var(--wb) + 34px);
  background: radial-gradient(circle at 82% 18%, rgba(28, 45, 148, .55), transparent 55%), #060d2b
}

.v2i main > .inner-hero:first-of-type h1,
.v2i main > .inner-hero:first-of-type > p,
.v2i main > .inner-hero:first-of-type .section-kicker {
  max-width: min(1150px, 60vw)
}

.v2i-gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease
}

.v2i-gl.on {
  opacity: 1
}

.v2i main > section:first-of-type .inner-shape {
  display: none
}

.v2i-hero > :not(.v2i-gl):not(.v2i-word):not(.v2i-spot):not(.inner-shape) {
  position: relative;
  z-index: 1
}

.v2i-word {
  position: absolute !important;
  left: 3vw;
  right: 3vw;
  bottom: 14px;
  height: var(--wb);
  pointer-events: none
}

.v2i-spot {
  position: absolute !important;
  right: 5vw;
  top: 130px;
  width: min(34vw, 520px);
  height: min(46vh, 460px);
  pointer-events: none
}

/* Service pages: the 3D object takes the place of the hero photo (the photo stays in the page for Google) */
.v2i-ready .service-hero-image {
  background: transparent;
  overflow: visible
}

.v2i-ready .service-hero-image:after {
  opacity: 0
}

.v2i-ready .service-hero-image img {
  opacity: 0;
  transition: opacity .8s ease
}

/* 3D type */
.v2i .inner-hero h1,
.v2i .service-hero h1,
.v2i .service-banner h2 {
  text-shadow: 0 2px 0 #26337a, 0 4px 0 #1a2766, 0 10px 24px rgba(0, 0, 0, .45)
}

.v2i .cta h2 {
  text-shadow: 0 1px 0 #d9ddef, 0 2px 0 #bcc3df, 0 3px 0 #9ea7cd, 0 4px 0 #808bbb, 0 5px 0 #6370a8, 0 6px 0 #475593, 0 7px 0 #2e3d82, 0 18px 30px rgba(0, 0, 0, .5)
}

.v2i .cta h2 em {
  text-shadow: 0 1px 0 #f2245a, 0 2px 0 #df1650, 0 3px 0 #cc0a46, 0 4px 0 #b8003f, 0 5px 0 #a10037, 0 6px 0 #8a002f, 0 7px 0 #730027, 0 18px 30px rgba(0, 0, 0, .5)
}

/* Content flips into place in 3D as you scroll */
.v2i .reveal {
  transform: perspective(1100px) rotateX(14deg) translateY(36px);
  transform-origin: 50% 100%
}

.v2i .reveal.in {
  transform: none
}

.v2i .deliverable,
.v2i .process-cards > * {
  transition: transform .6s cubic-bezier(.2, .7, .2, 1), box-shadow .3s ease
}

.v2i .deliverable:hover,
.v2i .process-cards > *:hover {
  box-shadow: 0 30px 60px rgba(8, 16, 43, .22);
  position: relative;
  z-index: 2
}

.v2i .story-image {
  position: relative;
  transform: perspective(1200px) rotateY(-7deg) rotateX(3deg);
  box-shadow: 30px 40px 80px rgba(8, 16, 43, .25);
  transition: transform .8s cubic-bezier(.2, .7, .2, 1)
}

.v2i .story-image img {
  position: absolute;
  inset: 0;
  height: 100%
}

/* "How we work": 3D icons sit in the empty space above each step title */
.v2i-steps {
  position: relative;
  overflow: hidden
}

.v2i-steps-gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease
}

.v2i-steps-gl.on {
  opacity: 1
}

.v2i .service-banner img {
  will-change: transform
}

.v2i-progress {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  z-index: 100;
  background: linear-gradient(90deg, #d0003d, #ff416f);
  transform-origin: 0 50%;
  transform: scaleX(0)
}

/* 3D logo in the header */
.site-header .brand.brand-3d {
  --lw: 150px;
  padding: 0;
  background: none;
  box-shadow: none;
  border: 0;
  overflow: visible;
  perspective: 700px
}

.site-header .brand.brand-3d:after {
  display: none
}

.site-header .brand.brand-3d img {
  animation: none;
  filter: none
}

.b3d {
  position: relative;
  display: block;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .5s cubic-bezier(.2, .7, .2, 1)
}

.b3d-face {
  position: relative;
  display: block;
  padding: 8px 14px 8px 11px;
  border-radius: 14px;
  background: linear-gradient(145deg, #fff 0%, #eef1f9 100%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18)
}

.site-header .brand.brand-3d .b3d-face img {
  display: block;
  width: var(--lw) !important;
  height: auto;
  visibility: hidden
}

.b3d-slab {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: var(--c);
  transform: translateZ(calc(var(--d) * -1px))
}

.b3d-pop {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  pointer-events: none
}

.site-header .brand.brand-3d .b3d-pop img {
  position: absolute;
  left: 11px;
  top: 8px;
  width: var(--lw) !important;
  height: auto;
  transform: translateZ(calc(var(--z) * 1px));
  filter: brightness(var(--b, 1))
}

.b3d-in {
  display: block;
  animation: b3dIn 1.3s cubic-bezier(.2, .8, .2, 1) .9s both;
  transform-style: preserve-3d
}

@keyframes b3dIn {
  from {
    transform: rotateY(-120deg) scale(.8);
    opacity: 0
  }
}

@media (max-width: 900px) {
  .v2i main > .inner-hero:first-of-type {
    padding-top: calc(30vh + 140px)
  }

  .v2i main > .inner-hero:first-of-type h1,
  .v2i main > .inner-hero:first-of-type > p,
  .v2i main > .inner-hero:first-of-type .section-kicker {
    max-width: none
  }

  .v2i-spot {
    left: 8vw;
    right: 8vw;
    width: auto;
    top: 124px;
    height: calc(30vh - 4px)
  }
}

@media (max-width: 700px) {
  .b3d-face {
    padding: 6px 10px
  }

  .site-header .brand.brand-3d .b3d-pop img {
    left: 10px;
    top: 6px
  }
}

@media (prefers-reduced-motion: reduce) {
  .v2i .reveal,
  .v2i .story-image {
    transform: none
  }

  .b3d-in {
    animation: none
  }
}
