/* A quiet, oversized companion behind the Books door. Desktop only. */
.door-elephant{display:none;pointer-events:none!important}
@media(min-width:901px){
 .chic-doors .door-elephant{display:block;position:absolute;left:calc(50% - 164px);top:-60px;width:285px;height:190px;z-index:0;pointer-events:none!important}
 .door-elephant img{display:block;width:100%;height:100%;max-width:none;pointer-events:none!important}
 .chic-doors .door-books>.door-portal{z-index:2}
 .chic-doors .door-books>.door-label{z-index:3}
}
@media(max-width:900px){.door-elephant{display:none!important}}

@media(min-width:901px){.chic-doors .door-research{z-index:2}.chic-doors .door-books{z-index:1}}
/* Pale ink keeps the unfilled drawing legible against the woodland. */
.forest-stage[data-scene=forest] .door-elephant img{filter:brightness(0) invert(1) drop-shadow(0 1px 1px #142f24)}
/* One little cookie, on the floor to the lower-left of the sleeping trunk. */
.elephant-cookie{display:none;pointer-events:none}
@media(min-width:901px){.door-elephant .elephant-cookie{display:block;position:absolute;width:54px;height:35px;left:34px;bottom:-20px;overflow:visible;transform:rotate(-8deg);filter:none}}
/* A scaled sleeping companion for Classic phones, behind the middle door. */
@media(max-width:680px){
 body[data-site-scene=plain] .chic-doors .door-elephant{display:block!important;position:absolute;left:calc(50% - 89px);top:-32px;width:165px;height:110px;z-index:0;pointer-events:none!important}
 body[data-site-scene=plain] .door-elephant img{display:block;width:100%;height:100%;max-width:none;pointer-events:none!important}
 body[data-site-scene=plain] .chic-doors .door-books>.door-portal{z-index:2}
 body[data-site-scene=plain] .chic-doors .door-books>.door-label{z-index:3}
 body[data-site-scene=plain] .door-elephant .elephant-cookie{display:block;position:absolute;width:30px;height:20px;left:24px;bottom:-16px;overflow:visible;transform:rotate(-8deg);filter:none}
}
/* The same quiet woodland companion, scaled for Forest phones. */
@media(max-width:680px){
 body[data-site-scene=forest] .chic-doors .door-elephant{display:block!important;position:absolute;left:calc(50% - 89px);top:-32px;width:165px;height:110px;z-index:0;pointer-events:none!important}
 body[data-site-scene=forest] .door-elephant img{display:block;width:100%;height:100%;max-width:none;pointer-events:none!important}
 body[data-site-scene=forest] .chic-doors .door-books>.door-portal{z-index:2}
 body[data-site-scene=forest] .chic-doors .door-books>.door-label{z-index:3}
}
/* Forest phone doors share one stacking plane, above their sleeping companion. */
@media(max-width:680px){
 body[data-site-scene=forest] .chic-doors .chic-door{isolation:auto;z-index:auto}
 body[data-site-scene=forest] .chic-doors .door-elephant{left:calc(50% - 98px);top:-42px;width:185px;height:123.33px;z-index:0}
 body[data-site-scene=forest] .chic-doors .door-portal{z-index:2}
 body[data-site-scene=forest] .chic-doors .door-label{z-index:3}
 body[data-site-scene=forest] .chic-doors .chic-door.touch-armed>.door-label{display:flex;opacity:1;visibility:visible}
 body[data-site-scene=forest] .chic-doors .chic-door.touch-armed>.door-tap-cue{display:block;position:relative;z-index:3;width:max-content;left:50%;transform:translateX(-50%);margin-top:5px;color:#fff;font:11px/1.3 Arial,sans-serif;text-align:center;white-space:nowrap}
}
@media(max-width:680px){body[data-site-scene=forest] .forest-stage>.chic-doors{translate:0 -10px}}
@media(max-width:680px){
 body[data-site-scene=plain] .chic-doors .chic-door{isolation:auto;z-index:auto}
 body[data-site-scene=plain] .chic-doors .door-portal{z-index:2}
 body[data-site-scene=plain] .chic-doors .door-label{z-index:3}
}
/* Classic links are transformed stacking contexts: place both outer doors above Books. */
@media(max-width:680px){
 body[data-site-scene=plain] .chic-doors .door-books{z-index:1}
 body[data-site-scene=plain] .chic-doors :is(.door-research,.door-practice){z-index:2}
}
/* Desktop Classic: separate the cookie a little from the first door. */
@media(min-width:901px){body[data-site-scene=plain] .door-elephant .elephant-cookie{left:46px}}
/* A touch lower on the floor, without moving the Classic desktop elephant. */
@media(min-width:901px){body[data-site-scene=plain] .door-elephant .elephant-cookie{bottom:-32px}}

/* Phone Classic: settle the cookie a little lower. */
@media(max-width:680px){body[data-site-scene=plain] .door-elephant .elephant-cookie{bottom:-21px}}

/* Fine-pointer desktop only. Deform the drawing, not the cookie or the link. */
.door-elephant .elephant-waking{display:none}
@media(min-width:901px) and (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
 .chic-doors .door-elephant{pointer-events:auto!important}
 .door-elephant.is-peeking>img{visibility:hidden}
 .door-elephant.is-peeking>.elephant-waking{
  display:block;position:absolute;inset:0;width:100%;height:100%;pointer-events:none;
 }
 .forest-stage[data-scene=forest] .elephant-waking{filter:drop-shadow(0 1px 1px #142f24)}
 .forest-stage[data-scene=forest] .elephant-waking .elephant-fill{fill:#fff}
 .forest-stage[data-scene=forest] .elephant-waking .elephant-ink{stroke:#fff}
}

/* A small colorful burst rises just as the elephant opens its eye. */
.elephant-confetti-piece{opacity:0}
@media(min-width:901px) and (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
 .door-elephant.is-peeking>.elephant-waking{overflow:visible}
 .door-elephant.is-peeking .elephant-confetti-piece{
  animation:elephant-confetti-rise 1.48s var(--pop-delay) both;
 }
 .forest-stage[data-scene=forest] .elephant-confetti-piece{filter:drop-shadow(0 .8px 1px #142f24)}
}
@keyframes elephant-confetti-rise{
 0%{opacity:0;transform:translate(0,5px);animation-timing-function:ease-out}
 22%{opacity:1}
 58%{opacity:1;animation-timing-function:ease-in}
 100%{opacity:0;transform:translate(var(--drift-x),var(--drift-y))}
}
