/* =========================================================================
   Site future, phase 4: the motion pass (owner, 12 Nov 2026 - "more
   animation"; an audit of every public page on a phone and a desktop first).

   Loaded after phases 1-3. The same rules as theirs:
     - An enhancement only. With this file or js/site-future-4.js missing,
       every page reads and works as before; no hidden state waits on a
       script, and every animation that starts hidden ends shown.
     - "Reduce motion" turns all of it off; the countdown's seconds go too.
     - Transform, opacity and (once, on one line of type) a background
       position: nothing here moves layout.
     - WCAG 2.2.2: what plays by itself plays once and is over in under five
       seconds. What keeps moving does so only because the visitor scrolls or
       moves the pointer (the parallax, the type band, the footer wordmark,
       the pointer light). The countdown is a clock: real-time information.

   What is here:
     1  hero         the photograph drifts and the name lifts as the page
                     scrolls; one light sweep across "The Dukes"
     2  countdown    a seconds box beside days, hours and minutes
     3  type band    a line of large outlined type between the Match Centre
                     and the news, moved by the scroll
     4  headings     the pink dash draws in; page titles rise, underline draws
     5  pictures     news, shop and player photographs settle out of a zoom
     6  results      the score lands; the form guide pops in one by one;
                     table rows arrive in a cascade
     7  buttons      a press, and one glint when a primary button comes into view
     8  menu         the phone menu's entries rise one after another
     9  back to top  a small button on long pages (js/site-future-4.js)
    10  pointer      a soft light that follows a mouse (desktop only)
    11  no picture   a news item without a photograph gets a club tile
   ========================================================================= */

:root{--spring:cubic-bezier(.34,1.56,.64,1)}

/* ---- 2. Countdown: the seconds box ---------------------------------------
   Drawn by the page's own script beside days, hours and minutes; it shares
   their box. Hidden from assistive technology (a number read out every
   second helps nobody) and under "reduce motion". */
.mc-count .cs{display:grid;justify-items:center;min-width:64px;padding:var(--s2) var(--s3);border:1px solid var(--line-2);background:rgba(14,14,16,.6);overflow:hidden}
.mc-count .cs b{font-family:'Anton',sans-serif;font-weight:400;font-size:1.9rem;line-height:1;color:var(--pink-hi);font-variant-numeric:tabular-nums;display:block}
.mc-count .cs i{font-family:'Teko',sans-serif;font-style:normal;font-size:.72rem;letter-spacing:.2em;text-transform:uppercase;color:var(--text-3);margin-top:2px}
.mc-count .c{overflow:hidden}
.mc-count .c b{display:block}
@media(max-width:600px){.mc-count .cs{min-width:0;flex:1}}
@media (prefers-reduced-motion:reduce){.mc-count .cs{display:none}}

/* ---- 3. The type band -----------------------------------------------------
   Decoration (aria-hidden). Still without the script; with it, --bx moves the
   line as the band crosses the window. */
