/* Carried over from punk.css: the intro overlay and the delivery explainer. */
/* ============================================================
   THE INTRO · the brand moment on the delivery pages

   Ships hidden. punk-intro.js is the only thing that unhides
   it, after it has checked the session, the connection, reduced
   motion and its own load budget. A visitor with JavaScript off
   never sees a frame of it and can never be trapped behind it.

   The page underneath is fully rendered and interactive the
   whole time. This is an overlay, not a gate.

   The timeline lives in punk-intro.js; the durations here match
   FLOOD_MS, HOLD_MS and WIPE_MS in that file.
   ============================================================ */

.intro[hidden] {
  display: none;
}
.intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  /* Midnight from the first painted frame, so there is never a
     white flash before the film arrives. */
  background: #141617;
  overflow: hidden;
  transform: translate3d(0, 0, 0);
  /* A firm ease out with no overshoot. The overlay should feel
     lifted away, not bounced. */
  transition: transform 0.52s cubic-bezier(0.76, 0, 0.24, 1);
}

/* The exit is a wipe, not a cross-dissolve.
   Fading the overlay out over the page put the mark on top of
   the headline, the buttons and the draft bar for about half a
   second, which reads as a rendering fault rather than as a
   transition. Moving it off screen keeps the two layers apart:
   you see the intro, then you see the page. */
.intro.is-out {
  transform: translate3d(0, -101%, 0);
  pointer-events: none;
}

/* Scroll is locked only while the overlay is up, and the class
   comes off before the wipe starts, so the page is already
   scrollable as it is revealed. */
.has-intro body {
  overflow: hidden;
}

