/* Washi Lantern Studios mockup: second layer of motion and polish.
   Everything here is decoration. The page works without this file. */

/* The opening doors live in fx/doors.css; the shelf arrival (title underline, glyph disc, cards)
   lives in fx/titles.css. */

/* ---------- layers inside a shelf (fx/BRIEF.md section 8) ----------
   The shelf is the host for the fx overlays: back fx layer 0, the track 1, front fx layer 2, the shelf header 3.
   Nothing here changes how a shelf looks: the track clips its own cards (tape strips included), so nothing in it
   reaches the header. */
.shelf{position:relative}
.shelf>.track{position:relative;z-index:1}
.shelf-head{position:relative;z-index:3}

/* the nav seal presses in like a stamp (fx/doors.css also uses this keyframe) */
@keyframes stamp{0%{opacity:0;transform:rotate(-14deg) scale(2.1)}60%{opacity:1;transform:rotate(-3deg) scale(.92)}100%{opacity:1;transform:rotate(-4deg) scale(1)}}
.nav .seal{animation:stamp .6s .25s cubic-bezier(.2,1.4,.4,1) both}

/* ---------- scroll progress thread ---------- */
.progress{position:fixed;left:0;top:0;height:3px;width:100%;z-index:30;transform-origin:0 50%;transform:scaleX(var(--sp,0));background:linear-gradient(90deg,var(--verm),var(--gold));pointer-events:none}

/* ---------- current section in the nav ---------- */
.nav ul a[aria-current="true"]{color:var(--ink)}
.nav ul a[aria-current="true"]::after{transform:scaleX(1)}

/* ---------- light spreading from the lantern when the theme changes ---------- */
html.vt, html.vt *{transition:none!important}
::view-transition-old(root){animation:none;z-index:1}
::view-transition-new(root){animation:spread .95s cubic-bezier(.3,.1,.2,1);z-index:2}
@keyframes spread{from{clip-path:circle(0 at var(--vx,50%) var(--vy,30%))}to{clip-path:circle(160vmax at var(--vx,50%) var(--vy,30%))}}
.lantern.kick{animation:kick 1.9s ease-out, sway 7s 1.9s ease-in-out infinite}
@keyframes kick{0%{transform:rotate(-2.4deg)}14%{transform:rotate(9deg)}32%{transform:rotate(-7deg)}50%{transform:rotate(5deg)}68%{transform:rotate(-3.6deg)}84%{transform:rotate(2.8deg)}100%{transform:rotate(-2.4deg)}}

/* ---------- a breeze: scrolling pushes the hanging things ---------- */
.lantern{rotate:calc(var(--gust,0) * .55deg);transition:rotate 1.1s cubic-bezier(.2,1.5,.4,1)}
/* a gust can swing a hanging thing a pixel or two past the edge of a phone screen; the viewport hides that anyway,
   so clip it at main's edges (the full width of the page) and it no longer widens the page. clip, unlike hidden,
   makes no scroll container and leaves the vertical overflow alone. */
main{overflow-x:clip}

/* ---------- cards tilt toward the pointer and catch the light ---------- */
/* ".shelf .card.tilting", not ".card.tilting": the arrival rule ".shelf .card" (fx/titles.css) loads later with the
   same specificity, and the tilt's quick transition must keep winning over it. */
.shelf .card.tilting{transform:perspective(900px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) translateY(-8px);transition:transform .12s linear,box-shadow .5s}
.card:not(.note)::after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;opacity:0;transition:opacity .4s;
  background:radial-gradient(260px circle at var(--mx,50%) var(--my,0%),rgba(255,250,235,.55),transparent 62%);mix-blend-mode:soft-light}
:root[data-theme="night"] .card:not(.note)::after{background:radial-gradient(260px circle at var(--mx,50%) var(--my,0%),rgba(255,190,110,.5),transparent 62%)}
.card.tilting::after{opacity:1}

