/* Round 7, builder "zz": the art direction and finish pass over the whole homepage. Loads last.
   The journey section (.v-journey, #journey) and the hero are not touched here. */

.v2{
  /* one vertical rhythm for every section: generous, but tied to the window height so a 650px high Safari window
     never shows a third of a screen of nothing between two sections */
  --zz-sec:clamp(64px,min(7.4vw,12.5vh),124px);
  /* how far a ground change melts from white into cream */
  --zz-blend:clamp(110px,14vw,220px);
  --zz-foot-r:clamp(28px,4.2vw,60px);
}

/* ================================================================ rhythm */
.v2 main>.v-sec:not(.v-journey){padding-top:var(--zz-sec);padding-bottom:var(--zz-sec)}
.v2 main>.v-close{padding-top:calc(var(--zz-sec) * 1.2)}

/* ================================================================ grounds: soft changes instead of hard lines */
.v2 main>.v-sec.v-cream{background:linear-gradient(180deg,var(--v-white) 0,var(--v-cream) var(--zz-blend),var(--v-cream) calc(100% - var(--zz-blend)),var(--v-white) 100%)}
/* How It Works runs straight on into the game (both cream): melt in at the top only */
.v2 main>#how.v-sec{background:linear-gradient(180deg,var(--v-white) 0,var(--v-cream) var(--zz-blend))}
/* the game: no hairlines, and it melts out to the page ground the photo band opens on */
.v2 main>#try.v-sec{border-top:0;border-bottom:0;background:linear-gradient(180deg,var(--v-cream) 0,var(--v-cream) calc(100% - var(--zz-blend)),var(--v-paper) 100%)}
/* from the cream ticker into the white introduction */
.v2 main>.v-intro.v-sec{background:linear-gradient(180deg,var(--v-cream) 0,var(--v-white) var(--zz-blend))}
/* the closing statement grows out of the white form section */
.v2 main>.v-close{border-top:0;background:linear-gradient(180deg,var(--v-white) 0,var(--v-cream) var(--zz-blend))}
/* the footer is a rounded panel that rises over the closing photograph, rather than a ruled line under it */
.v2 .v-foot{position:relative;z-index:2;border-top:0;margin-top:calc(var(--zz-foot-r) * -1);border-radius:var(--zz-foot-r) var(--zz-foot-r) 0 0;
  box-shadow:0 -24px 60px -40px rgba(22,40,8,.45)}

/* ================================================================ scale: three display moments */
.v2 .v-h2.zz-mega{font-size:clamp(44px,6.6vw,104px);line-height:1;letter-spacing:-.012em}
.v2 .v-h2.zz-mega .ln{padding:.12em .06em .2em;margin:-.12em -.06em -.2em}
.v2 #why .v-head-row,.v2 #areas .v-head-row{max-width:none}
.v2 #why .v-head-row .v-lede,.v2 #areas .v-head-row .v-lede{max-width:600px}
.v2 #how .v-head-c .v-h2.zz-mega{margin-top:22px}
/* phones: still the largest type in the page, sized so each line stays on one line down to 360px */
@media (max-width:640px){
  .v2 #why .v-h2.zz-mega,.v2 #how .v-h2.zz-mega{font-size:10vw}
  .v2 #areas .v-h2.zz-mega{font-size:8.4vw}
}
/* the reveal: each word rises out of its own line mask, one after another, with a slight lean that settles */
.v2 .zz-mega .zw{display:inline-block;transform-origin:0 100%}
.v-ok .v2 .zz-mega[data-lines] .ln>span,.v-ok .v2 .zz-mega[data-lines]:not(.in) .ln>span{transform:none;transition:none}
.v-ok .v2 .zz-mega[data-lines]:not(.in) .zw{transform:translate3d(0,112%,0) rotate(2.5deg)}
.v-ok .v2 .zz-mega[data-lines] .zw{transition:transform 1.35s var(--v-out) calc(var(--w,0) * 75ms + var(--l,0) * 90ms)}
.v-ok .v2 .zz-mega[data-lines].in .zw{transform:none}

/* ================================================================ type consistency */
/* the two headings that share a row with a photograph wrapped inside a line from 1440 up ("Deep Ground / Aeration,")
   and on a 360 phone: capped so every line stays whole */
.v2 .v-intro .v-h2,.v2 .v-newbuild .v-h2{font-size:clamp(30px,3.7vw,48px)}
@media (max-width:380px){.v2 .v-intro .v-h2{font-size:7.8vw}}
/* the lede always sits the same 24px under its heading's last line, left aligned or centred
   (a left lede measured 13 to 20px, a centred one 24px); under a display heading it gets a little more air */
