/* =======================================================================
   The mark, moving.

   Every stroke in the mark carries pathLength="1", so one set of dash rules
   drives a 1315-unit diamond and a 240-unit letter on the same clock. The
   mark takes currentColor, so it is gold on navy and deep gold on paper
   without a second file.

   Three states, and nothing runs that nobody is looking at:
     rest    the star turns once every 40s and a thread of light walks the
             outer diamond every 9s. Slow enough to be felt, not watched.
     hover   both diamonds counter-rotate, the star blooms, the light runs.
     draw    used once, by the curtain, and by the masthead when it arrives.

   prefers-reduced-motion stops all of it: the mark is then simply the mark.
   ======================================================================= */

.vmk{display:block;overflow:visible;color:var(--gold)}
.vmk-ring,.vmk-s,.vmk-o,.vmk-i{transform-box:view-box;transform-origin:279.5px 260px}

/* ------------------------------------------------------------ at rest */
.vmk-s{animation:vmkTurn 40s linear infinite}
.vmk-o{stroke-dasharray:.14 .86;stroke-dashoffset:1;
  animation:vmkRun 9s cubic-bezier(.65,0,.35,1) infinite}
/* the thread of light is a second copy of the edge; the edge itself stays
   whole underneath, so the diamond never looks broken mid-cycle */
.vmk .vmk-o{paint-order:stroke}

@keyframes vmkTurn{to{transform:rotate(360deg)}}
@keyframes vmkRun{
  0%   {stroke-dashoffset:1;   opacity:0}
  6%   {opacity:1}
  55%  {stroke-dashoffset:0;   opacity:1}
  70%  {stroke-dashoffset:-.3; opacity:0}
  100% {stroke-dashoffset:-.3; opacity:0}
}

/* the whole-edge diamond that sits under the travelling light */
.vmk-base{transform-box:view-box;transform-origin:279.5px 260px}

/* -------------------------------------------------------------- awake */
.vmk-live .vmk-ring{animation:vmkBreathe 7s ease-in-out infinite}
@keyframes vmkBreathe{0%,100%{transform:scale(1)}50%{transform:scale(1.028)}}

/* --------------------------------------------------------- under hand */
.vmk-hot .vmk-o,.vmk-hot .vmk-base{animation:vmkSpinA 5.5s linear infinite}
.vmk-hot .vmk-i{animation:vmkSpinB 5.5s linear infinite}
.vmk-hot .vmk-s{animation:vmkTurn 2.4s linear infinite,vmkBloom 1.6s ease-in-out infinite}
@keyframes vmkSpinA{to{transform:rotate(45deg)}}
@keyframes vmkSpinB{to{transform:rotate(-45deg)}}
@keyframes vmkBloom{0%,100%{scale:1}50%{scale:1.22}}

/* ------------------------------------------------------- drawing itself */
.vmk-draw .vmk-o,.vmk-draw .vmk-i,.vmk-draw .vmk-base{
  stroke-dasharray:1;stroke-dashoffset:1;animation:vmkDraw .72s cubic-bezier(.4,0,.2,1) forwards}
.vmk-draw .vmk-i{animation-delay:.16s;animation-duration:.66s;animation-direction:reverse;
  stroke-dashoffset:0}
.vmk-draw .vmk-s{opacity:0;transform:scale(.2) rotate(-120deg);
  animation:vmkPop .62s cubic-bezier(.2,1.5,.3,1) .46s forwards}
.vmk-draw .vmk-w path{stroke-dasharray:1;stroke-dashoffset:1;
  animation:vmkDraw .5s cubic-bezier(.4,0,.2,1) forwards;
  animation-delay:calc(.74s + var(--n) * .085s)}
@keyframes vmkDraw{to{stroke-dashoffset:0}}
@keyframes vmkPop{to{opacity:1;transform:none}}

/* the inner diamond draws the other way round, which reads as one line
   folding back on itself rather than two lines racing */
.vmk-draw .vmk-i{stroke-dasharray:1}

@media (prefers-reduced-motion:reduce){
  .vmk *,.vmk{animation:none!important;transform:none!important;
    stroke-dashoffset:0!important;stroke-dasharray:none!important;opacity:1!important;scale:1!important}
}

