/* D8 (pilot, behind a flag): the ambient field and the signature motion. Every rule sits under html.d8, the class the page's small
   inline loader sets when the flag is on, so no page changes without it. Script: ds/d8.js.
   1. the field's layers and its colours (site tokens only: the script reads --d8-core, --d8-glow, --d8-ember, --d8-add)
   2. arrivals: the hub cover and the chapter opener settle (transform only on anything that can be the largest paint, so the
      painting and the title are drawn in the first frame). They run only under html.d8.d8e: the loader sets d8e when this
      sheet was linked in time for the first paint, so a sheet that comes late never makes a painted cover jump
   3. the plate the browser carries from page to page (view transition d8-plate), from 900px, where the plate stands framed
   4. hub rows and part names as they are scrolled to, row hover, the pressed row
   5. reduced motion: no movement, fades only */

html.d8{--d8:1}   /* the script starts only once this sheet is in (it reads this mark) */
/* 1 ---- layers ------------------------------------------------------------------------------------------------------------- */
html.d8 .d8-field,html.d8 .d8-lamp{position:absolute;left:0;top:0;pointer-events:none;opacity:0;transition:opacity 1.4s var(--l-ease)}
html.d8 .d8-field.is-on,html.d8 .d8-lamp.is-on{opacity:1}
html.d8 .d8-field.is-born{transition-duration:.3s}                         /* a field born from the plate: the motes themselves arrive */
html.d8 .hero > .d8-field{z-index:0}                                     /* over the sky, under .hero__in (text, painting, passage card) */
html.d8 .rr-cloth > .d8-field{z-index:-1}                                /* over the cloth, under everything that stands on it */
html.d8 .d8-fx{position:fixed;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:var(--l-z-trail)}
/* colours. Night sky and cloth: pale stars with the halo colour, added as light. Day paper: gold dust, the sky's own dot and halo. */
html.d8 .d8-host,html.d8 .d8-lit{--d8-core:var(--l-star);--d8-glow:var(--l-star-halo);--d8-ember:var(--l-star-halo);--d8-add:1}
html.d8[data-theme="light"] .hero.d8-host{--d8-core:var(--l-dot);--d8-add:0}
@media (prefers-color-scheme:light){html.d8:not([data-theme="dark"]) .hero.d8-host{--d8-core:var(--l-dot);--d8-add:0}}
/* cloth is the same by day and by night: cream stars, the collection's line for the halo, lamp gold (the Ramayana's line) for sparks */
html.d8 .rr-cloth.d8-host,html.d8 .rr-cloth .d8-lit{--d8-core:var(--rr-cloth-ink);--d8-glow:var(--rr-line);--d8-ember:var(--rr-line-ramayana);--d8-add:1}
/* a row pressed on paper: sparks in the collection's ink */
html.d8 .rr-kanda li a{--d8-core:var(--l-accent);--d8-glow:var(--l-accent);--d8-ember:var(--l-accent);--d8-add:0}
html.d8[data-theme="dark"] .rr-kanda li a{--d8-add:1}
@media (prefers-color-scheme:dark){html.d8:not([data-theme="light"]) .rr-kanda li a{--d8-add:1}}