/* ---------- gameplay clip on a card ---------- */
.card figure{position:relative}
.card figure video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity .5s}
.card figure.playing video{opacity:1}
.card figure .play{position:absolute;right:10px;bottom:10px;display:inline-flex;align-items:center;gap:6px;padding:5px 11px 5px 9px;border-radius:999px;font-size:12px;font-weight:700;letter-spacing:.04em;
  background:rgba(20,16,12,.72);color:#fff3dc;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);transition:opacity .3s}
.card figure .play::before{content:"";border-left:8px solid currentColor;border-top:5px solid transparent;border-bottom:5px solid transparent}
.card figure.playing .play{opacity:0}

/* ---------- wave band above the footer ---------- */
.waves{height:84px;margin-top:10px;background:var(--indigo);opacity:.2;
  -webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='28' viewBox='0 0 56 28'><g fill='none' stroke='black' stroke-width='1.6'><circle cx='28' cy='28' r='26'/><circle cx='28' cy='28' r='19'/><circle cx='28' cy='28' r='12'/><circle cx='28' cy='28' r='5'/><circle cx='0' cy='14' r='26'/><circle cx='0' cy='14' r='19'/><circle cx='0' cy='14' r='12'/><circle cx='0' cy='14' r='5'/><circle cx='56' cy='14' r='26'/><circle cx='56' cy='14' r='19'/><circle cx='56' cy='14' r='12'/><circle cx='56' cy='14' r='5'/></g></svg>") 0 0/56px 28px repeat,
           linear-gradient(#000,#000);
  mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='28' viewBox='0 0 56 28'><g fill='none' stroke='black' stroke-width='1.6'><circle cx='28' cy='28' r='26'/><circle cx='28' cy='28' r='19'/><circle cx='28' cy='28' r='12'/><circle cx='28' cy='28' r='5'/><circle cx='0' cy='14' r='26'/><circle cx='0' cy='14' r='19'/><circle cx='0' cy='14' r='12'/><circle cx='0' cy='14' r='5'/><circle cx='56' cy='14' r='26'/><circle cx='56' cy='14' r='19'/><circle cx='56' cy='14' r='12'/><circle cx='56' cy='14' r='5'/></g></svg>") 0 0/56px 28px repeat,
       linear-gradient(to bottom,transparent,#000 55%);
  -webkit-mask-composite:source-in;mask-composite:intersect;
  animation:tide 14s linear infinite}
:root[data-theme="night"] .waves{opacity:.28}
@keyframes tide{to{-webkit-mask-position:56px 0,0 0;mask-position:56px 0,0 0}}
footer{border-top:0}

/* ---------- drawn cards: sakura petals and the pixel mascot ---------- */
.art{aspect-ratio:3/2;border-radius:3px;position:relative;overflow:hidden;background:#1d2130;color:#f3e9d6}
.art .prompt{position:absolute;left:8%;right:8%;bottom:14%;height:15%;border-radius:8px;border:1.5px solid rgba(243,233,214,.28);background:rgba(243,233,214,.06)}
.art .prompt::before{content:"";position:absolute;left:5%;top:50%;width:2px;height:52%;transform:translateY(-50%);background:#ffb85a;animation:caret 1.1s steps(1) infinite}
@keyframes caret{50%{opacity:0}}
.art.petals .bar{position:absolute;left:8%;right:8%;top:22%;height:7px;border-radius:9px;background:rgba(243,233,214,.14);overflow:hidden}
.art.petals .bar b{position:absolute;inset:0;border-radius:9px;background:linear-gradient(90deg,#e8694c,#ffb85a);transform-origin:0 50%;animation:fill 7s ease-in-out infinite}
@keyframes fill{0%{transform:scaleX(.08)}70%,100%{transform:scaleX(.82)}}
.art.petals .wind{position:absolute;left:8%;width:68%;top:30%;height:38%}
.art.petals .wind i{position:absolute;left:0;top:var(--y);width:11px;height:8px;border-radius:80% 10% 80% 10%;background:#f6b8c8;box-shadow:inset -2px -1px 0 rgba(233,120,150,.55);scale:var(--s);opacity:0;animation:blow var(--t) var(--d) linear infinite}
@keyframes blow{0%{transform:translateX(0) translateY(0) rotate(0deg);opacity:0}10%{opacity:1}50%{transform:translateX(120px) translateY(-9px) rotate(200deg)}90%{opacity:.9}100%{transform:translateX(250px) translateY(6px) rotate(420deg);opacity:0}}
/* the seven characters stand in one spot and take turns, two seconds each (--i is a character's place in the line) */
.art.mascot svg{position:absolute;left:50%;bottom:31%;width:26%;margin-left:-13%;overflow:visible;opacity:0;animation:castshow 14s steps(1) infinite;animation-delay:calc(var(--i) * 2s - 14s);filter:drop-shadow(0 5px 0 rgba(0,0,0,.25))}
@keyframes castshow{0%{opacity:1}14.2857%,100%{opacity:0}}

/* ---------- a looping decoration that is off screen rests (site.js sets .offscreen; it carries on where it was) ---------- */
.offscreen,.offscreen *{animation-play-state:paused!important}

/* ---------- reduced motion: everything above stands still ---------- */
@media (prefers-reduced-motion:reduce){
  .lantern,.lt{rotate:0deg}
  .shelf .card.tilting{transform:none}
  .art.mascot svg{animation:none}
  .art.mascot svg:first-of-type{opacity:1}
  ::view-transition-new(root),::view-transition-old(root){animation:none}
  .art.petals .wind i{opacity:.9;transform:translateX(calc(var(--s) * 110px))}
}
