/* ==========================================================================
   Mielovia Honeysphere 1.3.0 (plugin) · illustrated world buttons, world view
   and an orbit across the full width (1.3.0), or framed above the buttons
   (1.2.0) when the theme's 3D file is not the one the plugin has a copy of.
   The theme's twelve text buttons (#worldList) become honey-glass lenses that
   hold the picture of their world, with the world's name under them. When a
   world is open, its panel no longer covers it: the name sits on one side of the
   world and its text and buttons on the other (above and below it on tall
   screens). In the overview the orbit is scaled about the honey core and lifted
   (.hsw-fit, values from the script), so no world runs into the row of worlds.
   Every rule waits for #honeysphere.hsw-on (buttons built), .hsw-wv (panel
   grouped) or .hsw-fit (orbit framed), set by the script, so the theme's own
   layout shows until then (and if the script stops).
   ========================================================================== */

/* The framing values glide while the camera flies to a world and back. */
@property --hsw-s{syntax:"<number>";inherits:true;initial-value:1}
@property --hsw-t{syntax:"<length>";inherits:true;initial-value:0px}
@property --hsw-fa{syntax:"<length>";inherits:true;initial-value:0px}
@property --hsw-fb{syntax:"<length>";inherits:true;initial-value:0px}
@property --hsw-fo{syntax:"<number>";inherits:true;initial-value:0}
@property --hsw-ft{syntax:"<length>";inherits:true;initial-value:0px}
@property --hsw-ex{syntax:"<percentage>";inherits:true;initial-value:0%}

/* Until the orbit is framed: under the row of lenses it fades into the page,
   so a world passing at the front sinks softly behind them. */
