/* Services. Loaded after site.css and page.css.
   --k: one pixel of the vehicles' pictures. The yellow box is 88 of them. On a wide window a lane is a quarter of it. */

/* ---------- 1. the road ---------- */
.relay { --k: min(.0655vw, .1428svh); --box: calc(88 * var(--k)); position: relative; background: var(--paper); color: var(--ink); }
.road { position: relative; background: var(--sheet) -1px 0 / 25% 22rem; }
.relay__cars { display: none; }
.live .relay__cars { display: block; position: sticky; top: 0; z-index: 3; height: 100vh; margin-bottom: -100vh; overflow: clip; pointer-events: none; }
.relay:not(.is-on) .relay__cars { visibility: hidden; }
.relay__cars > * { position: absolute; left: 0; top: 0; max-width: none; height: auto; will-change: transform; }
.is-lorry { width: calc(575 * var(--k)); }
.is-van { width: calc(397 * var(--k)); }
.is-motorbike { width: calc(251 * var(--k)); }
.is-bicycle { width: calc(290 * var(--k)); }
.is-mates { width: calc(142 * var(--k)); }
.parcel { width: var(--box); height: var(--box); }
.parcel img { position: relative; width: 100%; height: 100%; }
.parcel i { position: absolute; inset: 3%; background: rgb(0 0 0 / .8); filter: blur(calc(6 * var(--k))); will-change: transform; }

/* the motorbike pulls up beside the box when the page opens */
.live .is-motorbike { translate: 0 -120vh; }
.live .is-in .is-motorbike { translate: none; transition: translate 1.5s cubic-bezier(.16, .84, .3, 1); }
.live .start__h, .live .start__lead { animation: sv-up 1s var(--out) backwards; }
.live .start__lead { animation-delay: .25s; }
@keyframes sv-up { from { opacity: 0; translate: 0 1.4rem; } }

/* the sheet's own lines are the lanes: a vehicle keeps to the middle of one */
.start { position: relative; height: 100svh; min-height: 34rem; }
.start__h { position: absolute; left: var(--gut); top: calc(32svh - .5em); font-size: min(7.7vw, 17svh); line-height: 1; }
.start__h span span { display: inline; }
.start__h .spot { position: relative; display: inline-block; width: var(--box); height: var(--box); margin-left: .2em; vertical-align: middle; }
.start__lead { position: absolute; left: var(--gut); bottom: 2.9rem; max-width: 25em; }

.leg { position: relative; min-height: max(70svh, 27rem); display: flex; flex-direction: column; justify-content: center; padding: 3rem var(--gut); }
.leg__words { position: relative; z-index: 1; max-width: 43vw; }
.leg h2 { font-size: min(6.4vw, 13.6svh); font-weight: 650; line-height: .95; letter-spacing: -.045em; }
.leg p { margin-top: 1.1em; font-size: clamp(1.0625rem, 1.5vw, 1.8rem); font-weight: 500; line-height: 1.32; letter-spacing: -.012em; text-wrap: balance; }
.leg ul { margin-top: 1.5rem; font-size: clamp(1.35rem, 2.2vw, 2.5rem); font-weight: 600; line-height: 1.36; letter-spacing: -.03em; }
.leg a { background: linear-gradient(currentColor, currentColor) 0 96% / 100% 2px no-repeat; transition: background-size .5s var(--out); }
.leg a:hover { background-size: 0 2px; background-position: 100% 96%; }
.leg--ware .leg__words, .leg--last .leg__words { z-index: 4; max-width: 44.8vw; margin-left: 52vw; }     /* out of the shadows of the vehicles */
.leg--last { min-height: max(100svh, 38rem); }

