/* =============================================================
   LOGO FIELD — background wallpaper behind Properties → Highlights.

   A dense, staggered field of the Sola Gratia star "SG" mark on the page
   background. At rest every mark is a slightly darker tone of the page
   (#f6f1e8). Near the pointer the marks light up brownish gold, brightest
   closest to it, then die down slowly. The whole field drifts slowly and
   bounces off the edges of its travel box, like the DVD logo
   (components/Properties_Section/logo-field.js).

   Structure (all created by logo-field.js, all at z-index:-1: above the
   page colour, behind every section):
     .logo-field-clip   clips to the Properties → Highlights span
       .logo-field-mover   translated as one piece (the drift)
         .logo-field       the resting marks: a CSS mask tile
         .logo-field-lit   the lit marks (.lf-lit, one per lit mark)

   One number drives the metrics: --lf-gx, the tile width in px. The tile
   (assets/images/sg-star-tile.png) is gx wide and gx*4/3 tall: two
   staggered rows; the mark is 28/54 of gx wide.
   ============================================================= */

.logo-field-clip{
    --lf-gx:54px;

    --lf-rest:#ebe2d2;                       /* darker tone of the #f6f1e8 page (--sg-paper) */
    --lf-lit:#b88a44;                        /* brownish gold (--sg-gold) */
    --lf-glow:rgba(184,138,68,.5);

    /* How long a lit mark takes to die down. */
    --lf-fade:1800ms;

    position:absolute;
    left:0;
    width:100%;
    top:0;
    height:0;
    z-index:-1;
    overflow:hidden;
    pointer-events:none;
}

.logo-field-clip[hidden]{
    display:none;
}

.logo-field-mover{
    position:absolute;
    will-change:transform;
}

.logo-field,
.logo-field-lit{
    position:absolute;
    inset:0;
}

.logo-field{
    background-color:var(--lf-rest);

    -webkit-mask-image:url('../../assets/images/sg-star-tile.png');
    mask-image:url('../../assets/images/sg-star-tile.png');
    -webkit-mask-size:var(--lf-gx) calc(var(--lf-gx) * 4 / 3);
    mask-size:var(--lf-gx) calc(var(--lf-gx) * 4 / 3);
    -webkit-mask-repeat:repeat;
    mask-repeat:repeat;
    -webkit-mask-position:0 0;
    mask-position:0 0;
}

/* The wrapper takes the glow (a filter would be cut by the child's mask);
   the <i> inside is the gold silhouette. Opacity and its transition time
   are set per mark by logo-field.js (brightness by distance; quick up,
   --lf-fade down). */
.lf-lit{
    position:absolute;
    opacity:0;
    filter:drop-shadow(0 0 5px var(--lf-glow));
    transition:opacity .1s linear;
}

.lf-lit i{
    display:block;
    width:100%;
    height:100%;
    background-color:var(--lf-lit);
    -webkit-mask:url('../../assets/images/sg-star.png') center / 100% 100% no-repeat;
    mask:url('../../assets/images/sg-star.png') center / 100% 100% no-repeat;
}

/* Smaller marks on smaller screens: same pattern, tighter tile. */
@media screen and (max-width:768px){
    .logo-field-clip{ --lf-gx:44px; }
}

@media screen and (max-width:480px){
    .logo-field-clip{ --lf-gx:38px; }
}