#honeysphere.hsw-on #sphereCanvas,
#honeysphere.hsw-on .sphere-labels{
  -webkit-mask-image:linear-gradient(#000 calc(100% - var(--hsw-reserve,0px) - 56px),rgba(0,0,0,.16) calc(100% - var(--hsw-reserve,0px) + 18px),rgba(0,0,0,.16));
  mask-image:linear-gradient(#000 calc(100% - var(--hsw-reserve,0px) - 56px),rgba(0,0,0,.16) calc(100% - var(--hsw-reserve,0px) + 18px),rgba(0,0,0,.16));
}
#honeysphere.hsw-on .sphere-ui{padding-bottom:14px}

/* The orbit framed (1.2.0): the canvas is scaled about the honey core
   (--hsw-oy) and lifted (--hsw-t), so the lowest point a world reaches stays
   clear of the lenses. Its edges fade into the page: the top and the sides when
   the scaled canvas no longer reaches them, the bottom just above the lenses.
   The labels follow the canvas (the theme places them from the canvas's drawn
   box) and fade out just above the lenses. In the world view the orbit is the
   theme's again (scale 1), with the fade of 1.1.x under the row. */
#honeysphere.hsw-fit #sphereCanvas{
  transform-origin:50% var(--hsw-oy,54.5%);
  transform:translateY(var(--hsw-t)) scale(var(--hsw-s));
  -webkit-mask-image:linear-gradient(transparent,#000 var(--hsw-ft),#000 var(--hsw-fa),rgba(0,0,0,var(--hsw-fo)) var(--hsw-fb),rgba(0,0,0,var(--hsw-fo))),linear-gradient(90deg,transparent,#000 var(--hsw-ex),#000 calc(100% - var(--hsw-ex)),transparent);
  mask-image:linear-gradient(transparent,#000 var(--hsw-ft),#000 var(--hsw-fa),rgba(0,0,0,var(--hsw-fo)) var(--hsw-fb),rgba(0,0,0,var(--hsw-fo))),linear-gradient(90deg,transparent,#000 var(--hsw-ex),#000 calc(100% - var(--hsw-ex)),transparent);
  -webkit-mask-composite:source-in;mask-composite:intersect;
}
#honeysphere.hsw-fit .sphere-labels{
  transform:translate(calc(50% * (1 - var(--hsw-s))),calc(var(--hsw-oy,0px) * (1 - var(--hsw-s)) + var(--hsw-t)));
  -webkit-mask-image:linear-gradient(#000 calc(var(--hsw-lf,100%) - 16px),transparent var(--hsw-lf,100%));
  mask-image:linear-gradient(#000 calc(var(--hsw-lf,100%) - 16px),transparent var(--hsw-lf,100%));
}
/* Behind the scaled canvas, a ground in the colour of its own darkened edges, so
   the page around the orbit reads as one night. It fades into the section above
   and, from just above the lenses, into the section below. */
.hsw-back{display:none}
#honeysphere.hsw-fit .hsw-back{
  display:block;position:absolute;inset:0;pointer-events:none;background:#070403;
  -webkit-mask-image:linear-gradient(transparent,#000 14%,#000 var(--hsw-bf,86%),transparent var(--hsw-bl,100%));
  mask-image:linear-gradient(transparent,#000 14%,#000 var(--hsw-bf,86%),transparent var(--hsw-bl,100%));
}
#honeysphere.hsw-fit.hsw-anim{
  transition:--hsw-s 1.4s cubic-bezier(.65,0,.35,1),--hsw-t 1.4s cubic-bezier(.65,0,.35,1),--hsw-fa 1.4s cubic-bezier(.65,0,.35,1),
    --hsw-fb 1.4s cubic-bezier(.65,0,.35,1),--hsw-fo 1.4s cubic-bezier(.65,0,.35,1),--hsw-ft 1.4s cubic-bezier(.65,0,.35,1),--hsw-ex 1.4s cubic-bezier(.65,0,.35,1);
}

/* Zoom: two small lenses, quiet until hovered. */
#honeysphere.hsw-on .zoom-ctrls .icon-btn{
  width:44px;height:44px;border:0;color:var(--cream);font-size:1.1rem;
  background:radial-gradient(circle at 50% 32%,#2e1f11 0%,#150e08 70%);
  box-shadow:inset 0 0 0 1px rgba(216,178,110,.26),0 10px 22px -12px rgba(0,0,0,.9);
  transition:box-shadow .3s var(--ease),color .3s var(--ease);
}
#honeysphere.hsw-on .zoom-ctrls .icon-btn:hover{color:var(--gold);box-shadow:inset 0 0 0 1px var(--gold),0 0 0 5px rgba(216,178,110,.08)}
#honeysphere.hsw-on .zoom-ctrls .icon-btn:focus-visible{outline:none;box-shadow:inset 0 0 0 1px var(--gold),0 0 0 2px var(--ink),0 0 0 4px var(--gold)}

/* The row of worlds. One line; it scrolls sideways when the window is narrower. */
#honeysphere.hsw-on .world-list{
  position:relative;display:flex;flex-wrap:nowrap;justify-content:flex-start;gap:clamp(2px,.5vw,8px);
  justify-self:center;max-width:min(1320px,100%);margin:0;padding:6px 10px 4px;
  overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scroll-padding-inline:10px;
  scrollbar-width:none;-webkit-overflow-scrolling:touch;
}
#honeysphere.hsw-on .world-list::-webkit-scrollbar{display:none}
#honeysphere.hsw-on .world-list>li{flex:0 0 auto;scroll-snap-align:start}
@media (min-width:1440px){#honeysphere.hsw-on .world-list{gap:12px}}
#honeysphere.hsw-on .world-list.hsw-scroll{
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 40px,#000 calc(100% - 40px),transparent);
  mask-image:linear-gradient(90deg,transparent,#000 40px,#000 calc(100% - 40px),transparent);
}
#honeysphere.hsw-on .world-list.hsw-scroll.hsw-at-start{
  -webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 40px),transparent);
  mask-image:linear-gradient(90deg,#000 calc(100% - 40px),transparent);
}
#honeysphere.hsw-on .world-list.hsw-scroll.hsw-at-end{
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 40px);
  mask-image:linear-gradient(90deg,transparent,#000 40px);
}

