/* ---------- The gap becomes the key ----------
   The Method hero's signature animation, from the brand concept note of Oct 31 2026.

   This is the Speaking page's ambient key (assets/offer-pages.css, ".hero .amb") adapted to tell the gap story,
   so that a visitor who has seen one page recognises the other. Everything that makes the two look alike is
   deliberately identical and should stay that way: the 620 x 720 box, the 500px height, the right offset, the
   translate(-45 30.5) scale(1.524) that places the mark, the drawn centreline path, the 4.6 stroke, and the
   line-fades-out-as-the-mark-fades-in crossfade at the end. If the banner is retimed or resized, this follows.

   The story, which is the part that differs:
     1. the line draws itself on, upside down. Upside down is the key's true position in the note, because
        something is holding you in the gap, and inverted the open shackle is a basin.
     2. five things that keep leaders and teams stuck surface in that basin, one at a time, bottom up.
     3. the key turns, slowly, and they pour out of it as it goes.
     4. it lands upright and resolves into the real mark, filled, in Antique Gold, big.
     5. it loops, so nobody has to arrive at the right second.

   One 12s cycle drives all of it, so the parts cannot drift apart. CSS only: there is no script behind this,
   it owns no markup outside the .gapkey svg, and assets/unlocking-curve.js is a different animation on a
   different part of the page and is not involved. */

/* Placement, lifted from .hero .amb so the key lands where the Speaking banner's key lands. .hero clips, which
   is what keeps the mark's empty right-hand padding off the page. */
.gapkey{position:absolute;z-index:0;pointer-events:none;top:-10px;right:max(-40px,calc(50% - 620px));
  height:500px;width:auto;overflow:visible}

/* ---- 1. the line, drawn on upside down ----
   Same dash-draw as the banner: pathLength is 1 on the path, so one unit of dashoffset is the whole stroke. */
.gk-line{fill:none;stroke:var(--gold);stroke-width:4.6;stroke-linecap:round;stroke-linejoin:round;
  opacity:0;stroke-dasharray:1;stroke-dashoffset:1;animation:gkDraw 12s ease-in-out infinite}
@keyframes gkDraw{
  0%{opacity:0;stroke-dashoffset:1}
  3%{opacity:.58;stroke-dashoffset:1}
  17%{opacity:.58;stroke-dashoffset:0}   /* drawn, and it stays drawn through the turn */
  46%{opacity:.58;stroke-dashoffset:0}
  58%{opacity:.5;stroke-dashoffset:0}    /* the key has landed: hand over to the filled mark */
  66%{opacity:0;stroke-dashoffset:0}
  99%{opacity:0;stroke-dashoffset:1}     /* reset while invisible, so the loop has no seam */
  100%{opacity:0;stroke-dashoffset:1}
}

/* ---- 3. the turn ----
   The group holds the path and nothing else, so its bounding box is the key's own and "center" is the point a
   key would actually pivot on. Easing like a hand rather than a motor, with a little overshoot as it seats. */
.gk-turn{transform-box:fill-box;transform-origin:center;transform:rotate(180deg);
  animation:gkTurn 12s cubic-bezier(.62,.02,.28,1) infinite}
@keyframes gkTurn{
  0%{transform:rotate(180deg)}
  38%{transform:rotate(180deg)}   /* held upside down while the basin fills */
  53%{transform:rotate(-7deg)}
  58%{transform:rotate(0deg)}
  100%{transform:rotate(0deg)}    /* snaps back to 180 at the seam, by which point nothing is visible */
}

/* ---- 2. what is in the gap ----
   Five, no more, so the basin stays legible. One cycle each, offset by 240ms, which staggers them surfacing and
   then staggers them leaving: the bowl drains rather than emptying in one go.
   10.4 user units is about 11px on screen. It is set by the basin, not by taste: the walls are 99px apart
   and "Missed deadlines" is the longest line, so anything larger hangs out over the side of the gap. */
.gk-word{font-family:'Montserrat',sans-serif;font-size:10.4px;font-weight:600;letter-spacing:0;
  fill:var(--gold);opacity:0;animation:gkWord 12s ease-in-out infinite}