/* ===================================================================== the curtain */
.vcur{position:fixed;inset:0;z-index:200;display:grid;place-items:center;
  background:var(--bg);opacity:1}
.vcur-in{display:flex;flex-direction:column;align-items:center;gap:26px;
  width:min(252px,56vw)}
.vcur .vmk{width:100%;height:auto;color:var(--gold)}
.vcur-sub{font-size:var(--lbl);letter-spacing:.24em;text-transform:uppercase;
  white-space:nowrap;color:var(--muted);opacity:0;
  animation:vcurSub .5s ease 1.12s forwards}
@keyframes vcurSub{to{opacity:1}}
/* out: the lockup lifts a little and the sheet goes, which reads as the page
   arriving rather than a loader disappearing */
.vcur-out{animation:vcurOut .6s cubic-bezier(.4,0,.2,1) forwards}
.vcur-out .vcur-in{animation:vcurLift .6s cubic-bezier(.4,0,.2,1) forwards}
@keyframes vcurOut{to{opacity:0;visibility:hidden}}
@keyframes vcurLift{to{transform:translateY(-14px) scale(1.04)}}
.vcur-cut{animation:vcurOut .16s linear forwards}
.vcur-cut .vcur-in{animation:none}
/* the page does not scroll behind the curtain, and gets its scroll back the
   instant the curtain is dismissed — including by the hard ceiling */
html.vcur-on,html.vcur-on body{overflow:hidden}

/* ======================================================= the mark in the bar */
.nav .home .vmk{width:26px;height:26px;color:var(--gold)}
.nav .home:hover .vmk,.nav .home:focus-visible .vmk{color:var(--gold)}

/* ================================================= the mark on the masthead */
.vmast{display:flex;justify-content:center;margin:0 0 6px}
.vmast .vmk{width:clamp(74px,13vw,104px);height:auto}
@media (max-width:560px){ .vmast .vmk{width:68px} }
.nav .home .mkwrap{display:block;flex:none;line-height:0}
.nav .home .mkwrap .vmk{width:26px;height:26px}

/* The signature canvas draws the mechanism of each chapter's own film, which
   is why it earns its 132px on a chapter page. On the front page it was a
   generic constellation, and now that the brand mark sits directly under it
   the masthead carries two abstract gold graphics stacked on each other.
   The mark is the one that means something here. */
body.home .sig{display:none}

/* what the streak has banked, and what it has earned */
.youstreak{margin:10px 0 0;font-size:.8rem;line-height:1.55;color:var(--muted)}

/* ===================================================== what a streak is for
   This used to be a line inside the chapter panel, which is display:none
   below 1180px — so on every phone the one place explaining the reward did
   not exist. It is a strip in the page now, at every width, and it says the
   same thing whether the reader is on a laptop or a bus. */
.vstreak{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 14px;
  margin:var(--s3) auto 0;max-width:var(--read);width:100%;
  padding:12px 16px;background:var(--raise);box-shadow:var(--lip);
  border-inline-start:2px solid var(--gold-dim);
  font-size:.86rem;line-height:1.5;color:var(--muted)}
.vstreak b{font-family:var(--display);font-weight:400;font-size:1.15rem;
  color:var(--gold);letter-spacing:.01em;flex:none}
.vstreak .vgo{flex:none;margin-inline-start:auto;font-size:var(--lbl);
  letter-spacing:.16em;text-transform:uppercase;color:var(--gold);
  text-decoration:none;border-bottom:1px solid var(--gold-dim);padding-bottom:2px}
.vstreak .vgo:hover{border-bottom-color:var(--gold)}
/* the day it lands, it should look like something happened */
.vstreak.won{border-inline-start-color:var(--gold);
  background:linear-gradient(90deg,color-mix(in srgb,var(--gold) 9%,transparent),var(--raise) 60%)}
@media (max-width:560px){
  .vstreak{padding:11px 13px;font-size:.82rem}
  .vstreak .vgo{margin-inline-start:0}
}
/* on a page that is a grid, it still has to claim its row */
@media (min-width:1000px){
  .wrap:has(> .grid) > .vstreak{grid-column:1/-1;grid-row:2}
}
