/* fx layer, titles: a shelf's arrival when it first scrolls into view (fx/BRIEF.md 4.3).
   fx/titles.js builds, per shelf: the title's rule (a staying kit slash, .fx-titles-rule), the nameplate beside the
   glyph disc (.fx-titles-plate), and wraps the title text (.fx-titles-tx) so it can be wiped in behind the slash.
   The arrival itself is played with Web Animations from fx/titles.js, so nothing here hides content: the hidden
   start states exist only while an animation is running, and only when the script found no reduced-motion setting.
   The cards' transition list is left to style.css and motion.css (pointer tilt) untouched.
   --fx-titles-css tells fx/titles.js that this file loaded; without it the script builds nothing. */
:root{--fx-titles-css:1}

/* ---------- the title: room for its rule under it ---------- */
.shelf-head h2{position:relative;display:inline-block;padding-bottom:6px}
.fx-titles-tx{position:relative;display:inline-block}
/* the host of the staying slash: wider than the title, deep enough for the stroke's flames, crests and forks.
   The line itself sits 28px above the host's bottom edge (2px above the bottom of the heading box). */
.fx-titles-rule{position:absolute;left:-3%;width:106%;bottom:-26px;height:66px;pointer-events:none}

/* ---------- the nameplate: a narrow vertical slip tucked behind the glyph disc ---------- */
.fx-titles-plate{position:absolute;left:0;top:0;z-index:0;pointer-events:none;user-select:none;
  writing-mode:vertical-rl;font-family:var(--serif);font-weight:800;font-size:14px;line-height:1;letter-spacing:.12em;
  padding:9px 5px 7px;border-radius:2px;color:var(--ink);background:var(--card);
  border:2px solid var(--fx-titles-edge,var(--ink));border-top-width:6px;border-top-color:var(--fx-titles-tone,var(--verm));
  box-shadow:2px 3px 0 color-mix(in srgb,var(--ink) 16%,transparent);transform:rotate(-4deg);transform-origin:50% 100%;
  transition:background .9s var(--ease)}
.fx-titles-plate b{font-weight:800;font-size:.72em;display:inline-block;margin:.1em 0}
.shelf-head .glyph{z-index:1}

/* tone of each shelf, and the colours of the cut line (the element's body with a bright core) */
.shelf{--fx-titles-tone:var(--verm)}
.shelf[data-tone="indigo"]{--fx-titles-tone:var(--indigo)}
.shelf[data-tone="gold"]{--fx-titles-tone:var(--gold)}
.shelf[data-tone="moss"]{--fx-titles-tone:var(--moss)}
.shelf[data-fx="flame"]{--fx-titles-c:var(--fx-flame-outer,#d1432a);--fx-titles-k:var(--fx-flame-core,#ffd650);--fx-titles-l:var(--fx-flame-line,#4a170c)}
.shelf[data-fx="water"]{--fx-titles-c:var(--fx-water-body,#2c4a80);--fx-titles-k:var(--fx-water-foam,#fbf7ee);--fx-titles-l:var(--fx-water-line,#141b2e)}
.shelf[data-fx="thunder"]{--fx-titles-c:var(--fx-thunder-body,#f6c21c);--fx-titles-k:var(--fx-thunder-core,#fffbea);--fx-titles-l:var(--fx-thunder-line,#2b2018)}
.shelf[data-fx="wind"]{--fx-titles-c:var(--fx-wind-leaf,#6f8c45);--fx-titles-k:var(--fx-wind-streak,#d7e9d3);--fx-titles-l:var(--fx-wind-line,#45602f)}
.shelf[data-fx="ink"]{--fx-titles-c:var(--fx-ink-body,var(--ink));--fx-titles-k:var(--paper);--fx-titles-l:var(--fx-ink-body,var(--ink))}

/* ---------- a card's cut line (only during its cut; fx/titles.js adds and removes it) ---------- */
.fx-titles-cut{position:absolute;left:0;right:0;top:-16px;bottom:-6px;z-index:5;pointer-events:none}
.fx-titles-cut i{position:absolute;inset:0;opacity:0;clip-path:inset(50%)}
.fx-titles-cut0{background:var(--fx-titles-l)}
.fx-titles-cut1{background:var(--fx-titles-c)}
.fx-titles-cut2{background:var(--fx-titles-k)}

/* ---------- resting accents: traditional patterns in the shelf's tone (images set by fx/titles.js) ---------- */
.fx-titles-pat .shelf .card::before{background-image:var(--fx-titles-tape,none);background-size:14px auto}
.fx-titles-pat .shelf-head .glyph::after{inset:-8px;border:0;background:var(--fx-titles-ring,none) center/10px auto;
  -webkit-mask:radial-gradient(closest-side,transparent calc(100% - 6.5px),#000 calc(100% - 6px),#000 calc(100% - .5px),transparent 100%);
          mask:radial-gradient(closest-side,transparent calc(100% - 6.5px),#000 calc(100% - 6px),#000 calc(100% - .5px),transparent 100%)}

/* ---------- the shelf itself shows quickly, so the strike is not played through a slow fade ---------- */
@media (prefers-reduced-motion:no-preference){
  .fx-titles-on .shelf.rv{transition:opacity calc(.18s * var(--fx-slow,1)) linear,transform calc(.5s * var(--fx-slow,1)) var(--ease)}
}