/* the warehouse as it stands on a plan: its walls, and the doors the vehicles use */
.leg--ware { --floor: #ecebe6; --wall: 12px; --at: 24svh; min-height: max(78svh, 34rem); justify-content: flex-start; padding: 27svh var(--gut) 4svh; background: var(--sheet) -1px 0 / 25% 22rem, linear-gradient(90deg, var(--floor) calc(64 * var(--k)), transparent 0 calc(355 * var(--k)), var(--floor) 0), var(--floor) url("../assets/services/warehouse.webp") calc(-58 * var(--k)) calc(var(--at) - 689 * var(--k)) / calc(1600 * var(--k)) auto no-repeat; }
.leg--ware::before, .leg--ware::after { content: ""; position: absolute; left: 0; right: 0; height: var(--wall); z-index: 1; background: linear-gradient(90deg, var(--ink) 27%, transparent 0 73%, var(--ink) 0); }
.leg--ware::before { top: 0; }
.leg--ware::after { bottom: 0; background: linear-gradient(90deg, var(--ink) 27%, transparent 0 48%, var(--ink) 0); }

.spot { position: absolute; width: 0; height: 0; }
.spot--pallet { left: calc(219 * var(--k)); top: var(--at, 24svh); }
.spot--ride { left: 12.5%; top: 47svh; }
.spot--halt { left: 12.5%; bottom: calc(205 * var(--k)); }

/* ---------- 2. what would you hand over ---------- */
.ask { position: relative; min-height: 92svh; display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem; padding: 5svh 0 5.6svh; color: var(--ink); background: var(--paper) var(--sheet) -1px 0 / 25% 22rem; border-top: 12px solid var(--ink); }
.ask__head { position: relative; display: flex; align-items: center; min-height: calc(1.6 * var(--box)); padding: 1rem var(--gut) 0 25vw; }
.ask .title { font-size: min(5vw, 10.6svh); letter-spacing: -.042em; }
.spot--door { left: 12.5%; top: calc(50% + .5rem); }

.bed { position: relative; width: 94.5vw; margin-left: 2.4vw; }
.bed__lorry { width: 100%; height: auto; }
.bed__bays { position: absolute; inset: 0; margin: 0; padding: 0; border: 0; min-width: 0; }
.bay { position: absolute; left: calc(9.58% + var(--n) * 13.54% - 6.47%); top: 2.2%; width: 12.93%; height: 74.8%; cursor: pointer; }
.bay:nth-of-type(1) { --n: 0; } .bay:nth-of-type(2) { --n: 1; } .bay:nth-of-type(3) { --n: 2; } .bay:nth-of-type(4) { --n: 3; } .bay:nth-of-type(5) { --n: 4; }
.bay span { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: .42em; font-size: clamp(1rem, 1.42vw, 1.75rem); font-weight: 600; letter-spacing: -.025em; line-height: 1.1; white-space: nowrap; }
.bay input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.bay span::before { content: ""; flex: none; width: .92em; height: .92em; border: 2px solid var(--ink); background: linear-gradient(var(--ink), var(--ink)) 50% / 0 0 no-repeat; transition: background-size .25s var(--out); }
.bay input:checked + span::before { background-size: .48em .48em; }
.bay input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 5px; }
.bay img { position: absolute; left: 50%; bottom: 8.4%; width: 84%; height: auto; margin-left: -42%; opacity: 0; filter: drop-shadow(.4rem .6rem .5rem rgb(0 0 0 / .5)); transition: opacity .16s, scale .5s cubic-bezier(.3, 1.35, .5, 1); pointer-events: none; }
.live .bay img { scale: 1.5; }
.bay input:checked ~ img { opacity: 1; scale: 1; }
@media (hover: hover) { .bay:hover input:not(:checked) ~ img { opacity: .3; scale: 1.06; } }

.ask__foot { display: flex; align-items: center; justify-content: space-between; gap: 1.4rem 4rem; padding: 0 var(--gut); }
.ask__foot p:not(.sr) { max-width: 37em; font-size: clamp(1.0625rem, 1.3vw, 1.5rem); font-weight: 500; line-height: 1.35; letter-spacing: -.012em; }
.ask__foot b { font-weight: 700; }
.ask__foot .btn { flex: none; font-size: 1.0625rem; }