/* One world: its lens, then its name. */
#honeysphere.hsw-on .world-list button{
  position:relative;display:grid;justify-items:center;align-content:start;gap:9px;
  width:88px;min-height:0;margin:0;padding:6px 2px 12px;
  border:0;border-radius:16px;background:transparent;color:var(--cream);
  font-family:var(--f-display);font-size:.9rem;font-weight:400;font-variation-settings:"SOFT" 100,"opsz" 24;
  letter-spacing:0;text-transform:none;line-height:1.15;
  -webkit-backdrop-filter:none;backdrop-filter:none;cursor:pointer;-webkit-tap-highlight-color:transparent;
  transition:color .3s var(--ease);
}
#honeysphere.hsw-on .world-list button:hover{background:transparent;border-color:transparent;color:var(--ivory)}
#honeysphere.hsw-on .world-list button[aria-pressed=true]{background:transparent;border-color:transparent;color:var(--amber);font-style:italic}
#honeysphere.hsw-on .world-list button:focus-visible{outline:none}
#honeysphere.hsw-on .world-list button:focus-visible .hsw-orb{box-shadow:inset 0 0 0 1px var(--gold),0 0 0 2px var(--ink),0 0 0 4px var(--gold)}
.hsw-name{white-space:nowrap}

/* The lens: a bead of dark honey glass with a gold rim and a highlight. */
.hsw-orb{
  position:relative;display:grid;place-items:center;width:60px;height:60px;border-radius:50%;
  background:radial-gradient(circle at 50% 36%,#3d2814 0%,#1d130b 58%,#0f0a06 100%);
  box-shadow:inset 0 0 0 1px rgba(216,178,110,.30),inset 0 -12px 18px rgba(0,0,0,.5),0 12px 24px -14px rgba(0,0,0,.95);
  transition:box-shadow .45s var(--ease),transform .45s var(--ease),background .45s var(--ease);
}
.hsw-orb::after{
  content:"";position:absolute;inset:0;border-radius:50%;pointer-events:none;
  background:radial-gradient(110% 70% at 50% -12%,rgba(255,234,196,.18),rgba(255,234,196,0) 56%);
}
.hsw-orb img{
  position:absolute;left:12%;top:12%;display:block;width:76%;height:76%;max-width:none;object-fit:contain;
  filter:drop-shadow(0 5px 6px rgba(0,0,0,.6));
  transition:transform .55s var(--ease);
  -webkit-user-drag:none;user-select:none;
}
.hsw-orb.hsw-none::before{
  content:"";width:34%;height:39%;
  background:linear-gradient(160deg,#f4d27f,#b8802e);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 86.6 100'%3E%3Cpath d='M43.3 0 86.6 25v50L43.3 100 0 75V25z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 86.6 100'%3E%3Cpath d='M43.3 0 86.6 25v50L43.3 100 0 75V25z'/%3E%3C/svg%3E") center/contain no-repeat;
  opacity:.7;
}
#honeysphere.hsw-on .world-list button:hover .hsw-orb{
  transform:translateY(-3px);
  box-shadow:inset 0 0 0 1px rgba(244,210,127,.8),inset 0 -12px 18px rgba(0,0,0,.45),0 0 0 5px rgba(216,178,110,.07),0 16px 26px -14px rgba(0,0,0,.95);
}
#honeysphere.hsw-on .world-list button:hover .hsw-orb img{transform:scale(1.1) rotate(-4deg)}
/* The open world: light comes through the honey. */
#honeysphere.hsw-on .world-list button[aria-pressed=true] .hsw-orb{
  background:radial-gradient(circle at 50% 38%,#7a4c19 0%,#2c1b0c 62%,#120c07 100%);
  box-shadow:inset 0 0 0 1.5px var(--amber),0 0 0 4px rgba(227,155,50,.13),0 0 28px rgba(227,155,50,.36);
}
#honeysphere.hsw-on .world-list button[aria-pressed=true] .hsw-orb img{transform:scale(1.12)}
#honeysphere.hsw-on .world-list button[aria-pressed=true]::after{
  content:"";position:absolute;left:50%;bottom:2px;width:4px;height:4px;margin-left:-2px;border-radius:50%;
  background:var(--amber);box-shadow:0 0 8px var(--amber);
}