.v2 main>.v-sec:not(.v-journey) .v-lede{margin-top:30px}
.v2 main>.v-sec:not(.v-journey) .v-head-c .v-lede{margin-top:24px}
.v2 main #why .v-head-row>.v-lede,.v2 main #areas .v-head-row>.v-lede{margin-top:46px}
.v2 main #how .v-head-c .v-lede{margin-top:34px}

/* ================================================================ the contact dock */
@media (min-width:641px){
  /* the WhatsApp name never opens by itself over the words; it says hello once at the top of the page (r5-zz.js) */
  .v2 .p-dock a.p-peek:not(:hover):not(:focus-visible):not(.zz-hi) span{max-width:0;margin-right:0;padding-left:0;opacity:0}
  .v2 .p-dock .v-dock-wa.p-peek:not(:hover):not(:focus-visible):not(.zz-hi){box-shadow:0 18px 36px -14px rgba(46,92,11,.6)}
  .v2 .p-dock a.zz-hi span{max-width:120px;margin-right:11px;padding-left:8px;opacity:1;transition:max-width .7s var(--v-out),margin .7s var(--v-out),opacity .5s ease .1s}
}
/* at 1000 to 1180 the dock tucks closer to the edge so it covers less of the content */
@media (min-width:641px) and (max-width:1180px){
  .v2 .v-dock.p-dock{right:12px;bottom:14px}
}

@media (prefers-reduced-motion:reduce){
  .v-ok .v2 .zz-mega[data-lines] .zw,.v-ok .v2 .zz-mega[data-lines]:not(.in) .zw{transform:none;transition:none}
}

/* ================================================================ focus: every stop shows the same green ring */
.v2 .v-arc:focus-visible{outline:none}
.v2 .v-arc:focus-visible .v-arc-ph{outline:2px solid var(--v-green);outline-offset:4px}
.v2 #how .r5-how-step button:focus-visible{outline:2px solid var(--v-green);outline-offset:4px;border-radius:6px}
.v2 #try .tl-stage:focus-visible{outline:2px solid var(--v-green);outline-offset:4px}

/* the New Build words were the only words on the page that ran under the dock at 1000 to 1180: a little more measure */
@media (min-width:901px) and (max-width:1180px){.v2 .v-newbuild .v-split-copy{padding-right:52px}}

/* ======================================================================================================================
   Round 8: phones first, then performance and accessibility. Everything below is measured with
   _v2/qa/r5-zz-phone.js, r5-zz-a11y.js and r5-zz-perf.js (390, 360, 414 and 768 wide).
   ====================================================================================================================== */

/* ---------------------------------------------------------------- skip link: the first keyboard stop, hidden until used */
.v2 .zz-skip{position:fixed;left:14px;top:10px;z-index:200;padding:16px 20px;border-radius:999px;background:var(--v-ink);color:#fff;
  font:600 11.5px/1 var(--v-sans);letter-spacing:.18em;text-transform:uppercase;transform:translateY(-160%);transition:transform .35s var(--v-out)}
.v2 .zz-skip:focus,.v2 .zz-skip:focus-visible{transform:none;outline:2px solid var(--v-lime);outline-offset:3px}