.intro__media {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.intro__media video,
.intro__still {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* The film settles rather than appearing. It eases down from a
   slight scale as it fades up, which is the difference between
   a shot arriving and a shot being switched on. */
.intro video {
  position: relative;
  z-index: 2;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 0.34s ease-out, transform 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.intro.is-playing video {
  opacity: 1;
  transform: scale(1);
}

/* The poster holds the first frame until the film is actually
   running, so the overlay is never an empty rectangle. */
.intro__still {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.9;
}
.intro.is-playing .intro__still {
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

/* Portrait footage on a landscape screen. Showing the whole
   frame centred, with the film's own colour bled out behind it,
   reads as deliberate; cropping a 9:16 shot down to a 16:9 slot
   throws away most of the picture. */
@media (min-aspect-ratio: 1/1) {
  .intro__media::before {
    content: "";
    position: absolute;
    inset: -10%;
    background: radial-gradient(
      ellipse at center,
      #4a0f1c 0%,
      #1c0a10 58%,
      #141617 100%
    );
  }
  .intro__media video,
  .intro__still {
    width: auto;
    max-width: 100%;
    object-fit: contain;
  }
}

/* ---------- THE MARK ----------
   Flat brand red, not a translucent scrim over a dimmed video
   frame. The mark needs a clean ground to land on; sitting it
   on a darkened still made it muddy and cheap. */
.intro__mark {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: #ff2146;
  opacity: 0;
  pointer-events: none;
  /* A snap, not a dissolve. A slow crossfade from the film to
     flat red spends its middle as a muddy blend of the two,
     which was what made the mark look cheap. */
  transition: opacity 0.12s linear;
}
.intro.is-mark .intro__mark {
  opacity: 1;
}
.intro__mark img {
  /* Scales with the screen rather than capping early. A 340px
     cap left the mark marooned in the middle of a 1440px field
     of red on a laptop. */
  width: clamp(200px, 30vw, 520px);
  max-width: 76%;
  height: auto;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.34s ease-out 0.12s,
    transform 0.62s cubic-bezier(0.22, 1, 0.36, 1) 0.1s;
}
.intro.is-mark .intro__mark img {
  opacity: 1;
  transform: scale(1);
}

/* Belt and braces. A visitor who asked for less motion never
   gets the overlay at all, but if the class somehow lands,
   nothing animates. */
@media (prefers-reduced-motion: reduce) {
  .intro,
  .intro video,
  .intro__still,
  .intro__mark,
  .intro__mark img {
    transition: none;
  }
}

/* A plate whose picture is a silent loop rather than a still.
   The frame, the border and the label are the plate's; only the
   media element differs, so it sits in the grid exactly as a
/* ============================================================
   THE EXPLAINER

   Five beats on one 16 second loop. Every element rides the same
   loop and offsets itself with a delay, so nothing sequences
   anything else and nothing can drift.

     --n   number of beats
     --T   loop length
     --b   which beat an element belongs to, 1 based
     --d   extra delay inside its own beat

   A beat is on screen for --T / --n. The keyframes below are
   written as percentages of the whole loop with --n baked in at
   five beats, which is why --n is a comment rather than a
   variable: CSS cannot compute keyframe percentages. Change the
   beat count and the three keyframe blocks change with it.
   Twenty per cent per beat.
   ============================================================ */

.xpl {
  --T: 16s;
  --step: 3.2s;
  margin-top: 2.25rem;
  container-type: inline-size;
}

.xpl__frame {
  position: relative;
  background: var(--midnight);
  border-radius: 14px;
  overflow: hidden;
  isolation: isolate;
}

/* The grain the rest of the site carries, so the panel does not
   read as a flat vector island dropped into a photographic page. */
.xpl__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image: url("brand/tx-midnight.jpg");
  background-size: 420px;
  mix-blend-mode: overlay;
}

.xpl__stage {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- beat visibility ---------- */

.xpl__b {
  opacity: 0;
}
.is-in .xpl__b {
  animation: xplBeat var(--T) linear infinite;
  animation-delay: calc((var(--b) - 1) * var(--step));
}

@keyframes xplBeat {
  0% { opacity: 0; }
  2% { opacity: 1; }
  17% { opacity: 1; }
  20% { opacity: 0; }
  100% { opacity: 0; }
}

/* ---------- shared ink ---------- */

.xpl__b [class^="xpl__"],
.xpl__b [class*=" xpl__"] {
  transform-box: fill-box;
  transform-origin: center;
}

/* ---------- beat 1 · you order ---------- */

.xpl__phone { fill: var(--newspaper); }
.xpl__screen { fill: var(--midnight); }
.xpl__row { fill: var(--newspaper); opacity: 0.9; transform-origin: left center; }
.is-in .xpl__row {
  animation: xplRow var(--T) linear infinite;
  animation-delay: calc((var(--b) - 1) * var(--step) + var(--d, 0s));
}
@keyframes xplRow {
  0%, 1% { transform: scaleX(0); }
  4%, 17% { transform: scaleX(1); }
  20%, 100% { transform: scaleX(1); }
}
.xpl__cta { fill: var(--anarchy); }

/* The postcode, entered. A chip with a dot rather than letters,
   because a real postcode on screen would be a Glasgow one on the
   Leeds page and there is only one of these diagrams. */
.xpl__pc { fill: var(--newspaper); opacity: 0.18; }
.xpl__pcdot { fill: var(--anarchy); }

.xpl__pinbody { fill: var(--anarchy); }
.xpl__pinhole { fill: var(--midnight); }
.is-in .xpl__pin {
  animation: xplPin var(--T) ease-out infinite;
  animation-delay: calc((var(--b) - 1) * var(--step));
}
@keyframes xplPin {
  0% { transform: translateY(-40px) scale(0.8); opacity: 0; }
  4% { transform: translateY(0) scale(1); opacity: 1; }
  6% { transform: translateY(-14px) scale(1); }
  8% { transform: translateY(0) scale(1); }
  17% { opacity: 1; }
  20%, 100% { opacity: 0; }
}

/* The build, flying in. Three chips, no words: the point is that
   you choose several things, not what they are. */
.xpl__chip { fill: var(--cheese); opacity: 0; }
.is-in .xpl__chip {
  animation: xplChip var(--T) cubic-bezier(0.22, 1, 0.36, 1) infinite;
  animation-delay: calc((var(--b) - 1) * var(--step) + var(--d, 0s));
}
@keyframes xplChip {
  0% { opacity: 0; transform: translateX(190px); }
  5% { opacity: 1; transform: translateX(0); }
  17% { opacity: 1; transform: translateX(0); }
  20%, 100% { opacity: 0; transform: translateX(0); }
}
.xpl__tap {
  fill: none;
  stroke: var(--newspaper);
  stroke-width: 5;
  opacity: 0;
}
.is-in .xpl__tap {
  animation: xplTap var(--T) linear infinite;
  animation-delay: calc((var(--b) - 1) * var(--step) + 1.4s);
}
@keyframes xplTap {
  0% { opacity: 0.9; transform: scale(0.35); }
  6% { opacity: 0; transform: scale(1.6); }
  100% { opacity: 0; transform: scale(1.6); }
}

/* ---------- beat 2 · we make it ---------- */

.xpl__dough { fill: var(--newspaper); }
.xpl__top { fill: var(--anarchy); opacity: 0; }
.xpl__top--c { fill: var(--cheese); }
.is-in .xpl__top {
  animation: xplDrop var(--T) cubic-bezier(0.3, 1.4, 0.5, 1) infinite;
  animation-delay: calc((var(--b) - 1) * var(--step) + var(--d, 0s));
}
@keyframes xplDrop {
  0% { opacity: 0; transform: translateY(-80px) scale(0.4); }
  5% { opacity: 1; transform: translateY(0) scale(1); }
  17% { opacity: 1; transform: translateY(0) scale(1); }
  20%, 100% { opacity: 0; transform: translateY(0) scale(1); }
}
.xpl__oven { fill: var(--anarchy); }
.xpl__flame { fill: var(--cheese); }
.is-in .xpl__flame {
  animation: xplFlame 1.1s ease-in-out infinite alternate;
}
@keyframes xplFlame {
  from { transform: scaleY(0.82); opacity: 0.85; }
  to   { transform: scaleY(1.1); opacity: 1; }
}
.xpl__peel { fill: var(--newspaper); opacity: 0.34; }
.xpl__peelhead { fill: var(--newspaper); opacity: 0.22; }

/* It is built, then it goes in. The move happens at the end of
   the beat so the toppings have landed first. */
.is-in .xpl__peelwrap {
  animation: xplLoad var(--T) cubic-bezier(0.7, 0, 0.3, 1) infinite;
  animation-delay: calc((var(--b) - 1) * var(--step));
}
@keyframes xplLoad {
  0%, 9% { transform: translateX(0); }
  16% { transform: translateX(520px); }
  20%, 100% { transform: translateX(520px); }
}

/* ---------- beat 3 · one of ours ---------- */

.xpl__shop { fill: #1e2223; }
.xpl__awning { fill: var(--anarchy); }
.xpl__mark { fill: none; stroke: var(--anarchy); stroke-width: 9; }
.xpl__marka {
  fill: none;
  stroke: var(--newspaper);
  stroke-width: 9;
  stroke-linecap: square;
}
.xpl__road {
  stroke: var(--newspaper);
  stroke-width: 4;
  opacity: 0.22;
  stroke-dasharray: 34 26;
}
.xpl__wheel { fill: none; stroke: var(--newspaper); stroke-width: 9; }
.xpl__bike .xpl__bikeframe,
.xpl__bike path {
  fill: none;
  stroke: var(--newspaper);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.xpl__crate { fill: var(--anarchy); }
.xpl__crate2 { fill: var(--anarchy); opacity: 0.78; }

/* Ours comes through. The generic one does not keep up, which is
   the entire argument of the page rendered as a piece of timing
   rather than as a sentence. */
.is-in .xpl__bike {
  animation: xplRide var(--T) cubic-bezier(0.32, 0, 0.2, 1) infinite;
  animation-delay: calc((var(--b) - 1) * var(--step));
}
@keyframes xplRide {
  0% { transform: translateX(-820px); }
  10% { transform: translateX(-40px); }
  17% { transform: translateX(60px); }
  20%, 100% { transform: translateX(60px); }
}
.xpl__ghost {
  fill: none;
  stroke: var(--newspaper);
  stroke-width: 7;
  opacity: 0;
}
.is-in .xpl__ghost {
  animation: xplGhost var(--T) ease-out infinite;
  animation-delay: calc((var(--b) - 1) * var(--step));
}
@keyframes xplGhost {
  0% { opacity: 0; transform: translateX(-520px); }
  7% { opacity: 0.3; transform: translateX(-300px); }
  15% { opacity: 0; transform: translateX(-210px); }
  100% { opacity: 0; transform: translateX(-210px); }
}

/* ---------- beat 4 · to your door ---------- */

.xpl__wall { fill: #1e2223; }
.xpl__door { fill: var(--newspaper); opacity: 0.92; }
.xpl__handle { fill: var(--midnight); }
.xpl__step { fill: var(--newspaper); opacity: 0.18; }
.xpl__arm { fill: var(--cheese); }
.xpl__arm--b { fill: var(--newspaper); opacity: 0.88; }
.xpl__box { fill: var(--anarchy); }
.xpl__boxlid { fill: var(--anarchy); opacity: 0.8; }
.is-in .xpl__boxwrap {
  animation: xplHand var(--T) cubic-bezier(0.32, 0, 0.2, 1) infinite;
  animation-delay: calc((var(--b) - 1) * var(--step));
}
@keyframes xplHand {
  0% { transform: translateX(-380px) rotate(-5deg); }
  9%, 12% { transform: translateX(0) rotate(0deg); }
  17% { transform: translateX(260px) rotate(2deg); }
  20%, 100% { transform: translateX(260px) rotate(2deg); }
}
.is-in .xpl__hands {
  animation: xplArms var(--T) cubic-bezier(0.32, 0, 0.2, 1) infinite;
  animation-delay: calc((var(--b) - 1) * var(--step));
}
@keyframes xplArms {
  0% { transform: translateX(-54px); }
  9%, 17% { transform: translateX(0); }
  20%, 100% { transform: translateX(0); }
}
.xpl__ring {
  fill: none;
  stroke: var(--cheese);
  stroke-width: 6;
  opacity: 0;
}
.is-in .xpl__ring {
  animation: xplRing var(--T) ease-out infinite;
  animation-delay: calc((var(--b) - 1) * var(--step) + 1.5s);
}
@keyframes xplRing {
  0% { opacity: 0.8; transform: scale(0.4); }
  7% { opacity: 0; transform: scale(1.5); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* ---------- beat 5 · the payoff ---------- */

.xpl__seal { fill: var(--anarchy); }
.xpl__sealtick {
  fill: none;
  stroke: var(--newspaper);
  stroke-width: 18;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
}
.is-in .xpl__sealtick {
  animation: xplTick var(--T) cubic-bezier(0.22, 1, 0.36, 1) infinite;
  animation-delay: calc((var(--b) - 1) * var(--step) + 0.25s);
}
@keyframes xplTick {
  0% { stroke-dashoffset: 300; }
  6%, 17% { stroke-dashoffset: 0; }
  20%, 100% { stroke-dashoffset: 0; }
}

/* The real mark, not a redrawn one. It sits over the last beat
   only, so the brand signs the sequence off rather than being
   approximated inside it. */
.xpl__logo {
  position: absolute;
  left: 50%;
  bottom: 7%;
  width: min(36%, 320px);
  transform: translateX(-50%);
  opacity: 0;
}
.is-in .xpl__logo {
  animation: xplLogo var(--T) ease-out infinite;
  animation-delay: calc(4 * var(--step) + 0.5s);
}
@keyframes xplLogo {
  0% { opacity: 0; transform: translateX(-50%) translateY(14px); }
  4%, 17% { opacity: 1; transform: translateX(-50%) translateY(0); }
  20%, 100% { opacity: 0; transform: translateX(-50%) translateY(0); }
}

/* ---------- captions and rail ---------- */

.xpl__caps {
  position: relative;
  padding-left: 2px;
  margin-top: 1.1rem;
  min-height: 4.4em;
}
.xpl__cap {
  position: absolute;
  inset: 0;
  margin: 0;
  max-width: 54ch;
  opacity: 0;
  font-size: 1.02rem;
  line-height: 1.45;
}
.xpl__cap b {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.is-in .xpl__cap {
  animation: xplCap var(--T) linear infinite;
  animation-delay: calc((var(--b) - 1) * var(--step));
}
@keyframes xplCap {
  0% { opacity: 0; transform: translateY(6px); }
  3% { opacity: 1; transform: translateY(0); }
  17% { opacity: 1; transform: translateY(0); }
  19%, 100% { opacity: 0; transform: translateY(0); }
}

.xpl__dots {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
}
.xpl__dot {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: var(--rule);
  overflow: hidden;
  position: relative;
}
.xpl__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--anarchy);
  transform: scaleX(0);
  transform-origin: left center;
}
.is-in .xpl__dot::after {
  animation: xplDot var(--T) linear infinite;
  animation-delay: calc((var(--b) - 1) * var(--step));
}
@keyframes xplDot {
  0% { transform: scaleX(0); }
  20% { transform: scaleX(1); }
  20.01%, 100% { transform: scaleX(0); }
}

/* ---------- small screens ---------- */

@container (max-width: 560px) {
  .xpl__cap { font-size: 0.95rem; }
  .xpl__caps { min-height: 5.6em; }
}

/* ---------- reduced motion ----------

   Nothing moves and nothing loops. The last beat is shown as a
   still with its caption, because that beat is the argument and
   the other four are the demonstration of it. */
@media (prefers-reduced-motion: reduce) {
  .is-in .xpl__b,
  .is-in .xpl__cap,
  .is-in .xpl__logo,
  .is-in .xpl__dot::after,
  .is-in .xpl__row,
  .is-in .xpl__top,
  .is-in .xpl__tap,
  .is-in .xpl__flame,
  .is-in .xpl__bike,
  .is-in .xpl__ghost,
  .is-in .xpl__boxwrap,
  .is-in .xpl__hands,
  .is-in .xpl__ring,
  .is-in .xpl__sealtick {
    animation: none !important;
  }
  .xpl__b { opacity: 0; }
  .xpl__b[style*="--b:5"] { opacity: 1; }
  .xpl__cap { opacity: 0; }
  .xpl__cap[style*="--b:5"] { opacity: 1; }
  .xpl__logo { opacity: 1; transform: translateX(-50%); }
  .xpl__sealtick { stroke-dashoffset: 0; }
  .xpl__dot::after { transform: scaleX(0); }
  .xpl__dot:last-child::after { transform: scaleX(1); }
}

/* ---------- the explainer, with the real A ----------
   The shop sign, the crate, the box lid and the seal all carry
   the A cut from the client's own logo file. */
.xpl__shopA,
.xpl__screenA,
.xpl__crateA,
.xpl__lidA { opacity: 1; }
.xpl__mode { opacity: 0; }
.xpl__mode .xpl__chip { opacity: 1; animation: none; fill: transparent; stroke: var(--cheese); stroke-width: 6; }
.xpl__mode .xpl__chip--on { fill: var(--cheese); }
.is-in .xpl__mode {
  animation: xplChip var(--T) cubic-bezier(0.22, 1, 0.36, 1) infinite;
  animation-delay: calc((var(--b) - 1) * var(--step) + var(--d, 0s));
}
.xpl__chipt {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-anchor: middle;
  fill: var(--cheese);
}
.xpl__chipt--on { fill: var(--midnight); }
.xpl__big {
  font-family: var(--display);
  font-size: 120px;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-anchor: middle;
  fill: var(--newspaper);
  opacity: 0.9;
}
.xpl__sealA { opacity: 0; }
.is-in .xpl__sealA {
  animation: xplStamp var(--T) cubic-bezier(0.22, 1, 0.36, 1) infinite;
  animation-delay: calc(4 * var(--step) + 0.2s);
}
@keyframes xplStamp {
  0% { opacity: 0; transform: scale(1.6) rotate(-8deg); }
  3% { opacity: 1; transform: scale(0.94) rotate(0deg); }
  4.5% { transform: scale(1); }
  16% { opacity: 1; transform: scale(1); }
  20%, 100% { opacity: 0; transform: scale(1); }
}
.is-in .xpl__shopA {
  animation: xplSign var(--T) ease-out infinite;
  animation-delay: calc(2 * var(--step) + 0.15s);
}
@keyframes xplSign {
  0% { opacity: 0.2; }
  2% { opacity: 1; }
  2.6% { opacity: 0.4; }
  3.4%, 100% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .is-in .xpl__sealA,
  .is-in .xpl__shopA,
  .is-in .xpl__mode { animation: none; opacity: 1; }
}
