
/* ============ THE SIX VERTICALS, FLOATING (verticals.py) =============== */

/* ---- the block: no panel, no edge, nothing to clip --------------------
   Three of these have to out-rank a shared rule that lists .svc.svc among
   twenty other components, so they carry the class three times rather than
   an !important. The background is the exception: the rule that paints it
   is itself !important, so this one has to be too. */
html body .svc.svc.svc{background:none !important;box-shadow:none;
  border-radius:0;overflow:visible;position:relative;
  /* the card is what the heading has to fit inside, so the card is what the
     heading measures itself against */
  container-type:inline-size;}
html body .svc.svc.svc:hover,html body .svc.svc.svc:focus-within{
  box-shadow:none;}

/* ---- the photograph as an object on the page, not a picture in a frame */
html body .svc{--imh:384px;--lift:4px;}
html body .svc .im{height:var(--imh);margin:0;border-radius:22px;
  box-shadow:0 34px 66px rgba(4,8,30,.55);}
/* the reveal's slow zoom is restated here, unchanged, because this selector
   has to outrank .svc.rv .im to add the hover travel to the same shorthand */
html body .svc.svc .im{
  transition:translate .5s cubic-bezier(.22,1,.36,1),
             transform 1.25s cubic-bezier(.22,1,.36,1) .12s;}

/* THE CHEVRON RUN SITS ON THE PHOTOGRAPH, NOT ASTRIDE IT. Matt, 8 October:
   "the verticals hover needs the chevrons lifting to bottom align with the
   image - at the moment it straddles the bottom of the image."

   It did, by 6px, and the 6 is my arithmetic rather than a judgement. I set
   the run's TOP to the image height less 18, having read 18 off the rule
   that declares --h on .chev. A later rule sets it to 24, which is what the
   browser actually draws, so the run finished 6px past the photograph's
   bottom edge and the slant made every one of those pixels visible.

   So it no longer counts. `bottom` is measured from the card's bottom and
   the card is the containing block, so 100 per cent less the image height puts the
   run's bottom edge exactly on the photograph's, whatever the chevrons
   turn out to be and whatever the card's own height is.

   AND IT HAS TO TRAVEL WITH THE PICTURE. Matt, 8 October: "chevrons still
   about 3-5px too low when they appear." Four, measured. The line above
   aligns them at rest, which is the one state nobody ever sees them in:
   they are invisible until you hover, and on hover the photograph lifts 4px
   inside the card while the run, anchored to the card, stayed where it was.
   So the only moment the chevrons are on screen was the one moment they
   were out by the height of the lift.

   The lift is now a single variable used by the card, the picture and the
   run, so the three cannot drift apart again. */
html body .svc .chev-base{top:auto;bottom:calc(100% - var(--imh));
  transition:opacity .32s ease,transform .46s cubic-bezier(.22,1,.36,1),
             translate .5s cubic-bezier(.22,1,.36,1);}
html body .svc:hover .chev-base,
html body .svc:focus-within .chev-base{translate:0 calc(var(--lift) * -1);}

/* ---- the hover ------------------------------------------------------
   The whole block travels and the photograph travels again inside it, so
   the picture gets its own parallax without coming loose from the words.
   No ring and no glow: Matt, 6 October, "Remove the glow and ring on the
   image on hover." */
html body .svc{transition:translate .46s cubic-bezier(.22,1,.36,1);}
html body .svc:hover,
html body .svc:focus-within{translate:0 calc(var(--lift) * -1);}
html body .svc:hover .im,
html body .svc:focus-within .im{translate:0 calc(var(--lift) * -1);}
/* the card's own lift is a transform, and it would fight the one above */
html body .svc.rv.on:hover,html body .svc.rv.on:focus-within{transform:none;}