/* ---------------------------------------------------------------- contrast (WCAG AA for the small coloured words) */
/* lime-deep on white or cream measured 3.1 to 3.3:1; the house green is 4.8 to 5.2:1 */
.v2 #intro small,.v2 .r5-fq .v-faq[open]:not(.closing) summary em{color:var(--v-green)}
/* the What We Do label sat at 3.1:1 on its lime wash; the footer column titles at 4.4:1 on stone */
.v2 .v-qdo b,.v2 .v-foot .v-foot-grid h3{color:var(--v-green-2)}
/* the game status words on the glass bar: 3.3:1 and 3.0:1 before */
.v2 .v-try .tl-hud [data-s=waterlogged]{color:#9E4426}
.v2 .v-try .tl-hud [data-s=draining],.v2 .v-try .tl-hud [data-s=opening]{color:#7D5B07}
/* white words on a lime button (1.7:1): ink, like every other lime button on the page */
.v2 .v-band .v-btn-lime,.v2 .v-band .v-btn-lime span{color:var(--v-ink)}
/* the live depth number no longer nudges its neighbours as its digits count up (a source of small layout shifts) */
.v2 .t-g-now b{display:inline-block;min-width:3ch;text-align:right}

/* ---------------------------------------------------------------- touch: every target at least 44 by 44 */
/* small links keep their look; an invisible pad around them takes the thumb */
.v2 .v-hdr-phone,.v2 .v-link,.v2 .v-more,.v2 .v-faq-ask>div a{position:relative}
.v2 .v-hdr-phone::after{content:"";position:absolute;inset:-14px}
.v2 .v-link::after{content:"";position:absolute;inset:-10px -4px}
.v2 .v-more::after{content:"";position:absolute;inset:-12px -6px}
.v2 .v-faq-ask>div a::after{content:"";position:absolute;inset:-17px -6px}
.v2 .t-scroll::after{content:"";position:absolute;inset:-6px -18px}
.v2 .r4m-i::after{content:"";position:absolute;inset:-8px}
/* the contact rows: the whole row is the link */
.v2 .v-crow{position:relative}
.v2 .v-crow a::after{content:"";position:absolute;inset:0}
@media (pointer:coarse),(max-width:900px){
  .v2 .v-ba-ctl button{min-height:44px;display:inline-flex;align-items:center;box-sizing:border-box}
  .v2 .r5-how-arw{width:44px;height:44px}
  .v2 .r4m-tour{min-height:44px}
  .v2 .t-card-btn{position:relative}
  .v2 .t-card-btn::after{content:"";position:absolute;inset:-10px -4px}
  .v2 .r5-how-step h3 button{padding-top:9px;padding-bottom:9px;margin-top:-9px;margin-bottom:-9px}
  .v2 .r4m-m::after{content:"";position:absolute;inset:-8px;border-radius:50%}
  /* tablets keep the round dock: 44px circles */
  .v2 .p-dock a{--s:44px}
}
@media (max-width:900px){
  /* footer links: a full 44px row each, Privacy and Sitemap too */
  .v2 .v-foot li a{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0}
  .v2 .v-foot .v-foot-bot a{display:inline-flex;align-items:center;min-height:44px}
  .v2 .v-foot-bot span:last-child{gap:22px}
  .v2 .v-foot .v-foot-bot a{min-width:44px;justify-content:center}
  .v2 .v-foot .v-foot-bot{flex-direction:column;align-items:center;gap:0}
  .v2 .v-foot .v-foot-bot>span:first-child{display:inline-flex;align-items:center;min-height:44px}
  /* the menu's phone number and email */
  .v2 #v-menu .v-menu-foot a{display:inline-flex;align-items:center;min-height:44px}
  .v2 #v-menu .v-menu-foot{gap:0}
}

/* ---------------------------------------------------------------- phones: type */
@media (max-width:640px){
  /* nothing under 10px; small capitals labels at 10.5 to 11px */
  .v2 .p-dock span,.v2 .v-dock span{font-size:10px;letter-spacing:.14em}
  .v2 .t-g-eye,.v2 .r5-bd .v-eye,.v2 .r4m-tour-t,.v2 .v-stage .v-more{font-size:10.5px}
  .v2 .v-stage .v-area-towns span{font-size:10px}
  .v2 .v-try .tl-hint{font-size:10px;letter-spacing:.14em}
  /* the game's glass bar: labels 9.5px (they were 8px), each column as wide as its words so Waterlogged no longer
     runs out of its cell; the spare width is shared evenly */
  .v2 .v-try .tl-hud{grid-template-columns:auto auto auto}
  .v2 .v-try .tl-hud span{font-size:9.5px;letter-spacing:.1em}
  .v2 .v-try .tl-hud [data-tl-status]{font-size:14px}
  /* fields at 16px so iOS Safari does not zoom the page when one is tapped */
  .v2 input:not([type=radio]):not([type=checkbox]):not([type=range]):not([type=file]),.v2 textarea,.v2 select{font-size:16px}
}
@media (max-width:380px){
  .v2 .v-try .tl-hud [data-tl-status]{font-size:13px}
  .v2 .v-try .tl-hud span{font-size:9px;letter-spacing:.07em}
  .v2 .v-try .tl-hud>div{padding:0 8px}
}

/* ---------------------------------------------------------------- phones: the contact bar never hides anything */
@media (max-width:640px){
  body.v2{padding-bottom:calc(64px + env(safe-area-inset-bottom,0px))}
  /* anything scrolled to by the keyboard or a link stops clear of the header and the bar */
  html{scroll-padding-bottom:calc(76px + env(safe-area-inset-bottom,0px))}
  /* while a field is being typed in, the bar steps down out of the keyboard's way (r5-zz.js sets zz-typing) */
  body.zz-typing .v-dock{opacity:0;transform:translateY(100%);pointer-events:none;transition:opacity .2s,transform .3s var(--v-out)}
}

/* ---------------------------------------------------------------- tablets (641 to 900): a comfortable measure */
@media (min-width:641px) and (max-width:900px){
  .v2 main>.v-sec:not(.v-journey) .v-prose p,.v2 main>.v-sec:not(.v-journey) .v-split-copy>p{max-width:62ch}
}

/* ---------------------------------------------------------------- performance */
/* nothing loops while it is off the screen (r5-zz.js marks sections zz-off; the journey film is left alone) */
.v2 .zz-off,.v2 .zz-off *,.v2 .zz-off *::before,.v2 .zz-off *::after{animation-play-state:paused!important}
/* the WhatsApp breath grew a box shadow (a repaint every frame); now a ring that scales and fades on the compositor */
@media (min-width:641px){
  .v2 .p-dock .v-dock-wa::before{box-shadow:none;border:2px solid rgba(158,216,54,.6);animation:zzBreath 5.5s var(--v-ease) 3s infinite}
}
@keyframes zzBreath{0%,62%{transform:scale(1);opacity:0}64%{opacity:1}100%{transform:scale(1.45);opacity:0}}
@media (prefers-reduced-motion:reduce){
  .v2 .p-dock .v-dock-wa::before{animation:none}
  .v2 .zz-skip{transition:none}
}
/* the map's postcode pill: the field and the Check button fill the pill's full 44px height */
.v2 .r4m-pc button{position:relative}
.v2 .r4m-pc button::after{content:"";position:absolute;inset:-5px -4px}
@media (pointer:coarse),(max-width:900px){
  .v2 .r4m-pc input{height:42px;margin:-4px 0}
  .v2 .r4m-i{width:36px;height:36px;top:11px;right:10px}
  .v2 .r4m-i::after{inset:-4px}
}
/* tablets: the right hand surface cards' words stop short of the round dock */
@media (min-width:641px) and (max-width:900px){.v2 .v-arcs .v-arc:nth-child(2n) p{padding-right:40px}}
/* the enquiry form's third step pushed the page 24px sideways on phones: a fieldset is as wide as its widest row by
   default; it now shrinks with the column like everything else */
.v2 .v-contact-grid>*,.v2 [data-v-form] fieldset{min-width:0}
/* phones: once Back shows, the step count steps aside (the numbered steps above already say where you are) and the
   main button takes the rest of the row, like an app's footer */
@media (max-width:640px){
  .v2 .v-form-nav [data-fback]:not([hidden])~.v-fcount{display:none}
  .v2 .v-form-nav [data-fback]:not([hidden])~.v-btn-lime{flex:1 1 auto}
  .v2 .r5-ct .v-form-nav .v-btn{padding:0 20px}
}
/* headings never leave one word alone on the last line (the form's "Where Should We Reply?" did at 360) */
.v2 main h3,.v2 main h4,.v2 [data-v-form] legend,.v2 [data-v-form] .v-upload small{text-wrap:balance}

/* ---------------------------------------------------------------- round 10 QA: touch tablets and phones on their side */
/* iOS Safari zooms the page when a field under 16px is tapped, on an iPad as on a phone: every touch screen gets 16px
   fields (the form's 15px and the map's 14px postcode box), whatever its width. Mouse screens are unchanged. */
@media (hover:none) and (pointer:coarse){
  .v2 input:not([type=radio]):not([type=checkbox]):not([type=range]):not([type=file]),.v2 textarea,.v2 select,.v2 .r4m-pc input{font-size:16px}
}
/* buttons, links and labels answer a quick second tap as a tap, never as a double tap zoom (arrows, steppers, chips) */
/* (anything that sets its own pan-y, like the depth gauge or the drawings, keeps it: an ancestor's pan-y still wins) */
.v2 a,.v2 button,.v2 label,.v2 summary{touch-action:manipulation}
/* a phone on its side (a short touch screen) has the round dock, and its upright stack of three covered 40% of the
   screen's height down the right hand edge, where the carousel arrows and the map switcher sit: there it lies in a
   row along the bottom right corner instead */
@media (min-width:641px) and (max-height:500px) and (pointer:coarse){
  .v2 .v-dock-list,.v2 .p-dock .v-dock-list{flex-direction:row-reverse;align-items:center}
}
