/* fx-story: the walk, the counter's slip and ledgers, the brass tokens and balance of "Ask the room", the 5 field banners,
   and the photo corners in #press (fx-story.js and the walk and counter scenes in devices.js and scenes.js) */

/* ================= the walk: the drawing spans the stage, the day warms the sky ================= */
#walk .stage{background:radial-gradient(70% 62% at 58% 42%,var(--sky,#F9F0E4) 0,rgba(249,240,228,0) 78%)}
#walkSvg text{font-size:max(var(--fz,17px),calc(13.5px / var(--s,1)))}
#walkSvg .steps{transition:none}
#walker .wk-fig{fill:#6F1D11;stroke:#6F1D11;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
#walker{filter:drop-shadow(0 0 1.6px #F9F0E4) drop-shadow(0 0 1px #F9F0E4)}
@media (min-width:821px){
  #walk .caps{align-self:start;max-width:min(520px,40vw)}
  #walk .viz{position:absolute;right:clamp(20px,5vw,84px);bottom:clamp(16px,4vh,40px);width:min(80vw,calc((100vh - 170px) * 1.5));height:auto;display:block}
  #walk .viz svg{display:block;width:100%;height:auto;max-height:none}
}
@media (max-width:820px){
  #walk .viz{height:100%;min-height:0;display:flex;align-items:flex-end;justify-content:flex-start;overflow:hidden;margin:0 -20px;width:calc(100% + 40px)}
  #walk .viz svg{flex:none;height:min(100%,56vh);width:auto;max-width:none;max-height:none}
  #walk .illus{top:4px;bottom:auto;left:20px;right:auto}
}

/* ================= the counter: the server prints one word, the diary is a torn exercise-book page ================= */
#counter .lg-server{position:relative;background:#F6EEDF;color:#361819;border:0;border-radius:2px;padding:24px 18px 26px;transform:scale(.92) rotate(-1.5deg);transform-origin:50% 0;
  -webkit-mask:conic-gradient(from -45deg at bottom,#0000,#000 1deg 89deg,#0000 90deg) 50%/14px 100%,conic-gradient(from 135deg at top,#0000,#000 1deg 89deg,#0000 90deg) 50%/14px 100%;
  -webkit-mask-composite:source-in;mask:conic-gradient(from -45deg at bottom,#0000,#000 1deg 89deg,#0000 90deg) 50%/14px 100%,conic-gradient(from 135deg at top,#0000,#000 1deg 89deg,#0000 90deg) 50%/14px 100%;mask-composite:intersect;
  transition:transform .7s var(--out) .2s;filter:drop-shadow(0 8px 10px rgba(0,0,0,.35))}
#counter .ledgers.on .lg-server{transform:scale(.82) rotate(-2.5deg)}
#counter .lg-server .lg-h{color:#765A50}
#counter .lg-type{color:#6F1D11;font-family:var(--display);font-size:clamp(30px,2.8vw,40px)}
#counter .lg-note{color:#5B3A33;font-size:16px}
#counter .lg-server .lg-h{font-size:16.5px}
#counter .lg-diary{position:relative;padding-left:40px;transform:translateX(60px) rotate(1.5deg);opacity:0;transition:transform .8s var(--out),opacity .5s;
  background-image:linear-gradient(90deg,transparent 28px,rgba(178,58,42,.55) 28px 30px,transparent 30px),repeating-linear-gradient(180deg,transparent 0 41px,rgba(54,90,140,.22) 41px 42px),var(--paper);
  clip-path:polygon(0 1%,3% 0,7% 1.2%,12% .2%,18% 1%,25% 0,33% 1.1%,41% .3%,50% 1%,58% 0,66% 1.2%,74% .2%,82% 1%,90% 0,96% 1%,100% .4%,100% 100%,0 100%);box-shadow:0 14px 26px -10px rgba(0,0,0,.5)}