/* ---- the copy, on the page rather than in a box, using the whole column
   AND IN FRONT OF THE PHOTOGRAPH'S SHADOW. Matt: "the title is shaded -
   maybe we bring it in front of the shadow?" The image casts 66px and the
   title starts 34px below it, so without a stacking position of its own the
   first line of every heading is painted on by the shadow and the second
   one is not.

   ROOM TO BREATHE UNDER THE PICTURE. Matt, 8 October: "add more gap under
   the images to make the blocks more breathable." 34 to 52. The number it
   has to beat is the 30px between the blurb and the hairline over the
   figures, because that is the smallest gap in the block and the one that
   sets the scale: at 34 the picture was only four pixels further from its
   title than the title's own paragraph is from the rule below it, so the
   photograph read as part of the text rather than as the thing the text is
   about. At 52 it is clearly the largest gap inside the card, which is
   what makes the three parts read as three. */
html body .svc .bd{padding:52px 0 0;position:relative;z-index:1;}
html body .svc .hl{--h3:clamp(26px,8.3cqw,58px);align-items:flex-start;gap:20px;
  margin-bottom:0;}

/* THE ARROW STANDS WHERE THE ICON STOOD. Matt, 7 October: "Can we remove
   the icons and put the arrow in it's place."

   The icon was a picture of the thing and the title says the thing, so it
   was the second time the block named itself. The arrow says what the block
   DOES, which is the one thing nothing else on it was saying: the whole
   block is a link and at rest it looked like an article.

   It keeps the icon's box exactly, .707 of the title, because that width is
   what the heading was measured against and changing it would put WIRING
   HARNESSES back on three lines. Top aligned to the cap line on the same
   .017 the icon used.

   AND IT WAITS FOR THE HOVER. Matt, 8 October: "Hid the arrow until hover."
   It was visible at rest on the reasoning that an empty corner reads as a
   mistake, and on six cards at once that turned out to be six aqua marks
   competing with six titles. Hidden, the arrow becomes the answer to the
   hover rather than another thing on the page.

   IT STILL TAKES UP ITS SPACE. opacity, not display: the box keeps its
   width, so the title wraps to exactly the same measure whether you are
   hovering or not and nothing reflows under the cursor. At rest it is also
   nudged down and left by the same distance the hover sends it up and
   right, so it arrives travelling rather than switching on. */