.gk-word:nth-of-type(1){animation-delay:0s}
.gk-word:nth-of-type(2){animation-delay:.24s}
.gk-word:nth-of-type(3){animation-delay:.48s}
.gk-word:nth-of-type(4){animation-delay:.72s}
.gk-word:nth-of-type(5){animation-delay:.96s}
@keyframes gkWord{
  0%{opacity:0;transform:translateY(-7px)}
  18%{opacity:0;transform:translateY(-7px)}  /* waits for the line to finish drawing */
  24%{opacity:.82;transform:translateY(0)}
  36%{opacity:.82;transform:translateY(0)}
  45%{opacity:.5;transform:translateY(30px)} /* the key is turning: out they go */
  53%{opacity:0;transform:translateY(96px)}
  100%{opacity:0;transform:translateY(96px)}
}

/* ---- 4. the end state ----
   The real mark, upright, at the Speaking banner's size, recoloured to Antique Gold by the gkGold filter in the
   markup. It holds for a little under two and a half seconds, which is long enough to be the thing you remember
   the hero by, then clears so the loop can start again. */
.gk-mark{transform-box:fill-box;transform-origin:center;opacity:0;animation:gkMark 12s ease-out infinite}
@keyframes gkMark{
  0%{opacity:0;transform:scale(.97)}
  58%{opacity:0;transform:scale(.97)}
  68%{opacity:.88;transform:scale(1)}
  88%{opacity:.88;transform:scale(1)}
  96%{opacity:0;transform:scale(1)}
  100%{opacity:0;transform:scale(.97)}
}

/* A bloom as it seats, so the landing reads as arrival rather than as a stop. */
.gk-bloom{transform-box:fill-box;transform-origin:center;opacity:0;animation:gkBloom 12s ease-out infinite}
@keyframes gkBloom{
  0%{opacity:0;transform:scale(.72)}
  56%{opacity:0;transform:scale(.72)}
  67%{opacity:.5;transform:scale(1.08)}
  80%{opacity:0;transform:scale(1.3)}
  100%{opacity:0;transform:scale(.72)}
}

/* The warm field behind it. Its own slow breath, unsynced on purpose, so the hero is never completely still. */
.gk-glow{transform-box:fill-box;transform-origin:center;animation:gkBreath 9s ease-in-out infinite alternate}
@keyframes gkBreath{from{transform:scale(.94);opacity:.6}to{transform:scale(1.06);opacity:1}}

/* Same two step-downs as the Speaking banner, at the same two widths, for the same reason: the copy column is
   760px inside a 1160px wrap, and below about 1180 the full-size key starts to reach the end of the headline.
   Measured, because it is closer than it looks: at 1181 there are 144px between the key and the copy, at 1024
   there are none and the last word of the headline sits on the stem.
   The five words step down with it rather than shrinking. At 400px tall they would be about nine pixels high
   and sitting behind the headline, which helps nobody. The turn still runs at every width, so the gap still
   becomes the key; below 1180 it is told by the shape alone rather than by the shape and the list.
   The opacities are a little lower than the banner's because this mark resolves at .88 where that one rests at
   .42, so the same opacity here would be a louder thing sitting behind the same copy. */
@media(max-width:1180px){
  .gapkey{height:400px;right:-70px;opacity:.55}
  .gk-word{display:none}
}
@media(max-width:860px){
  .gapkey{height:300px;right:-120px;top:0;opacity:.34}
}

/* All of the above is staging for one image. Without motion, that image is simply already there, upright and
   full size, which is the end state the sequence was heading for anyway. */
@media(prefers-reduced-motion:reduce){
  .gk-line,.gk-turn,.gk-word,.gk-mark,.gk-bloom,.gk-glow{animation:none}
  .gk-line,.gk-word,.gk-bloom{opacity:0}
  .gk-turn{transform:rotate(0deg)}
  .gk-mark{opacity:.88;transform:none}
  .gk-glow{opacity:.9;transform:none}
}