/* The title follows the height of the screen too, so on laptop screens the
   orbit keeps its size between the heading and the row of worlds. Short screens
   (up to 800 px tall, from 601 px wide) get a tighter heading and row. Logged-in
   admins see the section under the 32 px admin bar: it is 32 px shorter, so the
   row of worlds is in view with the orbit (the tighter layout up to 832 px). */
@media (min-width:601px){
  #honeysphere.hsw-on .sphere-head .h-xl{font-size:min(var(--s-4),max(2.4rem,9.6vh))}
}
@media (min-width:783px){
  body.admin-bar #honeysphere{height:calc(100vh - 32px);height:calc(100svh - 32px)}
}
@media (max-height:800px) and (min-width:601px){
  #honeysphere.hsw-on .sphere-ui{padding-bottom:8px}
  #honeysphere.hsw-on .sphere-head{gap:9px}
  #honeysphere.hsw-on .world-list button{gap:7px;padding:4px 2px 10px}
  #honeysphere.hsw-on .hsw-orb{width:52px;height:52px}
}
@media (max-height:832px) and (min-width:783px){
  body.admin-bar #honeysphere.hsw-on .sphere-ui{padding-bottom:8px}
  body.admin-bar #honeysphere.hsw-on .sphere-head{gap:9px}
  body.admin-bar #honeysphere.hsw-on .world-list button{gap:7px;padding:4px 2px 10px}
  body.admin-bar #honeysphere.hsw-on .hsw-orb{width:52px;height:52px}
}

@media (max-width:1200px){
  #honeysphere.hsw-on .world-list button{width:78px;font-size:.84rem;gap:8px}
  .hsw-orb{width:54px;height:54px}
}
@media (max-width:1100px) and (min-width:761px){
  #honeysphere.hsw-on .world-list button{width:70px;font-size:.8rem}
  .hsw-orb{width:50px;height:50px}
}
@media (max-width:760px){
  #honeysphere.hsw-on .world-list{padding:4px 6px 2px;gap:0}
  #honeysphere.hsw-on .world-list button{width:74px;font-size:.8rem;gap:7px;padding:5px 2px 11px}
  .hsw-orb{width:50px;height:50px}
}

/* ==========================================================================
   World view: a world is open (.hsw-view). The theme has flown the camera to
   it, so it fills the middle of the orbit; the section's heading, the zoom
   lenses and the orbit's labels step back, and the panel frames the world.
   ========================================================================== */
#honeysphere.hsw-wv .sphere-head,
#honeysphere.hsw-wv .zoom-ctrls,
#honeysphere.hsw-wv .sphere-labels{transition:opacity .45s var(--ease),visibility .45s,transform .6s var(--ease)}
#honeysphere.hsw-view .sphere-head{opacity:0;visibility:hidden;transform:translateY(-14px)}
#honeysphere.hsw-view .zoom-ctrls,
#honeysphere.hsw-view .sphere-labels{opacity:0;visibility:hidden}