html body .svc .ico{display:none;}
html body .svc .hl > .arw{flex:0 0 auto;display:block;
  width:calc(var(--h3) * .707);height:calc(var(--h3) * .707);
  margin:calc(var(--h3) * .017) 0 0;vertical-align:baseline;
  color:var(--aqua,#00eecc);opacity:0;
  transform:translate(calc(var(--h3) * -.07),calc(var(--h3) * .07));
  transition:transform .42s cubic-bezier(.22,1,.36,1),opacity .34s ease;}
html body .svc .hl > .arw svg{display:block;width:100%;height:100%;
  stroke-width:2.1;}
html body .svc:hover .hl > .arw,html body .svc:focus-within .hl > .arw{
  opacity:1;transform:translate(0,0);}

html body .svc h3{font-size:var(--h3);
  letter-spacing:calc(var(--h3) * -.0267);line-height:.96;}
/* the blurb stops being a flex child that grows: in the card it was told to
   fill whatever height the panel had left, and there is no panel now */
html body .svc p{font-size:16.5px;line-height:1.62;margin-top:20px;
  max-width:52ch;flex:0 1 auto;color:rgba(255,255,255,.66);}

/* the figures as a row under a hairline. The line is a one pixel background,
   not a border: no CSS borders anywhere on this project. It also needs its
   corners squared, because the shared rounded corner list names .stats.stats
   and a 20px radius clips a one pixel background at both ends. */
html body .svc .stats.stats{margin-top:30px;padding:24px 0 0;gap:20px;
  border-radius:0;background-color:transparent;
  background-image:linear-gradient(rgba(255,255,255,.13),
                                   rgba(255,255,255,.13));
  background-size:100% 1px;background-position:left top;
  background-repeat:no-repeat;}
html body .svc .st b{font-size:30px;letter-spacing:-1.1px;}
html body .svc .st i{margin-top:9px;font-size:10.5px;letter-spacing:1.1px;}


/* ---- THE SIX SLIDE UP, ONE AFTER ANOTHER --------------------------------
   Matt, 8 October: "I think we need them to feel like they are sliding up
   into view more, also stepped per block not all at once."

   TWO SEPARATE THINGS, AND ONLY ONE OF THEM IS THE TRAVEL.

   The slide was 56px on a block that is now 724px tall, so it was a nudge
   at the end of a fade rather than something arriving. 120px, and the
   transform runs 1.05s against the fade's 0.8, so the block is still
   settling after it has finished appearing. That is what reads as sliding
   rather than switching on.

   THE STEP IS PER COLUMN, NOT PER CARD, and it is worth saying why, because
   a one-two-three-four-five-six sequence is the obvious answer and it is
   the wrong one. Each block is 724px tall and the right column is dropped
   180px, so on any screen smaller than about 1600px tall no more than two
   of the six are ever on screen together. A six step sequence would spend
   its later steps on blocks nobody is looking at, and the last pair would
   arrive half a second late for no reason the reader can see.

   So the step is between the two cards of a row: the left one goes, and
   150ms later the right one follows. The pair is what a reader actually
   sees arrive together, so the pair is what needs separating.

   --step CARRIES THROUGH THE WHOLE BLOCK. The card's own numeral, heading,
   blurb and three figures already come in on their own delays, and those
   delays are measured from the moment the class lands rather than from the
   moment the card starts moving. Without adding the step to each of them
   the right hand card's contents would begin assembling while the card was
   still waiting to move. So every one is restated with the step added, and
   the numeral keeps its stroke colour transition or the hover brighten
   would snap. */
html body .svc{--step:0ms;}
html body .svc-grid > .svc:nth-child(2n){--step:150ms;}
html body .svc.rv{transform:translateY(120px) scale(.985);
  transition:opacity .8s cubic-bezier(.22,1,.36,1) var(--step,0ms),
             transform 1.05s cubic-bezier(.22,1,.36,1) var(--step,0ms);}
html body .svc.rv .im{
  transition:translate .5s cubic-bezier(.22,1,.36,1),
             transform 1.25s cubic-bezier(.22,1,.36,1)
                       calc(120ms + var(--step,0ms));}
html body .svc .hl,html body .svc p,html body .svc .stats,
html body .svc .go{
  transition:opacity .62s ease calc(var(--d,0ms) + var(--step,0ms)),
             transform .62s cubic-bezier(.22,1,.36,1)
                       calc(var(--d,0ms) + var(--step,0ms));}
html body .svc .st{
  transition:opacity .5s ease calc(var(--d,0ms) + var(--step,0ms)),
             transform .5s cubic-bezier(.22,1,.36,1)
                       calc(var(--d,0ms) + var(--step,0ms));}
html body .svc .bignum{
  transition:opacity .62s ease calc(var(--d,0ms) + var(--step,0ms)),
             transform .62s cubic-bezier(.22,1,.36,1)
                       calc(var(--d,0ms) + var(--step,0ms)),
             -webkit-text-stroke-color .3s ease;}
@media (prefers-reduced-motion:reduce){
  html body .svc{--step:0ms;}
}

/* ---- the air between the rows ----------------------------------------
   Matt, 7 October: "Can we try making the drop bigger between each row -
   they conflict at the minute."

   They did, and it is the shadow rather than the spacing. The card used to
   carry a 4px shadow and sit in a 26px gap, which was plenty. The floating
   photograph casts 0 34px 66px, so it reaches 100px below its own bottom
   edge, and the block below it starts 26px down: the top of every
   photograph in the second row was being painted on by the one above it.

   80px of row gap clears the shadow with 14px to spare. The column gap
   stays at 26, because nothing casts sideways.

   AND THE STAGGER GOES WITH IT. The even column dropped 64px, which was
   two and a half gaps when the gap was 26 and would be less than one now,
   so the offset that made the two columns read as a rhythm would have
   become a near miss. 120px kept it at one and a half, and Matt asked on 8
   October to "make the step down for the right column bigger again". 180,
   which is two and a quarter gaps: enough that the right column reads as a
   deliberate second beat rather than as a column that has slipped.

   AND MORE AGAIN NOW THEY ARE PARALLEL. Matt, 8 October: "more space between
   the tiers." 80 was measured against the hover shadow, which is the least
   it can be, not the most it should be. With the stagger off, three rows
   land at the same height across the page and the eye reads them as one
   block of six unless the gap between rows is clearly bigger than the gap
   between a row's figures and the picture above them, which is 30 plus 24.
   130 is more than twice that, and still a little under the 156 of air the
   section head leaves above the first picture, so the band opens wider than
   it breathes. */
html body .svc-grid{column-gap:26px;row-gap:130px;}
html body .svc-grid > .svc:nth-child(2n){margin-top:0;}

/* ---- the air under the section head ---------------------------------- */
html body #services .sec-top{margin-bottom:104px;}

@media (max-width:1080px){
  html body .svc{--imh:280px;}
  html body .svc-grid{row-gap:88px;}
  html body .svc .bd{padding-top:40px;}
  html body .svc-grid > .svc:nth-child(2n){margin-top:0;}
  html body #services .sec-top{margin-bottom:72px;}
}
@media (max-width:720px){
  html body .svc{--imh:230px;}
  html body .svc-grid{row-gap:66px;}
  html body .svc .bd{padding-top:34px;}
  html body #services .sec-top{margin-bottom:56px;}
}
@media (prefers-reduced-motion:reduce){
  html body .svc,html body .svc.svc .im{transition:none;}
}


/* ===== the map in front, and only its land fades (mapfade.py) ===== */

/* 1. THE MAP PAINTS IN FRONT OF THE TIER ABOVE.
   The sectors tier is z-index 2 with a solid ground and the map used to be
   z-index -1 inside a section with no z-index at all, so the tier covered
   the top 148px of the map. Both of those move, and nothing else does: the
   band's own words are z-index 2 inside #supply and stay above the map. */
html body #supply{position:relative;z-index:3;}
html body #supply .wm-par{z-index:0;}
html body #supply .wrap{position:relative;z-index:2;}

/* AND THE TIER ABOVE KEEPS ITS CONTENT ON TOP. Matt asked for the map in
   front of the tier's BACKGROUND, which is not the same as in front of its
   icons. On a 3552px window the map bleeds 304px up and the sector icons
   sit 117px inside that, so without this the faded land would be drawn
   across their labels. The tier's ground stays under the map; everything
   written on the tier stays over it. */
html body .wy.ind-tier > .wrap{position:relative;z-index:4;}

/* 2. AND ONLY THE LANDMASS FADES, ONLY ACROSS ITS OWN CUT.
   .wm-land is one path of twenty-nine. The routes, the dots, the UK
   marker and the labels are not in this selector and are never touched. */
html body svg.wm .wm-land{
  -webkit-mask-image:linear-gradient(180deg,transparent 0,rgba(0,0,0,.18) 7%,rgba(0,0,0,.62) 12%,#000 16.4%);
          mask-image:linear-gradient(180deg,transparent 0,rgba(0,0,0,.18) 7%,rgba(0,0,0,.62) 12%,#000 16.4%);
  -webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;
  -webkit-mask-size:100% 100%;mask-size:100% 100%;}


/* ===== THE VIDEO RAIL (videorail.py) ===================================
   The rail itself is services_page.py's, copied rather than reinterpreted,
   because Matt asked whether there was a precedent and there was. Only the
   things a video card needs that a link card does not are written here. */
section.vr{padding:clamp(84px,9vh,124px) 0 clamp(88px,10vh,132px);}

/* the rail component, as the services index sets it */
.vr .op-top{margin-bottom:48px;display:flex;align-items:flex-end;
  justify-content:space-between;gap:32px;}
.vr .rl-bar{display:flex;gap:14px;flex:0 0 auto;}
.vr .rl-btn{width:60px;height:60px;border-radius:50%;border:0;cursor:pointer;
  display:grid;place-items:center;background:rgba(255,255,255,.07);color:#fff;
  transition:background .25s,color .25s,opacity .25s;}
.vr .rl-btn svg{width:26px;height:26px;}
.vr .rl-next svg{transform:scaleX(-1);}
.vr .rl-btn:hover{background:var(--aqua,#00eac8);color:#0b0f2e;}
.vr .rl-btn[disabled]{opacity:.3;cursor:default;
  background:rgba(255,255,255,.07);color:#fff;}
/* the 23 September trackpad fix comes with it: a horizontal scroller with
   mandatory snapping eats part of a sideways gesture, so the rail keeps its
   scrolling to itself and snapping is left to touch */
.vr .rl{display:grid;grid-auto-flow:column;
  grid-auto-columns:calc((100% - 3 * 28px) / 4);gap:28px;overflow-x:auto;overflow-y:hidden;overflow-y:clip;
  scroll-behavior:smooth;overscroll-behavior-x:contain;scroll-snap-type:none;
  scrollbar-width:none;outline:none;}
@media (hover:none){.vr .rl{scroll-snap-type:x proximity;}}
.vr .rl::-webkit-scrollbar{display:none;}
.vr .rl-card{scroll-snap-align:start;display:flex;flex-direction:column;
  color:#fff;text-align:left;background:none;border:0;padding:0;
  cursor:pointer;font:inherit;}
/* NINE BY SIXTEEN. Matt, 24 September: "more portrait shaped, as close to
   widescreen tall but vertical as possible." Widescreen stood on its end is
   9:16, so that is the frame, and every poster is now cut to it rather than
   being letterboxed or cropped by the browser. */
.vr .rl-ph{position:relative;display:block;overflow:hidden;border-radius:26px;
  aspect-ratio:9/16;background:#12173d;}
.vr .rl-ph i{position:absolute;inset:0;background-size:cover;
  background-position:center;
  transition:transform 1.2s cubic-bezier(.22,1,.36,1);}
.vr .rl-card:hover .rl-ph i{transform:scale(1.07);}
.vr .rl-cat{margin-top:24px;font-size:14px;color:rgba(255,255,255,.55);
  letter-spacing:.2px;text-transform:uppercase;}
/* THE TITLE IS THE SITE'S STANDARD TEXT, NOT A HEADING. Matt, 19
   October, with a shot of the icon tier's label beside the rail: "Video
   titles in the standard text (like the Quality testing one attached)."

   It was 24px at 600 in solid white with -0.4px of tracking, which is
   heading weight on a line that is not a heading: a video's own title,
   written by whoever uploaded it, sitting under a thumbnail that
   already carries a play disc and a duration. Four of them in a row
   read as four headings and out-shouted the section head above them.

   .wy-i's label is what Matt pointed at and these are its numbers,
   measured off the page: 16px at 400 in 82 per cent white, normal
   tracking, 1.45 line height. Left aligned rather than centred, because
   the rail is a left aligned row and centring is a change he did not
   ask for. */
.vr .vp-ttl{display:block;margin-top:14px;font-size:16px;font-weight:400;
  letter-spacing:normal;color:rgba(255,255,255,.82);line-height:1.45;}

/* THE PLAY DISC. Matt, 24 September: "white, partially transparent, with
   that blue triangle arrow." It was the other way round, a solid aqua disc
   with a navy triangle, which put the brand colour on the photograph as a
   blob rather than using it as the mark.

   THEN THE TRIANGLE WENT DARK BLUE AND THE DISC GOT AN AURA: "can the
   triangle arrows in the play buttons be dark blue please. I wonder if we
   could add an aura around the circle to make it look more attractive to
   press too?"

   The triangle is #0b0f2e, which is the page's own ground rather than a new
   blue, so the mark is the site's darkest colour on the site's lightest
   surface and nothing new enters the palette.

   THE AURA IS ON BY DEFAULT, NOT ON HOVER. A hover effect does nothing on a
   phone, and these cards get looked at on a phone. So the glow sits behind
   the disc at all times and breathes slowly, which is what draws the eye to
   a thing worth pressing; hover brightens it rather than creating it. It is
   the aqua, and it is the same language as the Ask us bubble in the corner,
   which already glows, so this is the site's existing idea applied again
   rather than a new effect invented for one component. */
/* 76px rather than the prototype's 58. The card is half as wide again here,
   three across a 1332px measure instead of five in a 290px rail, and a disc
   sized for the old card reads as a dot on this one. */
.vr .vp-play{position:absolute;left:50%;top:50%;width:76px;height:76px;
  margin:-38px 0 0 -38px;border-radius:999px;
  background:rgba(255,255,255,.93);
  -webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);
  box-shadow:0 10px 30px -10px rgba(0,0,0,.45);
  display:flex;align-items:center;justify-content:center;z-index:2;
  transition:transform .35s cubic-bezier(.22,1,.36,1),background .25s;}
.vr .rl-card:hover .vp-play,
.vr .rl-card:focus-visible .vp-play{transform:scale(1.08);
  background:rgba(255,255,255,.96);}
.vr .vp-tri{width:29px;height:29px;fill:#0b0f2e;margin-left:4px;}

/* NO AURA. Matt, 24 September: "the glow on the video play buttons doesn't
   really work, let's remove that idea for now."

   It went through three versions and none of them was right. A filled
   radial sat under a disc that is not fully opaque and turned the whole
   button mint. A ring cleared the disc and read as a hard green smear over
   the pale photographs. Blurring it made it look emitted rather than drawn,
   which was better and still not good: on a card that is already a
   photograph with a white disc on it, a coloured bloom is one more thing
   competing for the same small area.

   The disc on its own is enough of a button. Leaving the note here because
   the idea was reasonable and someone will have it again. */

.vr .rl-card.live .vp-play,.vr .rl-card.live .rl-ph i{display:none;}
.vr .rl-card.live{cursor:default;}
.vr .rl-card.live .rl-ph{background:#000;}
.vr .rl-card video{position:absolute;inset:0;width:100%;height:100%;
  object-fit:cover;border:0;border-radius:26px;background:#000;}
/* AND cover HAS TO STOP AT THE EDGE OF THE CARD. Matt, 27 October:
   "They are phone portrait format - so if a user hits 'full screen
   view' icon - how do we contain that? Currently it fills the screen
   on my macbook losing top and bottom thirds."

   object-fit:cover is right for the card, where a 9:16 film has to
   fill a frame that is not 9:16 and cropping is the point. It is
   wrong the moment the element is the whole screen: the browser hands
   the video a 16:9 box, cover scales the film until it covers that,
   and two thirds of a portrait frame goes past the top and bottom
   edges. The film is not letterboxed, it is cropped, and the viewer
   has no way to get the rest back.

   contain is the fullscreen answer: same film, scaled to fit, black
   either side. The radius goes too, because a 26px corner on a
   fullscreen video leaves four lit notches on a black screen.

   TWO RULES AND NOT ONE SELECTOR LIST. Safari understands only
   :-webkit-full-screen and Chrome and Firefox only :fullscreen, and a
   selector list containing one the browser cannot parse is a rule
   that browser drops entirely. Separately, each lands where it can. */
.vr .rl-card video:fullscreen{object-fit:contain;border-radius:0;}
.vr .rl-card video:-webkit-full-screen{object-fit:contain;border-radius:0;}
.vr-note{margin:34px 0 0;font-size:14px;line-height:1.7;
  color:rgba(255,255,255,.5);max-width:58em;}
@media (max-width:900px){
  .vr .op-top{flex-direction:column;align-items:flex-start;gap:14px;}
  .vr .rl-bar{display:none;}
  .vr .rl{grid-auto-columns:82%;gap:18px;}
  .vr .rl-btn{width:48px;height:48px;}
}
@media (prefers-reduced-motion:reduce){
  .vr .rl{scroll-behavior:auto;}
  .vr .rl-card,.vr .vp-play,.vr .rl-btn,.vr .rl-ph i{transition:none;}
}