#counter .ledgers.on .lg-diary{transform:rotate(1deg);opacity:1}
@media (max-width:820px){#counter .lg-server{transform:none;padding:16px 14px 18px}#counter .ledgers.on .lg-server{transform:none}#counter .lg-diary{padding-left:36px}}

/* ================= ask the room: brass tokens, a hanging balance, the closed object ================= */
.ask .opts{display:flex;flex-wrap:wrap;align-items:center;gap:18px 22px;max-width:none;--tk:clamp(56px,17vw,108px)}
.ask .opt{width:var(--tk);height:var(--tk);min-height:0;padding:calc(var(--tk) * .12) 4px 0;border:0;border-radius:50%;display:flex;align-items:center;justify-content:center;text-align:center;
  font-family:var(--display);font-weight:400;font-size:calc(var(--tk) * .29);line-height:1;color:#3A230C;
  background:radial-gradient(circle at 34% 28%,#FBEBB5 0,#E2BE66 30%,#B8862F 68%,#7A5418 100%);
  box-shadow:inset 0 0 0 3px rgba(122,84,24,.6),inset 0 0 0 6px rgba(251,235,181,.4),inset 0 -7px 12px rgba(58,35,12,.35),0 10px 16px -8px rgba(20,6,4,.6);
  text-shadow:0 1px 0 rgba(255,244,210,.75),0 -1px 0 rgba(90,58,20,.3);transition:transform .3s var(--spring),filter .4s,opacity .4s}
.ask .opt::before{right:auto;left:50%;top:8%;width:13%;height:13%;translate:-50% 0;opacity:1;background:var(--page);box-shadow:inset 0 2px 3px rgba(58,35,12,.65),0 1px 0 rgba(255,244,210,.6)}
.ask .opt:hover:not(:disabled){transform:translateY(-4px) rotate(-5deg)}
.ask .opt:focus-visible{outline:3px solid var(--gold-2);outline-offset:5px}
.ask.dark .opt:focus-visible,.ask.velvet .opt:focus-visible{outline-color:var(--gold-3)}
.ask .opts.words .opt{width:auto;height:auto;min-height:62px;border-radius:999px;padding:14px 24px 14px 46px;font-family:var(--sans);font-weight:600;font-size:17px;line-height:1.2;text-align:left;
  background:linear-gradient(180deg,#F6E3A1 0,#D9B25A 40%,#B8862F 78%,#8A6420 100%)}
.ask .opts.words .opt::before{left:22px;top:50%;width:14px;height:14px;translate:-50% -50%}
.ask.shown .opt:not(.right):not(.st-picked){filter:grayscale(.55) brightness(.92)}
.ask .opt.st-picked{animation:stDip .45s var(--spring) both}
@keyframes stDip{0%{transform:none}45%{transform:translateY(40px) rotate(8deg)}100%{transform:translateY(7px) rotate(4deg)}}
.ask .opt.right::after{content:"सही";position:absolute;right:-14%;bottom:-8%;font-family:var(--hindi);font-size:max(15px,calc(var(--tk) * .24));line-height:1.15;color:#8A2A1A;
  border:2px solid #8A2A1A;border-radius:6px;padding:.12em .32em 0;background:rgba(249,240,228,.92);rotate:-14deg;text-shadow:none;animation:stStamp .5s var(--spring) .55s both}
.ask .opts.words .opt.right::after{right:-10px;bottom:-14px}
@keyframes stStamp{0%{opacity:0;scale:1.8}100%{opacity:1;scale:1}}
.ask .opt.wrong::after{content:"";position:absolute;left:6%;right:6%;top:50%;height:4px;border-radius:2px;rotate:-22deg;
  background:repeating-linear-gradient(90deg,rgba(40,36,34,.85) 0 7px,rgba(40,36,34,.6) 7px 9px);transform-origin:0 50%;animation:stStrike .4s ease-out .2s both}
@keyframes stStrike{0%{transform:scaleX(0)}100%{transform:scaleX(1)}}
.ask .hint{font-size:15px;color:rgba(54,24,25,.78)}
.ask.dark .hint,.ask.velvet .hint{color:rgba(249,240,228,.82)}
.st-tally{letter-spacing:.12em;white-space:nowrap}

.st-stage{display:flex;flex-direction:column;align-items:center;gap:4px;width:100%;max-width:280px;margin:30px auto 0;pointer-events:none}
.st-stage svg{display:block;width:100%;height:auto;overflow:visible}
.st-stage .st-obj{display:none}
.st-beam{transition:transform 1.1s cubic-bezier(.3,1.45,.5,1)}
.st-pan{transition:transform 1.1s cubic-bezier(.3,1.45,.5,1)}
.st-tok{opacity:0;transform:translateY(-90px);transition:transform .5s cubic-bezier(.55,0,.7,1.35),opacity .15s}
.st-has-l .st-l .st-tok,.st-has-r .st-r .st-tok{opacity:1;transform:none}
.st-has-r .st-r .st-tok{transition-delay:.12s}
.st-o{opacity:0;transition:opacity .7s var(--out) .45s}
.st-c{transition:opacity .5s var(--out) .3s}
.shown .st-o{opacity:1}.shown .st-c{opacity:0}
@media (min-width:1000px){
  .ask.st-on .wrap>.kick,.ask.st-on .wrap>.q-lead,.ask.st-on .wrap>.q,.ask.st-on .wrap>.opts{max-width:calc(100% - min(30vw,340px) - 40px)}
  .st-stage{position:absolute;right:clamp(20px,5vw,64px);top:clamp(120px,calc(11vw + 40px),200px);width:min(30vw,340px);max-width:none;margin:0}
  .st-stage .st-obj{display:block;opacity:.4;filter:drop-shadow(0 16px 14px rgba(54,24,25,.22));transition:opacity .7s var(--out)}
  .ask.dark .st-obj{filter:drop-shadow(0 16px 14px rgba(0,0,0,.4))}
  .shown .st-obj{opacity:1}
  #ask1.shown .st-obj{opacity:0}
}
@media (max-width:820px){.ask .opts{gap:14px}.ask .opts.words .opt{font-size:16px;padding:12px 18px 12px 40px}.ask .opts.words .opt::before{left:19px}}

/* ================= #fields: five handloom banners on a brass rod ================= */
#fields{padding-bottom:clamp(40px,8vh,80px)}
#fields .fields-head{padding-bottom:clamp(24px,4vh,44px)}
#fields .cols{position:relative;display:flex;gap:clamp(10px,1.2vw,18px);min-height:0;padding:30px clamp(20px,4vw,64px) 70px}
#fields .cols::before{content:"";position:absolute;left:clamp(8px,2vw,40px);right:clamp(8px,2vw,40px);top:10px;height:11px;border-radius:6px;
  background:linear-gradient(180deg,#F3D98B,#C9A24D 45%,#7A5418);box-shadow:0 4px 6px rgba(54,24,25,.3)}
#fields .col{flex:1 1 0;min-width:0;display:flex;flex-direction:column;padding:0;overflow:visible;min-height:min(80vh,720px);outline-offset:4px;
  transition:flex-grow .45s var(--out),clip-path .9s var(--out) calc(var(--i,0) * 90ms);box-shadow:0 18px 28px -18px rgba(54,24,25,.55)}
#fields .col::before,#fields .col::after{content:"";display:block;flex:none;height:16px;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Crect width='16' height='16' fill='%23361819'/%3E%3Cpath d='M8 2l6 6-6 6-6-6z' fill='%23C9A24D'/%3E%3Cpath d='M8 5.5l2.5 2.5-2.5 2.5-2.5-2.5z' fill='%23F3D98B'/%3E%3Cpath d='M0 .75h16M0 15.25h16' stroke='%23E7C877' stroke-width='1.5'/%3E%3C/svg%3E") 0 0/16px 16px repeat-x}
#fields .col:focus-visible{outline:3px solid var(--gold-2)}
#fields .bn{position:relative;flex:1;display:flex;flex-direction:column;overflow:hidden;padding:clamp(22px,4vh,40px) clamp(14px,1.6vw,26px) clamp(18px,3vh,30px);
  background-image:repeating-linear-gradient(90deg,rgba(255,255,255,.035) 0 1px,transparent 1px 4px),repeating-linear-gradient(0deg,rgba(0,0,0,.04) 0 1px,transparent 1px 4px)}
#fields .col h3{font-size:min(clamp(40px,4vw,64px),25cqi)}
#fields .col .rec{max-width:30ch}
#fields .keep{margin-top:16px;font-size:15px;line-height:1.4}
#fields .keep span{display:block}
#fields .keep b{display:block;font-family:var(--mono);font-weight:400;font-size:13.5px;opacity:.85}
#fields .keep .would{margin-top:0;max-height:0;opacity:0;overflow:hidden;font-weight:600;transition:max-height .45s var(--out),opacity .35s,margin .45s var(--out)}
#fields .col:hover .would,#fields .col:focus-within .would{max-height:6em;opacity:1;margin-top:10px}
#fields .col:hover,#fields .col:focus-within{flex-grow:2}
#fields .motif{margin-top:auto;padding-top:24px}
#fields .bn{container-type:inline-size}
#fields .motif .hi{display:block;font-size:min(88px,34cqi);line-height:1.05;opacity:.85;transition:-webkit-mask-position 1.1s var(--out),mask-position 1.1s var(--out);transition-delay:calc(.45s + var(--i,0) * 90ms)}
#fields .dhobi{display:inline-block;margin-top:10px;padding:3px 9px 2px;border:1px solid currentColor;font-family:var(--mono);font-size:15px;letter-spacing:.08em;rotate:-2deg}
#fields .tassels{position:absolute;left:0;right:0;top:100%;display:flex;justify-content:space-around;padding:0 12%;pointer-events:none}
#fields .tassels i{display:block;width:10px;height:44px;transform-origin:50% 0;
  background:linear-gradient(90deg,#8A6420,#E7C877 50%,#8A6420);clip-path:polygon(42% 0,58% 0,58% 36%,100% 100%,0 100%,42% 36%)}
#fields .tassels i:nth-child(even){background:linear-gradient(90deg,#5E160C,#B5502A 50%,#5E160C)}
@keyframes stTassel{0%{rotate:0deg}20%{rotate:9deg}45%{rotate:-6deg}70%{rotate:3deg}100%{rotate:0deg}}
#fields .fields-src{max-width:1180px;margin:0 auto;padding:0 clamp(20px,5vw,64px)}
/* the reveal: each banner unrolls from its rod, then its Hindi word is wiped in (no blur) */
#fields.st-wait .col{clip-path:inset(0 0 100% 0)}
#fields.st-wait .col.st-in{clip-path:inset(0 0 -60px 0)}
#fields.st-wait .motif .hi{-webkit-mask-image:linear-gradient(90deg,#000 45%,transparent 55%);mask-image:linear-gradient(90deg,#000 45%,transparent 55%);-webkit-mask-size:230% 100%;mask-size:230% 100%;-webkit-mask-position:100% 0;mask-position:100% 0}
#fields.st-wait .col.st-in .motif .hi{-webkit-mask-position:0 0;mask-position:0 0}
@media (max-width:1180px){
  #fields .cols{flex-wrap:wrap;row-gap:80px}
  #fields .cols::before{display:none}
  #fields .col{flex:1 1 30%;min-height:0}
  #fields .col:hover,#fields .col:focus-within{flex-grow:1}
  #fields .keep .would{max-height:none;opacity:1;margin-top:10px}
  #fields .col h3{font-size:clamp(36px,5vw,52px)}
}
@media (max-width:640px){#fields .col{flex-basis:100%}#fields .cols{row-gap:70px;padding-bottom:60px}}

/* ================= #press: gold photo corners hold the print ================= */
#press .plate .pp{position:relative}
#press .corners{position:absolute;inset:5px;pointer-events:none;filter:drop-shadow(0 1px 1px rgba(54,24,25,.45));
  background:linear-gradient(135deg,#E7C877 0 30%,#A06C1B 50%,transparent 50%) 0 0/34px 34px no-repeat,linear-gradient(225deg,#E7C877 0 30%,#A06C1B 50%,transparent 50%) 100% 0/34px 34px no-repeat,
    linear-gradient(45deg,#C9A24D 0 30%,#7A5418 50%,transparent 50%) 0 100%/34px 34px no-repeat,linear-gradient(315deg,#C9A24D 0 30%,#7A5418 50%,transparent 50%) 100% 100%/34px 34px no-repeat}

@media (prefers-reduced-motion:reduce){
  .st-beam,.st-pan,.st-tok,.st-o,.st-c,.st-obj,.ask .opt,#fields .col,#fields .motif .hi,#fields .keep .would,#counter .lg-server,#counter .lg-diary{transition:none!important}
  .ask .opt.st-picked,.ask .opt.right::after,.ask .opt.wrong::after,#fields .tassels i{animation:none!important}
}
