/* The story film (landing.js) in the sign-in page's right panel: chapter bars on top, the scene in the middle, a
   caption at the bottom, controls bottom right. Each chapter re-runs its animations when it comes on (class "in").
   Colours come from the look.css tokens (html.nl) so the film follows the dark and light themes; only the player
   colours in landing.js are picked per actor, from the same tokens. Motion is transform and opacity only. */
.film{overflow:hidden;background:var(--bg2);color:var(--ink);border:1px solid var(--line);margin:16px;border-radius:28px;min-height:560px;height:calc(100vh - 32px);position:sticky;top:16px;outline:none}
.film:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
.f-bars{position:absolute;left:20px;right:20px;top:16px;z-index:5;display:flex;gap:8px}
.f-bar{flex:1;height:20px;padding:8px 0;border:0;background:none;cursor:pointer}
.f-bar:focus-visible{outline:3px solid var(--accent);outline-offset:0}
.f-bar i{display:block;height:4px;border-radius:2px;background:var(--line);position:relative;overflow:hidden}
.f-bar i::after{content:"";position:absolute;inset:0;background:var(--accent);border-radius:2px;transform:scaleX(0);transform-origin:left}
.f-bar.done i::after{transform:scaleX(1)}
.f-bar.run i::after{animation:fRun var(--ms) linear forwards}
.film.paused .f-bar.run i::after{animation-play-state:paused}
@keyframes fRun{to{transform:scaleX(1)}}
.fs{position:absolute;inset:0;opacity:0;transition:opacity .6s;pointer-events:none}
.fs.on{opacity:1}
.st{position:absolute;inset:52px 6% 190px 6%;container-type:size}
.f-cap{position:absolute;left:0;right:0;bottom:0;z-index:4;padding:60px 152px 28px 28px;background:linear-gradient(transparent,var(--bg2) 45%);display:flex;flex-direction:column;gap:8px}
.f-k{font-weight:700;font-size:13px;color:var(--accent)}
.f-t{font-size:clamp(26px,2.8vw,38px);line-height:1.02;letter-spacing:-.03em;font-weight:800}
.f-l{margin:0;color:var(--muted);font-size:15px;line-height:1.45}
.f-cap.in>*{animation:fUp .6s both}
.f-cap.in .f-t{animation-delay:.08s}
.f-cap.in .f-l{animation-delay:.16s}
@keyframes fUp{from{opacity:0;translate:0 14px}}
.f-ctl{position:absolute;right:20px;bottom:28px;z-index:5;display:flex;gap:8px}
.f-ctl button{width:40px;height:40px;border-radius:50%;border:1px solid var(--muted);background:var(--panel);color:var(--ink);font-size:13px;cursor:pointer}
.f-ctl button:hover{background:var(--chip)}
.f-ctl button:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
/* Actors */
.lm{position:absolute;width:84px;display:flex;flex-direction:column;align-items:center;gap:4px;filter:drop-shadow(0 14px 18px var(--edge))}
.lm svg{width:100%;height:auto}
.lm b{font-size:13px;color:var(--muted)}
.lm.big{width:130px}
.lp{position:absolute;background:var(--panel);border:3px solid var(--line);border-radius:20px;padding:20px 8px 8px;display:flex;flex-direction:column;gap:8px;box-shadow:0 22px 46px var(--edge)}
.lp-notch{position:absolute;top:8px;left:50%;translate:-50% 0;width:34%;height:4px;border-radius:4px;background:var(--line)}
.lp-row{display:flex;align-items:center;gap:8px;background:var(--raise);border-radius:8px;padding:4px}
.lp-row span{flex:1;display:flex;flex-direction:column;gap:4px;min-width:0}
.lp-row b{height:6px;width:70%;border-radius:3px;background:var(--line)}
.lp-row em{height:4px;width:45%;border-radius:3px;background:var(--chip)}
.lp-row em.name{height:auto;width:auto;background:none;font-style:normal;font-size:11px;font-weight:800;color:var(--ok);white-space:nowrap}
.lp-row s{text-decoration:none;color:var(--ok);font-weight:800;font-size:12px}
.lp-title{font-size:12px;font-weight:800;color:var(--muted);padding:0 4px}
.lp-empty{font-size:12px;color:var(--muted);text-align:center;padding:24px 0}
.lc{display:block;width:32px;height:32px;border-radius:8px;background-size:cover;background-position:center;flex:none}
.bubble{position:absolute;background:var(--ink);color:var(--bg);font-weight:800;padding:12px 16px;border-radius:18px 18px 18px 4px;font-size:15px;line-height:1.35;max-width:240px;box-shadow:0 14px 30px var(--edge);opacity:0;scale:.6;transition:opacity .5s,scale .5s cubic-bezier(.3,1.6,.6,1)}
.fs.in .bubble{opacity:1;scale:1;transition-delay:.6s}
/* 1: you, the one who doesn't log */
.fs1 .you{left:8%;bottom:0}
.fs1 .b1{left:38%;top:4%}
.fs1 .p1{right:4%;bottom:4%;width:140px}
.fs1.in .you{animation:lSigh 2.4s .3s ease-in-out}
/* 2: Brass night, you win */
.table{position:absolute;left:34%;top:46%;translate:-50% -50%;width:56%;aspect-ratio:1.5;border-radius:50%;background:radial-gradient(color-mix(in srgb,var(--ok) 30%,var(--felt)),var(--felt));box-shadow:inset 0 0 0 8px var(--line),0 24px 48px var(--edge)}
.table .brass{position:absolute;left:50%;top:44%;translate:-50% -50%;width:96px;height:96px;border-radius:12px;box-shadow:0 8px 20px var(--edge);rotate:-6deg}
.die{position:absolute;font-size:28px;color:var(--ink);filter:drop-shadow(0 4px 8px var(--edge))}
.d1{left:22%;top:58%}.d2{left:68%;top:60%}
.fs2.in .die{animation:lRoll 1s ease-out}
.fs2 .lm{width:64px}
.fs2 .m1{left:0;top:30%}.fs2 .m2{left:57%;top:16%}.fs2 .m3{left:28%;top:2%}.fs2 .m4{left:28%;bottom:2%}
.fs2.in .m1{animation:lHop .7s 2.6s ease-in-out 3}
.score{position:absolute;right:0;bottom:0;width:42%;max-width:220px;background:var(--panel);color:var(--ink);border:1px solid var(--line);border-radius:16px;padding:12px 16px;box-shadow:0 18px 40px var(--edge);display:flex;flex-direction:column;gap:8px}
.score-h{font-weight:700;font-size:13px;color:var(--muted)}
.sc-row{display:flex;align-items:center;gap:8px;font-weight:700;font-size:15px;opacity:0;translate:12px 0}
.fs2.in .sc-row{animation:fIn .4s calc(.6s + var(--d) * .15s) forwards}
.sc-row i{width:10px;height:10px;border-radius:50%}
.sc-row span{flex:1}
.sc-row b{font:800 18px var(--f-disp)}
.sc-row.win{background:var(--accent-soft);margin:0 -8px;padding:4px 8px;border-radius:8px}
@keyframes fIn{to{opacity:1;translate:0 0}}
/* 3: friends log, you don't */
.fr{position:absolute;width:30%;top:0;display:flex;flex-direction:column;align-items:center;gap:8px}
.fr0{left:0}.fr1{left:35%}.fr2{right:0}
.fr .lm{position:relative;width:48px}
.fr .lp{position:relative;width:100%}
.fs3 .fr .lp-row{opacity:0;translate:-8px 0}
.fs3.in .fr .lp-row{animation:fIn .4s .3s forwards}
.fs3.in .fr .lp-row+.lp-row{animation-delay:.8s}
.me3{position:absolute;left:4%;bottom:0;display:flex;align-items:flex-end;gap:8px}
.me3 .lm{position:relative;width:64px}
.me3 .lp{position:relative;width:112px}
.me3 .lp-empty{color:var(--bad);font-weight:700}
.fs3 .b3{left:42%;bottom:6%;font-size:14px}
.fs3.in .b3{transition-delay:1.6s}
/* 4: behind */
.fs4 .you{left:4%;bottom:0}
.sweat::after{content:"💧";position:absolute;right:6px;top:10px;font-size:20px;opacity:0}
.fs4.in .sweat::after{animation:lDrip 1.8s .6s ease-in infinite}
.pile{position:absolute;right:8%;bottom:2%;width:112px;height:280px}
.pile .lc{position:absolute;left:0;width:100px;height:28px;border-radius:8px;bottom:calc(var(--i) * 28px);rotate:calc((var(--i) - 4) * 2deg);opacity:0;translate:0 -60px}
.fs4.in .pile .lc{animation:lDrop .45s calc(var(--i) * .13s) cubic-bezier(.3,1.4,.6,1) forwards}
.behind{position:absolute;left:36%;top:6%;display:flex;flex-direction:column;align-items:center}
.behind b{font:800 72px/1 var(--f-disp);color:var(--accent)}
.behind span{color:var(--muted);font-weight:700}
/* 5: plot twist */
.ph-mid{left:50%;top:52%;translate:-50% -50%;width:min(260px,70%)}
.ph-mid .lc{width:40px;height:40px}
.fs5 .lp-row{opacity:.3;transition:opacity .5s}
.fs5.in .lp-row{opacity:1;transition-delay:.5s}
.fs5.in .name{animation:lGlow 1.6s .8s ease-in-out infinite}
.twist{position:absolute;left:50%;top:2%;translate:-50% 0;font:800 30px var(--f-disp);color:var(--accent);opacity:0;scale:2;white-space:nowrap}
.fs5.in .twist{animation:fTwist .7s cubic-bezier(.2,1.4,.5,1) forwards}
@keyframes fTwist{to{opacity:1;scale:1}}
.spark{position:absolute;right:0;bottom:4%;background:var(--ok);color:var(--bg);font-weight:800;padding:8px 16px;border-radius:12px;rotate:4deg;opacity:0;scale:.5;transition:opacity .5s,scale .5s cubic-bezier(.3,1.6,.6,1)}
.fs5.in .spark{opacity:1;scale:1;transition-delay:1.3s}
/* 6: the sync */
.src{position:absolute;top:0;width:27%;display:flex;flex-direction:column;align-items:center;gap:8px}
.src0{left:0}.src1{left:36.5%}.src2{right:0}
.src .lm{position:relative;width:40px}
.src .lp{position:relative;width:100%;padding:16px 4px 4px}
.src .lc{width:22px;height:22px}
.hub{position:absolute;left:50%;top:44%;translate:-50% -50%;width:58px;height:58px;border-radius:16px;overflow:hidden;z-index:2;box-shadow:0 0 0 6px var(--accent-soft),0 0 0 8px var(--accent)}
.hub img{width:100%;height:100%}
.fs6.in .hub{animation:lPulse 1.2s ease-in-out infinite}
.ph-mine{left:50%;bottom:0;translate:-50% 0;width:min(220px,58%)}
.l-count{font-size:13px;color:var(--muted);padding:0 4px}
.l-count b{font:800 28px/1 var(--f-disp);color:var(--ink)}
/* The covers fly from the three phones to the hub, then down into the log. They move by translate only: the .st box is a
   size container, so cqw and cqh are the scene's own width and height. */