/* ---------- 3. the four ways, and the fleet ---------- */
.ways { background: var(--paper) var(--sheet) -1px 0 / 25% 22rem; color: var(--ink); padding: clamp(3.4rem, 4.8vw, 6.4rem) var(--gut) clamp(3.4rem, 4.4vw, 6rem); }
.ways .title { font-size: clamp(2rem, 3.95vw, 4.7rem); }
.ways h2 span { white-space: nowrap; }
.ways__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .6rem 3rem; }
.ways__head p { color: #45453f; }
.ways__head i { display: inline-block; width: .72em; height: .72em; margin-right: .3em; background: var(--yellow); }
.ways__list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.4rem 2.4vw; margin-top: clamp(1.6rem, 2.8vw, 3.2rem); }
.ways__list b { display: block; margin-top: 1.3rem; font-size: clamp(1.2rem, 1.62vw, 1.9rem); font-weight: 600; letter-spacing: -.025em; line-height: 1.15; }
.ways__list span { display: block; margin-top: .5rem; max-width: 17em; color: #45453f; text-wrap: balance; }
.row { --s: min(2.9vw, 3.2rem); display: flex; align-items: flex-end; gap: 4px; height: calc(var(--s) + 10px); }
.row > i { width: var(--s); height: var(--s); border: 2px solid var(--ink); }
.row > .on { border: 0; background: var(--yellow); }
.row--deck { position: relative; padding-bottom: 10px; }
.row--deck::after { content: ""; position: absolute; left: 0; bottom: 0; height: 6px; width: calc(4 * var(--s) + 12px); background: var(--yellow); }
.ways__fleet .title { font-size: clamp(2rem, 3.6vw, 4.3rem); }
.ways__fleet { display: grid; grid-template-columns: 7fr 5fr; gap: 1.2rem 6vw; align-items: end; margin-top: clamp(2.4rem, 3.4vw, 4.6rem); padding-top: clamp(2rem, 2.6vw, 3.4rem); border-top: 2px solid var(--ink); }
.ways__fleet p { font-size: clamp(1.0625rem, 1.35vw, 1.55rem); color: #30302c; }

/* ---------- every service ---------- */
.every { padding: clamp(4.5rem, 7.4vw, 8rem) 0 0; background: var(--paper); }
.every .title { max-width: 12em; padding: 0 var(--gut); }
.every__list { margin-top: clamp(2rem, 3.6vw, 4rem); border-bottom: 1px solid rgb(13 13 13 / .16); }
.every a { position: relative; isolation: isolate; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: .3rem 2rem; padding: clamp(.8rem, 1.25vw, 1.5rem) var(--gut); border-top: 1px solid rgb(13 13 13 / .16); }
.every a::before { content: ""; position: absolute; z-index: -1; inset: -1px 0; background: var(--yellow); transform: scaleX(0); transform-origin: 0 0; transition: transform .6s var(--out); }
.every b { font-size: clamp(1.7rem, 3.1vw, 3.8rem); font-weight: 600; line-height: 1.04; letter-spacing: -.042em; }
.every span { max-width: 27em; padding-right: 2rem; font-size: clamp(1.0625rem, 1.2vw, 1.45rem); line-height: 1.36; color: #30302c; text-wrap: pretty; }
.every a::after { content: "\203a"; position: absolute; right: var(--gut); top: 50%; margin-top: -.6em; font-size: 2rem; line-height: 1; opacity: .4; }
.every a:is(:hover, :focus-visible)::before { transform: none; }
@media (max-width: 800px) { .every a { grid-template-columns: 1fr; padding-block: 1.1rem; } }

/* ---------- standing still: each vehicle is parked beside its stage, with the box in it ---------- */
.still { display: none; }
html:not(.live) .still { display: block; position: absolute; z-index: 1; width: 0; height: 0; }
html:not(.live) .still img { position: absolute; max-width: none; height: auto; }
html:not(.live) .still img + img { width: var(--box); left: calc(var(--box) / -2); top: calc(var(--box) / -2); }
html:not(.live) .leg--last { min-height: 84svh; }
.still--motorbike { left: 87.5%; top: 24%; }
.still--motorbike .is-motorbike { left: calc(-91 * var(--k)); top: calc(-95 * var(--k)); }
.still--lorry { left: 62.5%; top: 34%; }
.still--lorry .is-lorry { left: calc(-183 * var(--k)); top: calc(-910 * var(--k)); }
.still--pallet { left: calc(219 * var(--k)); top: var(--at, 24svh); }
.still--pallet .is-mates { left: calc(-71 * var(--k)); top: calc(-76 * var(--k)); }
html:not(.live) .still--pallet img + img { left: calc(-70 * var(--k)); top: calc(-75 * var(--k)); }
.still--bicycle { left: 25%; top: 52%; }
.still--bicycle .is-bicycle { left: calc(-129.5 * var(--k)); top: calc(-314.5 * var(--k)); }
html:not(.live) .start__h .spot { background: url("../assets/services/box.webp") 0 0 / 100%; rotate: -8deg; }
html:not(.live) .spot--door { width: var(--box); height: var(--box); margin: calc(var(--box) / -2) 0 0 calc(var(--box) / -2); background: url("../assets/services/box.webp") 0 0 / 100%; rotate: 8deg; }

/* ---------- upright screens: two lanes. The words are on boards across the road, and the vehicles drive under them ---------- */
@media (max-width: 900px), (max-aspect-ratio: 1/1) {
  .relay { --k: min(.1315vw, .0772svh); }
  .road, .ask, .ways { background-size: 50% 22rem; }
  .start__h { top: auto; bottom: 24svh; font-size: min(8.5vw, 8svh); }
  .start__h .spot { margin-left: .16em; }
  .start__lead { max-width: 56vw; text-wrap: balance; bottom: 5.4svh; font-size: clamp(1.0625rem, 2.5vw, 1.6rem); }

  .leg { min-height: 94svh; justify-content: flex-end; padding: 3rem var(--gut) 7svh; }
  .leg .leg__words, .leg--ware .leg__words, .leg--last .leg__words { z-index: 4; max-width: none; margin: 0 calc(-1 * var(--gut)); padding: 1.6rem var(--gut) 1.7rem; background: var(--white); border-block: 6px solid var(--ink); box-shadow: 0 .6rem 1.4rem rgb(0 0 0 / .22); }
  .leg h2 { font-size: min(12.4vw, 8.6svh); }
  .leg p { margin-top: .8em; font-size: clamp(1.0625rem, 2.5vw, 1.6rem); }
  .leg ul { margin-top: 1rem; font-size: clamp(1.3rem, 3.6vw, 2.2rem); }
  .leg--ware { min-height: 104svh; background: var(--sheet) -1px 0 / 50% 22rem, linear-gradient(180deg, rgb(236 235 230 / 0) 41svh, var(--floor) 52svh), linear-gradient(90deg, var(--floor) calc(50vw + 92 * var(--k)), transparent 0 calc(50vw + 384 * var(--k)), var(--floor) 0), var(--floor) url("../assets/services/warehouse.webp") calc(50vw - 30 * var(--k)) calc(var(--at) - 689 * var(--k)) / calc(1600 * var(--k)) auto no-repeat; }
  .leg--ware::before, .leg--ware::after { background: linear-gradient(90deg, var(--ink) 4%, transparent 0 50%, var(--ink) 0); }
  .spot--pallet, .still--pallet { left: calc(50vw + 247 * var(--k)); }
  .leg--last { min-height: 128svh; justify-content: flex-start; padding-top: 74svh; }
  .spot--ride, .spot--halt { left: 75%; }

  .ask { min-height: 0; gap: 2rem; padding: 4rem 0 3.4rem; }
  .ask__head { display: block; padding: 0 var(--gut); min-height: 0; }
  .ask .title { max-width: 6.4em; font-size: min(10.6vw, 7svh); }
  .spot--door { left: auto; right: 14vw; top: 50%; }
  .bed { --bw: min(33vw, 17svh); --len: calc(var(--bw) * 3.94); width: var(--bw); height: var(--len); margin-left: calc(var(--gut) - .06 * var(--bw)); }
  .bed__lorry { position: absolute; left: 100%; top: 0; width: var(--len); max-width: none; transform-origin: 0 0; transform: rotate(90deg); }
  .bay { left: 0; top: calc(9.58% + var(--n) * 13.54% - 6.47%); width: calc(100vw - 2 * var(--gut)); height: 12.93%; }
  .bay span { left: calc(var(--bw) + 1rem); top: 0; height: 100%; font-size: clamp(1.25rem, 3.4vw, 2rem); }
  .bay img { left: calc(.5194 * var(--bw)); top: 50%; bottom: auto; width: calc(.84 * .1293 * var(--len)); margin: calc(-.42 * .1293 * var(--len)) 0 0 calc(-.42 * .1293 * var(--len)); }
  .ask__foot { flex-direction: column; align-items: flex-start; }

  .ways__list { grid-template-columns: 1fr 1fr; }
  .ways__fleet { grid-template-columns: 1fr; }
  .row { --s: min(8.4vw, 3rem); }

  html:not(.live) .leg { min-height: 0; padding-top: 58svh; }
  html:not(.live) .still--lorry .is-lorry { -webkit-mask: linear-gradient(180deg, transparent calc(910 * var(--k) - 21svh), #000 calc(910 * var(--k) - 9svh)); mask: linear-gradient(180deg, transparent calc(910 * var(--k) - 21svh), #000 calc(910 * var(--k) - 9svh)); }
  html:not(.live) .leg--ware { min-height: 100svh; }
  .still--motorbike { left: 62%; top: 16svh; }
  .still--lorry { left: 60%; top: 22svh; }
  .still--bicycle { left: 62%; top: 28svh; }
}
@media (max-width: 560px) { .ways__list { grid-template-columns: 1fr; } }

/* ---------- a phone held sideways ---------- */
@media (max-height: 480px) and (min-aspect-ratio: 5/4) {
  .start { min-height: 0; }
  .start__h { bottom: 26svh; font-size: 11svh; }
}