#honeysphere.hsw-wv .world-panel{
  position:absolute;left:0;right:0;grid-area:auto;justify-self:stretch;align-self:start;margin:0;width:auto;max-width:none;
  padding:0 var(--gutter);gap:0;background:none;border:0;border-radius:0;
  -webkit-backdrop-filter:none;backdrop-filter:none;
  display:grid;justify-items:stretch;align-items:center;text-align:start;
  pointer-events:none;isolation:isolate;container-type:inline-size;
}
#honeysphere.hsw-wv .world-panel .actions{pointer-events:auto;margin:0;gap:10px}
#honeysphere.hsw-wv .world-panel .btn{white-space:nowrap}
#honeysphere.hsw-wv .world-panel .btn-ghost{background:rgba(11,8,6,.62)}
#honeysphere.hsw-wv .world-panel .btn-ghost:hover{background:#2a1f12}
#honeysphere.hsw-wv #wpKicker{margin:0;color:var(--gold);text-shadow:0 1px 14px rgba(11,8,6,.95),0 0 4px rgba(11,8,6,.7)}
#honeysphere.hsw-wv #wpTitle{
  margin:0;font-family:var(--f-display);font-weight:340;line-height:.98;letter-spacing:-.012em;color:var(--ivory);
  font-variation-settings:"SOFT" 100,"opsz" 144;text-wrap:balance;
  text-shadow:0 2px 28px rgba(11,8,6,.85);
}
#honeysphere.hsw-wv #wpText{
  margin:0;color:var(--cream);font-size:var(--s-0);line-height:1.62;text-wrap:pretty;
  text-shadow:0 1px 16px rgba(11,8,6,.9);
}

/* Wide screens: the name on the left of the world, its text and buttons on the
   right, both on the world's centre line and turned towards it. */
#honeysphere.hsw-side .world-panel{
  top:var(--hsw-cy,54.5%);transform:translateY(-50%);
  grid-template-columns:minmax(0,1fr) var(--hsw-gap,40%) minmax(0,1fr);grid-template-areas:"l . r";
  transition:grid-template-columns .8s var(--ease);
}
#honeysphere.hsw-side .hsw-l{grid-area:l;justify-self:end;display:grid;justify-items:end;gap:16px;max-width:100%;text-align:right}
#honeysphere.hsw-side .hsw-r{grid-area:r;justify-self:start;display:grid;justify-items:start;gap:22px;max-width:min(100%,32ch)}
#honeysphere.hsw-side #wpTitle{font-size:clamp(2.3rem,1.25rem + 2.9vw,4.1rem);font-size:min(clamp(2.3rem,1.25rem + 2.9vw,4.1rem),calc((100cqi - var(--hsw-gap,400px)) / 10.8))}
#honeysphere.hsw-side .world-panel .actions{justify-content:flex-start}
#honeysphere.hsw-side .hsw-l,
#honeysphere.hsw-side .hsw-r{position:relative}
#honeysphere.hsw-side .hsw-l::before,
#honeysphere.hsw-side .hsw-r::before{
  content:"";position:absolute;z-index:-1;pointer-events:none;
  background:radial-gradient(closest-side,rgba(11,8,6,.86),rgba(11,8,6,.6) 58%,rgba(11,8,6,0));
}
#honeysphere.hsw-side .hsw-l::before{inset:-44px -26px -44px -64px}
#honeysphere.hsw-side .hsw-r::before{inset:-44px -64px -44px -26px}

/* Tall or narrow screens: the name and text above the world, the buttons
   below it, just over the row of worlds. */
#honeysphere.hsw-stack .world-panel{
  top:calc(var(--nav-h,64px) + 20px);bottom:calc(var(--hsw-reserve,110px) + 6px);align-self:stretch;
  grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto 1fr auto;grid-template-areas:"k" "t" "x" "." "a";
  justify-items:center;align-items:start;text-align:center;
}
#honeysphere.hsw-stack .hsw-l,
#honeysphere.hsw-stack .hsw-r{display:contents}
#honeysphere.hsw-stack #wpKicker{grid-area:k}
#honeysphere.hsw-stack #wpTitle{grid-area:t;margin-top:10px;font-size:clamp(2rem,1.3rem + 3vw,3rem);font-size:min(clamp(2rem,1.3rem + 3vw,3rem),calc(100cqi / 5.6))}
#honeysphere.hsw-stack #wpText{grid-area:x;margin-top:12px;max-width:38ch}
#honeysphere.hsw-stack .world-panel .actions{grid-area:a;justify-content:center;align-self:end}
#honeysphere.hsw-stack .world-panel::before{
  content:"";grid-area:1 / 1 / 4 / 2;justify-self:stretch;align-self:stretch;z-index:-1;margin:-36px -16px -48px;pointer-events:none;
  background:radial-gradient(closest-side,rgba(11,8,6,.9),rgba(11,8,6,.66) 60%,rgba(11,8,6,0));
}