.fly{position:absolute;width:40px;height:40px;left:calc(12% + var(--from) * 37%);top:16%;opacity:0;z-index:3;box-shadow:0 8px 16px var(--edge)}
.fs6.in .fly{animation:lFly 1.5s calc(.3s + var(--i) * .2s) cubic-bezier(.5,0,.3,1) forwards}
/* 7: caught up */
.fs7 .you{left:2%;bottom:0}
.fs7 .ph-mid{left:62%}
.badge{position:absolute;right:2%;bottom:2%;background:var(--ok);color:var(--bg);font-weight:800;font-size:17px;padding:12px 16px;border-radius:12px;rotate:-4deg;opacity:0;scale:.4;transition:opacity .5s,scale .5s cubic-bezier(.3,1.6,.6,1)}
.fs7.in .badge{opacity:1;scale:1;transition-delay:.5s}
.fs7.in .cheer{animation:lHop .7s ease-in-out 4}
.confetti i{position:absolute;left:calc(5% + var(--i) * 5%);top:-32px;width:8px;height:16px;border-radius:2px;background:var(--accent);opacity:0}
.confetti i:nth-child(4n+2){background:var(--ok)}
.confetti i:nth-child(4n+3){background:var(--p-bl)}
.confetti i:nth-child(4n){background:var(--p-pu)}
.fs7.in .confetti i{animation:lConf 2.4s calc(var(--i) * .07s) ease-in forwards}
/* 8: make it yours */
.perks{position:absolute;inset:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-content:center}
.perk{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:16px;display:flex;flex-direction:column;gap:8px;opacity:0;translate:0 24px}
.fs8.in .perk{animation:fIn .6s forwards}
.fs8.in .perk:nth-child(2){animation-delay:.2s}
.fs8.in .perk:nth-child(3){animation-delay:.4s}
.perk b{font-size:15px}
.perk span{font-size:13px;color:var(--muted)}
.perk em{font-style:normal;color:var(--accent);font-weight:700}
.canvas{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;padding:8px;background:var(--ink);border-radius:4px;box-shadow:4px 4px 0 var(--line)}
.canvas .lc{width:100%;height:auto;aspect-ratio:1;border-radius:4px}
.avs{display:flex;height:72px;align-items:flex-end}
.avs .lm{position:relative;width:40px;margin-right:-8px}
.sun{font-size:52px;line-height:72px;color:var(--accent)}
@keyframes lHop{0%,100%{translate:0 0}50%{translate:0 -16px}}
@keyframes lSigh{0%,100%{translate:0 0;rotate:0deg}40%{translate:0 8px;rotate:-4deg}70%{rotate:3deg}}
@keyframes lRoll{0%{rotate:0deg;translate:-40px -32px}100%{rotate:720deg;translate:0 0}}
@keyframes lDrip{0%{opacity:0;translate:0 0}20%{opacity:1}100%{opacity:0;translate:0 40px}}
@keyframes lDrop{to{opacity:1;translate:0 0}}
@keyframes lGlow{0%,100%{opacity:1}50%{opacity:.55}}
@keyframes lPulse{0%,100%{scale:1}50%{scale:1.12}}
@keyframes lFly{
  0%{opacity:0;scale:.6;translate:0 0}
  12%{opacity:1}
  55%{translate:calc(38cqw - var(--from) * 37cqw - 20px) 24cqh;scale:1.25;rotate:200deg}
  100%{translate:calc(38cqw - var(--from) * 37cqw - 20px) 66cqh;scale:.5;rotate:360deg;opacity:0}
}
@keyframes lConf{0%{opacity:1;translate:0 0;rotate:0deg}100%{opacity:0;translate:calc((var(--i) - 9) * 8px) 420px;rotate:540deg}}
@media (prefers-reduced-motion:reduce){
  .film *{animation:none !important;transition:none !important}
  .bubble,.sc-row,.perk,.spark,.badge,.twist,.pile .lc,.fs3 .fr .lp-row{opacity:1;translate:0 0;scale:1}
  .f-bar.run i::after{transform:scaleX(1)}
}
@media (max-width:900px){
  .film{order:-1;position:relative;top:0;height:560px;min-height:0;margin:12px 12px 0;border-radius:24px}
  .st{inset:48px 4% 184px 4%}
  .f-cap{padding:40px 16px 64px}
  .f-ctl{right:auto;left:16px;bottom:16px}
  .lm.big{width:96px}
  .fs3 .b3{left:56%;bottom:6%;max-width:150px;font-size:13px;padding:8px 12px}
  .me3 .lp{width:88px}
  .spark{bottom:-6%;font-size:13px;padding:8px 12px}
  .fs7 .you{width:84px;left:0;bottom:8%}
  .fs7 .ph-mid{left:66%;width:50%;top:46%}
  .badge{bottom:-6%;right:0;font-size:14px;padding:8px 12px}
  .hub{width:48px;height:48px;top:41%}
  .ph-mine{width:min(220px,64%)}
  .fs2 .lm{width:48px}
  .score{width:48%}
  .score .sc-row{font-size:13px}
  .perks{gap:8px}
  .perk{padding:8px}
  .perk span{display:none}
  .perk b{font-size:12px}
  .behind b{font-size:56px}
  .pile{width:84px;height:220px}
  .pile .lc{width:76px;height:22px;bottom:calc(var(--i) * 22px)}
}
/* Sign-in and the other signed-out pages in the new look (html.nl): same tokens as the signed-in app. */
html.nl .auth{background:var(--bg);color:var(--ink)}
html.nl .auth-h{font-stretch:118%;letter-spacing:-.02em;font-weight:800}
html.nl .auth-card{background:var(--panel);border:1px solid var(--line);border-radius:var(--r);box-shadow:0 2px 0 var(--edge)}
/* The email box edge is the muted ink (about 7:1 on the panel), not the hairline, so the field reads as a field. */
html.nl .auth .field input,html.nl .auth .field textarea{background:var(--bg);border:1px solid var(--muted);border-radius:var(--r-sm);color:var(--ink)}
html.nl .auth .field input::placeholder,html.nl .auth .field textarea::placeholder{color:var(--muted);opacity:1}
html.nl .auth .field input:focus-visible,html.nl .auth .field textarea:focus-visible{outline:3px solid var(--accent);outline-offset:2px;border-color:var(--ink)}
html.nl .auth .btn:focus-visible,html.nl .auth a:focus-visible,html.nl .auth-req-link:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
html.nl .auth .btn-ghost{background:var(--panel);border:1px solid var(--muted);color:var(--ink)}
html.nl .auth .btn-ghost:hover{background:var(--chip)}
html.nl .auth-points{color:var(--muted)}
html.nl .auth-points svg{color:var(--accent)}
html.nl .auth-req{border-radius:var(--r);border:1px dashed var(--accent);background:var(--accent-soft)}
html.nl .auth-req.done{border:1px solid var(--ok);background:var(--ok-soft)}
html.nl .auth-req-link b{color:var(--accent)}
html.nl .auth-cap-l a{color:var(--muted)}