.gd4-band{position:relative;overflow:hidden;background:var(--ink);border-top:1px solid rgba(237,230,218,.08);padding:clamp(14px,2.2vw,26px) 0;user-select:none;-webkit-user-select:none}
.gd4-band-t{display:flex;align-items:center;gap:.42em;width:max-content;white-space:nowrap;margin:0;padding-left:var(--s4);font-family:'Anton',sans-serif;font-weight:400;text-transform:uppercase;font-size:clamp(2.6rem,9vw,6.4rem);line-height:1;letter-spacing:.01em;color:transparent;-webkit-text-stroke:1px rgba(237,230,218,.3);transform:translate3d(calc(var(--bx,0)*-1px),0,0)}
.gd4-band-t b{font-weight:400;color:var(--pink);-webkit-text-stroke:0}
.gd4-band-t i{font-style:normal;font-size:.34em;color:var(--pink-hi);-webkit-text-stroke:0}
@supports not (-webkit-text-stroke:1px #000){.gd4-band-t{color:rgba(237,230,218,.3)}}
@media (forced-colors:active){.gd4-band-t{color:CanvasText;-webkit-text-stroke:0}}
.gd4 .gd4-band-t{will-change:transform}

/* ---- 9. Back to top ------------------------------------------------------- */
.gd4-top{position:fixed;right:max(14px,env(safe-area-inset-right,0px));bottom:calc(14px + env(safe-area-inset-bottom,0px));z-index:150;display:grid;place-items:center;width:46px;height:46px;padding:0;border:1px solid var(--glass-line,rgba(237,230,218,.13));border-radius:0;background:var(--glass,rgba(17,17,20,.62));-webkit-backdrop-filter:blur(14px) saturate(140%);backdrop-filter:blur(14px) saturate(140%);color:#F4F0E9;cursor:pointer;overflow:hidden;opacity:0;visibility:hidden;transform:translateY(12px);transition:opacity .25s linear,transform .35s cubic-bezier(.16,1,.3,1),visibility 0s linear .35s,border-color .2s linear}
.gd4-top.on{opacity:1;visibility:visible;transform:none;transition:opacity .25s linear,transform .35s cubic-bezier(.16,1,.3,1),border-color .2s linear}
.gd4-top svg{width:16px;height:16px;display:block}
.gd4-top::after{content:'';position:absolute;left:0;right:0;bottom:0;height:3px;background:var(--pink,#D75677);transform:scaleX(var(--tp,0));transform-origin:0 50%}
.gd4-top:hover{border-color:var(--pink-hi,#E8799B)}
.gd4-top:focus-visible{outline:2px solid var(--pink-hi,#E8799B);outline-offset:3px}
/* Never over the privacy notice, the open menu's page, or the shop's own bar. */
body:has(.notice.on) .gd4-top,body:has(#page-shop.on) .gd4-top,body:has(.pcard-panel.on) .gd4-top{display:none}
@media (prefers-reduced-motion:reduce){.gd4-top,.gd4-top.on{transition:none;transform:none}}
@media print{.gd4-top,.gd4-band,.gd4-spot{display:none!important}}

/* ---- 10. The pointer light (a mouse only; made by the script) -------------- */
.gd4-spot{position:fixed;left:0;top:0;z-index:140;width:560px;height:560px;margin:-280px 0 0 -280px;border-radius:50%;pointer-events:none;background:radial-gradient(closest-side,rgba(232,121,155,.14),rgba(232,121,155,.05) 45%,rgba(232,121,155,0));mix-blend-mode:screen;opacity:0;transition:opacity .5s linear;will-change:transform}
.gd4-spot.on{opacity:1}

/* ---- 11. A news item with no photograph: a club tile ----------------------- */
.nofoto{position:relative;overflow:hidden;isolation:isolate;background:var(--ink,#0E0E10);border-left:0;outline:1px solid rgba(237,230,218,.08);outline-offset:-1px}
.nofoto::before{content:'';position:absolute;inset:-20% -10%;z-index:-1;background:rgba(232,121,155,.2);-webkit-mask:var(--tex) center/cover no-repeat;mask:var(--tex) center/cover no-repeat}
.nofoto::after{content:'';position:absolute;right:7%;top:50%;z-index:-1;width:min(30%,150px);aspect-ratio:1;transform:translateY(-50%);background:url(/Logo-256.webp) center/contain no-repeat;opacity:.92}
.nofoto span{position:relative;color:var(--pink-hi,#E8799B)}

@media (prefers-reduced-motion:no-preference){

  /* ---- 7. Buttons: a press ---------------------------------------------------
     `scale`, not `transform`, so it never fights a reveal's transform. */
  .a-btn{transition:color var(--t2),border-color var(--t2),scale .18s var(--ease-out)}
  .a-btn:active{scale:.97}

  /* ---- 1. Hero --------------------------------------------------------------
     --hy is set by the script as the page scrolls (0 at the top). The
     photograph moves down inside its frame at about a quarter of the scroll,
     so it leaves the window more slowly than the page; the gap that opens
     above it is already off the top of the window. The name lifts a little
     the other way. */
  .gd4 .hero-media picture{transform:translate3d(0,calc(var(--hy,0)*1px),0);will-change:transform}
  .gd4 .hero-id{transform:translate3d(0,calc(var(--hy,0)*-.22px),0)}

  /* The photograph opens out of a slightly smaller frame as the page loads. */
  .hero-media picture{animation:gd4-open 1.5s var(--ease-out) both}
  .hero.is-settled .hero-media picture{animation:none}

  /* One sweep of light across the name, after its line has risen. Both ends
     of the gradient are the text's own colour, so before, after and with the
     animation removed (.is-settled) the name is exactly as it was. */
  @supports ((-webkit-background-clip:text) or (background-clip:text)){
    @media not (forced-colors:active){
      .hero .hero-name>span{background:linear-gradient(100deg,currentColor 0 41%,#fff 47%,var(--pink-hi) 50%,#fff 53%,currentColor 59% 100%) 100% 0/320% 100% no-repeat;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;
        animation:gd-line var(--dur-5) var(--ease-out) both,gd4-shine 1.7s var(--ease-io) 1.25s 1 both;animation-delay:calc(160ms + var(--d,0)*130ms),1.25s}
      .hero.is-settled .hero-name>span{animation:none}
    }
  }

  /* ---- 4. Headings -----------------------------------------------------------
     The dash before a section heading draws in with its section. */
  .gd-motion h2.t-label::before{transform-origin:0 50%;transition:transform .9s var(--ease-out) .18s}
  .gd-motion :is(.a-rise:not(.in),[data-reveal]:not(.is-in)) h2.t-label::before{transform:scaleX(0)}
  .gd-motion .gd-now h2.t-label::before{transition:none}

  /* An inner page's head: the label, the title, its underline, the sentence.
     Plain CSS from the first paint (no class to wait for), run each time the
     page is shown. */
  .page.on>.phead>.t-label{animation:gd4-fade .6s linear both}
  .page.on>.phead>h1{animation:gd4-up .85s var(--ease-out) 60ms both}
  .page.on>.phead>h1::after{transform-origin:0 50%;animation:gd4-draw .9s var(--ease-out) .35s both}
  .page.on>.phead>.t-meta{animation:gd4-up .85s var(--ease-out) .16s both}

  /* ---- 5. Pictures settle out of a zoom as their section arrives ------------- */
  .gd-motion :is(.a-rise,[data-reveal]) :is(.a-media,.pcard-media) img{transition:transform 1.5s var(--ease-out)}
  .gd-motion :is(.a-rise:not(.in),[data-reveal]:not(.is-in)) :is(.a-media,.pcard-media) img{transform:scale(1.14)}
  .gd-motion .gd-now :is(.a-media,.pcard-media) img{transition:none}

  /* The first-team rail: its cards come in from the right, one after another. */
  .gd-motion :is(.a-rise:not(.in),[data-reveal]:not(.is-in)) .pf-track[data-stagger]>*{transform:translate3d(64px,0,0)}

  /* Goals and assists: each player's bar grows to its length. */
  .gd-motion :is(.a-rise,[data-reveal]) .sbar{transform-origin:0 50%;transition:width var(--dur-3) var(--ease),transform 1.1s var(--ease-out) .25s}
  .gd-motion :is(.a-rise:not(.in),[data-reveal]:not(.is-in)) .sbar{transform:scaleX(0)}

  /* ---- 6. Results --------------------------------------------------------------
     The last result's score lands as the Match Centre arrives. */
  .gd-motion .mcband-in .hero-result .sb-n{transform-origin:100% 50%;transition:opacity .25s linear .3s,transform .75s var(--spring) .3s}
  .gd-motion .mcband-in:not(.is-in) .hero-result .sb-n{opacity:0;transform:scale(1.7)}

  /* The form guide: one result after another. Once only - .gd4-done is set by
     the script when the last has landed, so a data refresh redraws them still.
     (Not held back for .gd-now, which lasts two frames: a rule that waited for
     it to go would show the row, hide it and bring it in again.) */
  .gd-motion .is-in:not(.gd4-done) .pos-form b{animation:gd4-pop .5s var(--spring) both;animation-delay:calc(.45s + var(--n,0)*90ms)}
  .pos-form b:nth-of-type(2){--n:1}.pos-form b:nth-of-type(3){--n:2}.pos-form b:nth-of-type(4){--n:3}.pos-form b:nth-of-type(5){--n:4}

  /* Table rows, in a cascade. Opacity only (a transform on a table row is not
     dependable everywhere). */
  .gd-motion :is(.a-rise.in,[data-reveal].is-in):not(.gd4-done) tbody>tr{animation:gd4-row .5s linear both;animation-delay:calc(.12s + var(--r,12)*45ms)}
  tbody>tr:nth-child(1){--r:0}tbody>tr:nth-child(2){--r:1}tbody>tr:nth-child(3){--r:2}tbody>tr:nth-child(4){--r:3}tbody>tr:nth-child(5){--r:4}tbody>tr:nth-child(6){--r:5}
  tbody>tr:nth-child(7){--r:6}tbody>tr:nth-child(8){--r:7}tbody>tr:nth-child(9){--r:8}tbody>tr:nth-child(10){--r:9}tbody>tr:nth-child(11){--r:10}tbody>tr:nth-child(12){--r:11}

  /* ---- 7. A glint, once, when a primary button comes into view -----------------
     The script adds .gd4-g the first time the button is fully on screen. (Not
     scroll-driven: a button that sits still - the shop's checkout bar - would
     be left with the light stopped half-way across it.) */
  .a-btn.primary.gd4-g::after{content:'';position:absolute;inset:-1px;z-index:-1;pointer-events:none;background:linear-gradient(105deg,rgba(255,255,255,0) 36%,rgba(255,255,255,.5) 50%,rgba(255,255,255,0) 64%);transform:translateX(-130%);animation:gd4-glint 1s var(--ease-io) .25s 1 both}

  /* The hero's own button is on screen from the start, so its glint is timed:
     once, after the card has arrived. */
  .hero .a-btn.primary::after{content:'';position:absolute;inset:-1px;z-index:-1;pointer-events:none;background:linear-gradient(105deg,rgba(255,255,255,0) 36%,rgba(255,255,255,.5) 50%,rgba(255,255,255,0) 64%);transform:translateX(-130%);animation:gd4-glint 1.1s var(--ease-io) 2.1s 1 both}

  /* ---- 8. The phone menu: its entries rise one after another ------------------- */
  .mob.open>*{animation:gd4-up .55s var(--ease-out) both;animation-delay:calc(70ms + var(--k,8)*45ms)}
  .mob>:nth-child(1){--k:0}.mob>:nth-child(2){--k:1}.mob>:nth-child(3){--k:2}.mob>:nth-child(4){--k:3}.mob>:nth-child(5){--k:4}.mob>:nth-child(6){--k:5}.mob>:nth-child(7){--k:6}.mob>:nth-child(8){--k:7}

  /* The footer wordmark slides to rest as the foot of the page arrives (--fw
     runs 0 to 1, set by the script; 1 without it). */
  .gd4 .ft-word{transform:translate3d(calc((1 - var(--fw,1))*-10%),0,0);will-change:transform}

  /* The seconds: each new number drops in (the script adds .tk). */
  .mc-count b.tk{animation:gd4-tick .32s var(--ease-out) both}
}

@keyframes gd4-open{from{clip-path:inset(8% 6% 8% 6%)}to{clip-path:inset(0)}}
@keyframes gd4-shine{from{background-position:0 0}to{background-position:100% 0}}
@keyframes gd4-fade{from{opacity:0}}
@keyframes gd4-up{from{opacity:0;transform:translate3d(0,18px,0)}}
@keyframes gd4-draw{from{transform:scaleX(0)}}
@keyframes gd4-pop{from{opacity:0;transform:scale(.3)}}
@keyframes gd4-row{from{opacity:0}}
@keyframes gd4-glint{to{transform:translateX(130%)}}
@keyframes gd4-tick{from{opacity:0;transform:translate3d(0,-55%,0)}}

/* Print: the name in its own colour (a clipped background does not print). */
@media print{.hero .hero-name>span{background:none;-webkit-text-fill-color:currentColor;animation:none}}