/* Arrival: the two sides open out from the world as the camera reaches it. */
@keyframes hsw-l{from{opacity:0;transform:translateX(30px)}}
@keyframes hsw-r{from{opacity:0;transform:translateX(-30px)}}
@keyframes hsw-t{from{opacity:0;transform:translateY(-12px)}}
@keyframes hsw-b{from{opacity:0;transform:translateY(12px)}}
@keyframes hsw-o{from{opacity:0}}
#honeysphere.hsw-side.hsw-enter .hsw-l{animation:hsw-l .9s .3s var(--ease) both}
#honeysphere.hsw-side.hsw-enter .hsw-r{animation:hsw-r .9s .42s var(--ease) both}
#honeysphere.hsw-stack.hsw-enter #wpKicker,
#honeysphere.hsw-stack.hsw-enter #wpTitle,
#honeysphere.hsw-stack.hsw-enter #wpText{animation:hsw-t .8s .3s var(--ease) both}
#honeysphere.hsw-stack.hsw-enter .world-panel::before{animation:hsw-o .8s .25s both}
#honeysphere.hsw-stack.hsw-enter .world-panel .actions{animation:hsw-b .8s .45s var(--ease) both}

@media (prefers-reduced-motion:reduce){
  .hsw-orb,.hsw-orb img,#honeysphere.hsw-on .world-list button{transition:none}
  #honeysphere.hsw-on .world-list button:hover .hsw-orb,#honeysphere.hsw-on .world-list button:hover .hsw-orb img,
  #honeysphere.hsw-on .world-list button[aria-pressed=true] .hsw-orb img{transform:none}
  #honeysphere.hsw-wv .sphere-head,#honeysphere.hsw-wv .zoom-ctrls,#honeysphere.hsw-wv .sphere-labels,
  #honeysphere.hsw-side .world-panel,#honeysphere.hsw-fit.hsw-anim{transition:none}
  #honeysphere.hsw-view .sphere-head{transform:none}
  #honeysphere.hsw-enter .hsw-l,#honeysphere.hsw-enter .hsw-r,#honeysphere.hsw-enter #wpKicker,#honeysphere.hsw-enter #wpTitle,
  #honeysphere.hsw-enter #wpText,#honeysphere.hsw-enter .world-panel::before,#honeysphere.hsw-enter .world-panel .actions{animation:none}
}


/* ==========================================================================
   Full width (1.3.0, .hsw-wide): the scene itself spreads the orbit across
   the width and presses it into the band between the heading and the row of
   worlds, so the canvas is neither scaled nor lifted. Nothing comes down to
   the row any more: the canvas only dims behind it. While a world is open the
   1.1.x fade under the row applies (worlds still pass there).
   The zoom lenses move beside the row of worlds when there is room
   (.hsw-zrow), clear of the orbit that now reaches the sides.
   ========================================================================== */
#honeysphere.hsw-wide:not(.hsw-view) #sphereCanvas,
#honeysphere.hsw-wide:not(.hsw-view) .sphere-labels{
  -webkit-mask-image:linear-gradient(#000 calc(100% - var(--hsw-reserve,0px) - 4px),rgba(0,0,0,.42) calc(100% - var(--hsw-reserve,0px) + 34px),rgba(0,0,0,.42));
  mask-image:linear-gradient(#000 calc(100% - var(--hsw-reserve,0px) - 4px),rgba(0,0,0,.42) calc(100% - var(--hsw-reserve,0px) + 34px),rgba(0,0,0,.42));
}

#honeysphere.hsw-zrow .zoom-ctrls{left:var(--hsw-zl);right:var(--hsw-zr);top:var(--hsw-zy)}

/* The theme draws the orbit's names at the canvas's top left corner until its first frame places them; they stay
   hidden until then (the theme's inline opacity of each frame shows them). */
#honeysphere .sphere-labels .w-label:not([style*="opacity"]){opacity:0}