/* 2 ---- arrivals ----------------------------------------------------------------------------------------------------------- */
@keyframes d8-settle{from{transform:scale(1.045)}}
@keyframes d8-settle-in{from{transform:scale(1.07)}}
@keyframes d8-rise{from{transform:translateY(16px)}}
@keyframes d8-draw{to{stroke-dashoffset:0}}
@keyframes d8-pop{from{transform:scale(0)}}
@keyframes d8-wipe{from{clip-path:inset(-6% 104% -6% -4%)}to{clip-path:inset(-6% -4% -6% -4%)}}
@media (prefers-reduced-motion:no-preference){
  /* the cover text settles, line after line */
  html.d8.d8e:not([data-rm="1"]) .rr-cover__text > *,html.d8.d8e:not([data-rm="1"]) .rr-opener__text > *{animation:d8-rise .9s var(--l-ease-out) both}
  html.d8.d8e:not([data-rm="1"]) .rr-cover__text > :nth-child(2),html.d8.d8e:not([data-rm="1"]) .rr-opener__text > :nth-child(2){animation-delay:.04s}
  html.d8.d8e:not([data-rm="1"]) .rr-cover__text > :nth-child(3),html.d8.d8e:not([data-rm="1"]) .rr-opener__text > :nth-child(3){animation-delay:.08s}
  html.d8.d8e:not([data-rm="1"]) .rr-cover__text > :nth-child(4),html.d8.d8e:not([data-rm="1"]) .rr-opener__text > :nth-child(4){animation-delay:.12s}
  html.d8.d8e:not([data-rm="1"]) .rr-cover__text > :nth-child(n+5),html.d8.d8e:not([data-rm="1"]) .rr-opener__text > :nth-child(n+5){animation-delay:.16s}
  /* the collection's seal draws itself, then its stars light */
  html.d8.d8e:not([data-rm="1"]) .rr-cover .coll__mark .mark .seal,html.d8.d8e:not([data-rm="1"]) .rr-opener .l-kicker__coll .mark .seal{stroke-dasharray:190;stroke-dashoffset:190;animation:d8-draw .9s var(--l-ease) .12s forwards}
  html.d8.d8e:not([data-rm="1"]) .rr-cover .coll__mark .mark :is(.own,.halo){transform-box:fill-box;transform-origin:center;animation:d8-pop .5s var(--l-ease-out) .55s both}
  /* the opener's outline number is written in */
  html.d8.d8e:not([data-rm="1"]) .rr-opener__no{animation:d8-rise .9s var(--l-ease-out) .04s both,d8-wipe .95s var(--l-ease) .1s both}
}
/* phone: the painting runs edge to edge, so it settles inside its own box */
@media (max-width:899px) and (prefers-reduced-motion:no-preference){
  html.d8.d8e:not([data-rm="1"]) :is(.rr-cover__plate,.rr-opener .rr-plate--front) .mat{overflow:hidden}
  html.d8.d8e:not([data-rm="1"]) :is(.rr-cover__plate,.rr-opener .rr-plate--front) img{transform-origin:50% 30%;animation:d8-settle-in 1.8s var(--l-ease-out) both}
}
/* from 900px: the framed plate settles as a whole, and the ring behind it draws round */
@media (min-width:900px) and (prefers-reduced-motion:no-preference){
  html.d8.d8e:not([data-rm="1"]) :is(.rr-cover__plate,.rr-opener .rr-plate--front) .mat{animation:d8-settle 1.2s var(--l-ease-out) both}
  html.d8.d8e:not([data-rm="1"]) .rr-cover__field .seal{stroke-dasharray:185;stroke-dashoffset:185;animation:d8-draw 1.7s var(--l-ease) .3s forwards}
  html.d8.d8e:not([data-rm="1"]) .rr-ribbon li{animation:d8-rise .8s var(--l-ease-out) both}
  html.d8.d8e:not([data-rm="1"]) .rr-ribbon li:nth-child(2){animation-delay:.05s}
  html.d8.d8e:not([data-rm="1"]) .rr-ribbon li:nth-child(3){animation-delay:.1s}
  html.d8.d8e:not([data-rm="1"]) .rr-ribbon li:nth-child(4){animation-delay:.15s}
  html.d8.d8e:not([data-rm="1"]) .rr-ribbon li:nth-child(n+5){animation-delay:.2s}
}

/* 3 ---- the plate carried across pages ------------------------------------------------------------------------------------ */
@keyframes d8-vt-out{to{opacity:0}}
@keyframes d8-vt-in{from{opacity:0}}
@media (min-width:900px) and (prefers-reduced-motion:no-preference){
  html.d8:not([data-rm="1"]) .travel .plate--fly,
  html.d8:not([data-rm="1"]) a.hart__mat.d8-go,
  html.d8:not([data-rm="1"]) a.rr-kanda__plate.d8-go picture,
  html.d8.d8-arr:not([data-rm="1"]) .rr-cover__plate .mat,
  html.d8.d8-arr:not([data-rm="1"]) .rr-opener .rr-plate--front .mat{view-transition-name:d8-plate}
  html.d8::view-transition-group(d8-plate){animation-duration:.62s;animation-timing-function:cubic-bezier(.16,1,.3,1)}
  html.d8::view-transition-old(d8-plate),html.d8::view-transition-new(d8-plate){width:100%;height:100%;object-fit:cover;overflow:clip}
  html.d8::view-transition-old(d8-plate){animation:d8-vt-out .26s ease both}
  html.d8::view-transition-new(d8-plate){animation:d8-vt-in .3s ease both}
}

