/* Die Buchgrafik erscheint nur bei aussergewöhnlich langen Ladezeiten. */
:root{--lx-ladefilm-verzoegerung:20s}

/* Startbühne bei weiterhin leerem Wurzelcontainer. */
.boot.lx-boot{
  position:fixed;inset:0;z-index:30;display:grid;place-items:center;align-content:center;gap:0;min-height:100vh;
  background:var(--canvas,#f5f4fa);
  color:var(--muted,#62627a);font-family:var(--font-ui,'Source Sans 3',system-ui,sans-serif);overflow:hidden;
  visibility:hidden;opacity:0;pointer-events:none;
  animation:lx-boot-in .25s cubic-bezier(.22,1,.36,1) var(--lx-ladefilm-verzoegerung) forwards
}
@keyframes lx-boot-in{from{opacity:0;visibility:visible}to{opacity:1;visibility:visible}}
@keyframes lx-boot-reveal{to{opacity:1;visibility:visible}}
/* Sobald der sichere Seitenrahmen steht, verschwindet die Startbühne sofort; die Zielseite zeigt
 * dann denselben Film selbst, solange sie ihre Inhalte lädt. */
:is(#navigator-root,#root,#werkbank-root):not(:empty)~.boot.lx-boot{display:none;animation:none}
:is(.lx-boot,.lx-wait) :is(.lx-boot-sr,.lx-wait-sr){position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.lx-boot .lx-boot-text{margin:12px 0 0;font-size:13.5px;letter-spacing:.01em;text-align:center;color:var(--muted,#62627a)}

/* Die Zielseite bleibt während der Wartezeit bedienbar. */
.lx-wait{display:grid;justify-items:center;gap:12px;padding:32px 0 24px;pointer-events:none;
  visibility:hidden;opacity:0;
  animation:lx-boot-in .25s cubic-bezier(.22,1,.36,1) var(--lx-ladefilm-verzoegerung) forwards}
.lx-wait .lx-wait-text{margin:0;font-size:13px;letter-spacing:.01em;color:var(--muted,#62627a)}

/* Bühne */
.lx-film{--f-out:cubic-bezier(.22,1,.36,1);--f-io:cubic-bezier(.65,0,.35,1);--f-loop:2.4s;
  position:relative;width:176px;height:100px;flex:none;border-radius:16px;overflow:hidden;isolation:isolate;perspective:420px;
  background:linear-gradient(155deg,#1f1850 0%,#2f2670 38%,#46399a 72%,#5a4bb0 100%);
  box-shadow:0 16px 34px -20px rgb(47 38 112/70%),inset 0 1px 0 rgb(255 255 255/14%)}
.lx-film *{box-sizing:border-box}
.lx-film::after{content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;
  background:radial-gradient(120% 95% at 50% 40%,transparent 55%,rgb(12 8 40/40%))}
.lx-film-sky{position:absolute;inset:0;z-index:-1}
.lx-film-sky::before{content:'';position:absolute;inset:-30%;
  background:radial-gradient(40% 45% at 22% 20%,rgb(148 128 255/50%),transparent 70%),radial-gradient(40% 45% at 82% 88%,rgb(236 140 220/30%),transparent 70%);
  animation:lx-film-drift 9s var(--f-io) infinite alternate}
/* Punktfeld fliesst langsam seitwärts, unten dichter und heller. */
.lx-film-sky::after{content:'';position:absolute;left:0;right:0;bottom:0;height:58%;
  background-image:radial-gradient(circle,rgb(230 224 255/60%) .75px,transparent 1.15px);background-size:8px 6px;
  -webkit-mask-image:linear-gradient(to top,#000 10%,transparent);mask-image:linear-gradient(to top,#000 10%,transparent);
  animation:lx-film-flow 5s linear infinite}
@keyframes lx-film-drift{to{transform:translate(-14px,8px) scale(1.12)}}
@keyframes lx-film-flow{to{background-position:-48px 0}}

/* Lichthof hinter dem Buch, Glaskarten des Bestands */
.lx-film-halo{position:absolute;left:28px;top:4px;width:120px;height:92px;border-radius:50%;
  background:radial-gradient(closest-side,rgb(214 204 255/55%),rgb(196 182 255/0));animation:lx-film-pulse var(--f-loop) var(--f-io) infinite}
@keyframes lx-film-pulse{0%,100%{opacity:.55;transform:scale(.94)}50%{opacity:1;transform:scale(1.06)}}
.lx-film-g{position:absolute;width:26px;height:36px;border-radius:5px;background:rgb(255 255 255/9%);
  border:1px solid rgb(255 255 255/22%);box-shadow:inset 0 1px 0 rgb(255 255 255/28%)}
.lx-film-g::before,.lx-film-g::after{content:'';position:absolute;left:5px;height:2.5px;border-radius:2px;background:rgb(255 255 255/34%)}
.lx-film-g::before{top:7px;width:12px}.lx-film-g::after{top:13px;width:9px}
.lx-film-g.g0{left:9px;top:14px;animation:lx-film-float-a 4.6s var(--f-io) infinite alternate}
.lx-film-g.g1{right:9px;top:46px;animation:lx-film-float-b 5.4s var(--f-io) -1.8s infinite alternate}
@keyframes lx-film-float-a{from{transform:translateY(0) rotate(-6deg)}to{transform:translateY(-6px) rotate(-2deg)}}
@keyframes lx-film-float-b{from{transform:translateY(0) rotate(5deg)}to{transform:translateY(5px) rotate(8deg)}}

/* Buch: wiegt sich leise im Raum; Seiten, Blätter und Deckel drehen am Falz. */
.lx-film-book{position:absolute;left:44px;top:22px;width:88px;height:56px;transform-style:preserve-3d;
  animation:lx-film-sway 4.8s var(--f-io) infinite alternate}
@keyframes lx-film-sway{from{transform:translateY(0) rotateX(14deg) rotateY(-7deg)}to{transform:translateY(-3px) rotateX(10deg) rotateY(7deg)}}
.lx-film-page,.lx-film-leaf,.lx-film-cover{position:absolute;top:0;height:56px}
.lx-film-page{width:44px;background:#fff;box-shadow:0 12px 20px -10px rgb(8 4 36/70%)}
.lx-film-page.l{left:0;border-radius:6px 1px 1px 6px;background:linear-gradient(90deg,#fff 68%,#e9e4fa)}
.lx-film-page.r{left:44px;border-radius:1px 6px 6px 1px;background:linear-gradient(90deg,#e9e4fa,#fff 32%);overflow:hidden}
:is(.lx-film-page,.lx-film-leaf)>b{position:absolute;left:8px;height:3px;border-radius:2px;background:#e4def6}
:is(.lx-film-page,.lx-film-leaf)>b:nth-of-type(1){top:10px;width:24px;background:#b9aee0}
:is(.lx-film-page,.lx-film-leaf)>b:nth-of-type(2){top:18px;width:28px}
:is(.lx-film-page,.lx-film-leaf)>b:nth-of-type(3){top:26px;width:22px}
:is(.lx-film-page,.lx-film-leaf)>b:nth-of-type(4){top:34px;width:26px}
.lx-film-page.l>b{left:9px}
/* Leselicht: geht Zeile um Zeile über die rechte Seite, die gelesene Zeile leuchtet auf. */
.lx-film-page.r>u{position:absolute;left:4px;right:4px;top:8px;height:7px;border-radius:2px;text-decoration:none;opacity:0;
  background:linear-gradient(to top,rgb(110 92 210/24%),transparent);animation:lx-film-read var(--f-loop) var(--f-io) 1s infinite}
.lx-film-page.r>u::after{content:'';position:absolute;left:0;right:0;bottom:0;height:1.5px;border-radius:1px;background:#7d6bd6;
  box-shadow:0 0 6px 1px rgb(129 112 214/70%)}
@keyframes lx-film-read{0%{opacity:0;transform:translateY(0)}10%{opacity:1}78%{opacity:1;transform:translateY(26px)}90%,100%{opacity:0;transform:translateY(28px)}}
.lx-film-page.r>b{animation:lx-film-lit var(--f-loop) linear 1s infinite}
.lx-film-page.r>b:nth-of-type(2){animation-delay:1.55s}.lx-film-page.r>b:nth-of-type(3){animation-delay:2.1s}.lx-film-page.r>b:nth-of-type(4){animation-delay:2.65s}
@keyframes lx-film-lit{0%,100%{background:#e4def6}8%,30%{background:#a99be6}}
.lx-film-page.r>b:nth-of-type(1){animation-name:lx-film-lit-first}
@keyframes lx-film-lit-first{0%,100%{background:#b9aee0}8%,30%{background:#7d6bd6}}
/* Blätter: drei Seiten mit eigenen, verschieden langen Takten – mal ruhig in einem Zug, mal zögernd,
 * mal rascher. Weil die Takte nicht aufgehen, wiederholt sich der Rhythmus kaum. */
.lx-film-leaf{left:44px;top:.5px;width:43px;height:55px;border-radius:1px 5px 5px 1px;transform-origin:0 50%;opacity:0;
  background:linear-gradient(90deg,#efeafd,#fff 38%);box-shadow:0 0 0 .5px rgb(81 67 148/14%)}
.lx-film-leaf>b{opacity:.75}
.lx-film-leaf.a{animation:lx-film-flip-a 4.4s linear 1s infinite}
.lx-film-leaf.b{animation:lx-film-flip-b 6.2s linear 2.6s infinite}
.lx-film-leaf.c{animation:lx-film-flip-c 7.6s linear 4.4s infinite}
/* a: ruhig in einem Zug (etwa 1,6 s) */
@keyframes lx-film-flip-a{0%{opacity:0;transform:rotateY(0);animation-timing-function:cubic-bezier(.4,0,.3,1)}5%{opacity:1}
  20%{background:linear-gradient(90deg,#d9d1f6,#f3f0fd 38%)}36%{opacity:1;transform:rotateY(-180deg)}42%,100%{opacity:0;transform:rotateY(-180deg)}}
/* b: hebt sich langsam, zögert, fällt dann rasch (etwa 2,4 s) */
@keyframes lx-film-flip-b{0%{opacity:0;transform:rotateY(0);animation-timing-function:cubic-bezier(.2,0,.4,1)}4%{opacity:1}
  20%{transform:rotateY(-58deg);animation-timing-function:ease-in-out}30%{transform:rotateY(-72deg);background:linear-gradient(90deg,#d9d1f6,#f3f0fd 38%);animation-timing-function:cubic-bezier(.55,0,.85,.5)}
  39%{opacity:1;transform:rotateY(-180deg)}45%,100%{opacity:0;transform:rotateY(-180deg)}}
/* c: rascher Griff (etwa 1,2 s) */
@keyframes lx-film-flip-c{0%{opacity:0;transform:rotateY(0);animation-timing-function:cubic-bezier(.5,0,.25,1)}3%{opacity:1}
  9%{background:linear-gradient(90deg,#d9d1f6,#f3f0fd 38%)}16%{opacity:1;transform:rotateY(-180deg)}21%,100%{opacity:0;transform:rotateY(-180deg)}}
/* Deckel mit dem Lexora-Zeichen: schlägt sich zu Beginn einmal auf. */
.lx-film-cover{left:44px;top:-1px;width:45px;height:58px;display:grid;place-items:center;border-radius:2px 7px 7px 2px;transform-origin:0 50%;
  background:linear-gradient(150deg,#7464cf,#4a3d99);box-shadow:inset 0 0 0 1px rgb(255 255 255/22%),0 12px 20px -10px rgb(8 4 36/70%);
  animation:lx-film-open 1s cubic-bezier(.6,0,.2,1) .2s both}
.lx-film-cover>svg{width:20px;height:20px;filter:drop-shadow(0 3px 6px rgb(8 4 36/45%))}
.lx-film-cover .lx-brand-tile{color:#fff}.lx-film-cover .lx-brand-glyph{color:var(--brand,#514394)}
@keyframes lx-film-open{0%{transform:rotateY(0);opacity:1}80%{opacity:1}100%{transform:rotateY(-178deg);opacity:0}}
/* Funken steigen aus dem Falz. */
.lx-film-spark{position:absolute;left:87px;top:26px;width:2.5px;height:2.5px;border-radius:50%;background:#fff;opacity:0;
  box-shadow:0 0 6px 1px rgb(214 204 255/90%);animation:lx-film-rise var(--f-loop) var(--f-out) infinite}
.lx-film-spark.s1{animation-delay:1.2s}.lx-film-spark.s2{left:82px;animation-delay:2s}.lx-film-spark.s3{left:93px;animation-delay:2.8s}
@keyframes lx-film-rise{0%{opacity:0;transform:translate(0,0) scale(.6)}15%{opacity:1}100%{opacity:0;transform:translate(var(--dx,4px),-22px) scale(1)}}
.lx-film-spark.s2{--dx:-6px}.lx-film-spark.s3{--dx:7px}

@media(prefers-reduced-motion:reduce){
  .lx-film *,.lx-film *::before,.lx-film *::after{animation:none!important}
  .lx-film-cover,.lx-film-leaf,.lx-film-spark{opacity:0}
  .lx-film-book{transform:rotateX(12deg)}
  /* identity.css unterbindet sonst auch diese bewegungslosen Sichtbarkeitsschritte. */
  .boot.lx-boot{animation:lx-boot-reveal 0s linear var(--lx-ladefilm-verzoegerung) forwards!important}
  :is(#navigator-root,#root,#werkbank-root):not(:empty)~.boot.lx-boot{display:none;animation:none}
  .lx-wait{opacity:0;animation:lx-boot-reveal 0s linear var(--lx-ladefilm-verzoegerung) forwards!important}
}