/* 4 ---- the hub's list ------------------------------------------------------------------------------------------------------ */
/* arriving as they are scrolled to: the script marks only what stands below the first screen, so nothing on screen is ever hidden */
html.d8 .d8-rv--row{opacity:0;transform:translateY(14px)}
html.d8 .d8-rv--row.d8-in{opacity:1;transform:none;transition:opacity .5s var(--l-ease) calc(var(--d8-i,0) * 45ms),transform .7s var(--l-ease-out) calc(var(--d8-i,0) * 45ms)}
html.d8 .d8-rv--name .rr-kanda__t{clip-path:inset(-8% 104% -8% -4%)}
html.d8 .d8-rv--name.d8-in .rr-kanda__t{clip-path:inset(-8% -4% -8% -4%);transition:clip-path 1.1s var(--l-ease-out) .05s}
@media (min-width:1000px){
  html.d8 .d8-rv--name .rr-kanda__t{clip-path:inset(-4% -8% 104% -8%)}
  html.d8 .d8-rv--name.d8-in .rr-kanda__t{clip-path:inset(-4% -8% -4% -8%)}
}
@media print{html.d8 .d8-rv,html.d8 .d8-rv .rr-kanda__t{opacity:1 !important;transform:none !important;clip-path:none !important}}
/* a row answers the pointer: its rule draws across in the collection's ink, its number leans in, its star lights */
html.d8 .rr-hub .rr-kanda li a{background-image:linear-gradient(var(--l-accent),var(--l-accent));background-repeat:no-repeat;background-position:0 100%;background-size:0 1px;transition:background-size .6s var(--l-ease-out)}
html.d8 .rr-hub .rr-kanda li a .n{transition:transform .4s var(--l-ease-out)}
@media (hover:hover){
  html.d8 .rr-hub .rr-kanda li a:hover{background-size:100% 1px}
  html.d8 .rr-hub .rr-kanda li a:hover .n{transform:translateX(4px)}
  html.d8 .rr-hub .rr-kanda li a:hover .stg .halo{opacity:.6}
  html.d8 .rr-hub .rr-kanda li a:hover .stg .ring{opacity:.9;stroke:var(--l-dot)}
}
html.d8 .rr-hub .rr-kanda li a.d8-press{background-size:100% 1px}
html.d8 .rr-hub .rr-kanda li a:is(.d8-press,.d8-go):not(:focus-visible){outline-color:transparent}   /* the pressed row shows its star, not the box WordPress draws on any focus; a keyboard focus keeps its ring */
html.d8 .rr-hub .rr-kanda li a.d8-press .stg .halo{opacity:.85}
html.d8 .rr-hub .rr-kanda li a.d8-press .stg .core{transform:scale(1.5);fill:var(--l-star)}
/* a part's painting drifts a little inside its frame as the page moves past it (where the browser links animation to scroll) */
@keyframes d8-drift{from{translate:0 -2.4%}to{translate:0 2.4%}}
@supports (animation-timeline:view()){
  @media (prefers-reduced-motion:no-preference){
    html.d8:not([data-rm="1"]) .rr-hub .rr-kanda__plate img{scale:1.06;animation:d8-drift linear both;animation-timeline:view();animation-range:entry 0% exit 100%}
  }
}

/* 5 ---- reduced motion: nothing moves; the field is one still frame (script); pages and rows change by a fade ---------------- */
@media (prefers-reduced-motion:reduce){
  html.d8 .d8-field,html.d8 .d8-lamp{transition:none}
  html.d8 .d8-rv--row{transform:none}
  html.d8 .d8-rv--row.d8-in{transition:opacity .35s ease !important;transition-duration:.35s !important}
  html.d8 .d8-rv--name .rr-kanda__t,html.d8 .d8-rv--name.d8-in .rr-kanda__t{clip-path:none;transition:none}
  html.d8 .d8-rv--name{opacity:0}
  html.d8 .d8-rv--name.d8-in{opacity:1;transition:opacity .35s ease !important;transition-duration:.35s !important}
  html.d8 .rr-hub .rr-kanda li a,html.d8 .rr-hub .rr-kanda li a .n{transition:none}
  html.d8 .rr-hub .rr-kanda li a:hover .n{transform:none}
  html.d8:root::view-transition-old(root){animation:d8-vt-out .2s ease both !important;animation-duration:.2s !important}
  html.d8:root::view-transition-new(root){animation:d8-vt-in .24s ease both !important;animation-duration:.24s !important}
}
html.d8[data-rm="1"] .d8-field,html.d8[data-rm="1"] .d8-lamp{transition:none}
html.d8[data-rm="1"] .d8-rv--row{transform:none}
html.d8[data-rm="1"] .d8-rv--row.d8-in{transition:opacity .35s ease !important;transition-duration:.35s !important}
html.d8[data-rm="1"] .d8-rv--name .rr-kanda__t,html.d8[data-rm="1"] .d8-rv--name.d8-in .rr-kanda__t{clip-path:none;transition:none}
html.d8[data-rm="1"] .d8-rv--name{opacity:0}
html.d8[data-rm="1"] .d8-rv--name.d8-in{opacity:1;transition:opacity .35s ease !important;transition-duration:.35s !important}
html.d8[data-rm="1"] .rr-hub .rr-kanda li a,html.d8[data-rm="1"] .rr-hub .rr-kanda li a .n{transition:none}
html.d8[data-rm="1"]:root::view-transition-old(root){animation:d8-vt-out .2s ease both !important;animation-duration:.2s !important}
html.d8[data-rm="1"]:root::view-transition-new(root){animation:d8-vt-in .24s ease both !important;animation-duration:.24s !important}
