/* Snug: the stage header, for the Snug themes that ask for it ('header' => 'stage'). The layout puts "head-stage" on
   <body> and draws, under a top bar that keeps only the search link, the light/dark button and the menu button: the
   author's picture large (or the blog's logo, or a letter), the blog's name and tagline under it, and the menu as a
   dial (dial.js). A theme gives it its character with its own styles; this file is the shape they share.
   --stage-face: the picture's size. --dial-w: how wide the dial may be. --dial-gap: the space between its links.
   --dial-mid: the width of the link in the middle (set by dial.js), for a mark drawn behind it. */
.head-stage{--stage-face:112px;--dial-w:34rem;--dial-gap:clamp(20px,3vw,32px)}
.head-stage.is-home{--stage-face:136px}

/* the top bar: only the buttons, clear until the page is scrolled */
.site-head.stage-bar{pointer-events:none}
.site-head.stage-bar:not(.scrolled){background:transparent;-webkit-backdrop-filter:none;backdrop-filter:none}
.stage-bar .head-tools{margin-left:auto;pointer-events:auto}

.stage{position:relative;margin-top:-30px;padding-bottom:clamp(14px,2.4vw,24px);text-align:center}
.stage-in{display:grid;justify-items:center;gap:clamp(16px,2.4vw,22px)}
.stage-brand{display:grid;justify-items:center;gap:clamp(12px,2vw,18px);min-width:0;max-width:100%;color:var(--ink);text-decoration:none}
.stage-face{display:grid;place-items:center;width:var(--stage-face);height:var(--stage-face);border-radius:50%;overflow:hidden;background:var(--paper-2);box-shadow:0 0 0 1px var(--rule)}
.stage-avatar{display:block;width:100%;height:100%;object-fit:cover}
.stage-mono{color:var(--accent);font:700 calc(var(--stage-face)*.44)/1 var(--font-head);-webkit-user-select:none;user-select:none}
.stage-logo{display:block;width:auto;height:clamp(60px,11vw,96px);max-width:min(78vw,26rem);object-fit:contain}
.stage .brand-text{display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0;max-width:100%;line-height:1.15}
.stage .brand-name{max-width:100%;white-space:normal;overflow:visible;overflow-wrap:anywhere;text-wrap:balance;font-family:var(--font-head);font-weight:700;font-size:clamp(1.9rem,5.2vw,3rem);letter-spacing:-.015em}
.stage .brand-tagline{display:block;max-width:34em;white-space:normal;overflow:visible;-webkit-line-clamp:none;line-clamp:none;text-wrap:balance;color:var(--ink-2);font-size:clamp(.95rem,1.5vw,1.05rem);font-weight:400;line-height:1.45;letter-spacing:0}
.head-stage:not(.is-home) .stage .brand-name{font-size:clamp(1.55rem,3.8vw,2.2rem)}

/* the dial: as the page has it, one row of links that scrolls sideways where it does not fit */
.dial{position:relative;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:4px;width:min(100%,var(--dial-w));font-size:.95rem}
.dial-view{grid-column:2;min-width:0;padding:3px 0;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none}
.dial-view::-webkit-scrollbar{display:none}
.dial-track{position:relative;display:flex;justify-content:safe center;gap:var(--dial-gap);width:max-content;min-width:100%;margin:0;padding:0 var(--dial-gap);list-style:none}
.dial-item{flex:none}
.dial-item a{display:block;padding:10px 2px;color:var(--ink-2);text-decoration:none;white-space:nowrap;border-radius:6px;transition:color .2s}
.dial-item a:hover{color:var(--ink)}
.dial-item a:focus-visible{outline-offset:-1px}
.dial-item.is-current a{color:var(--accent);font-weight:650}
.dial-step{appearance:none;-webkit-appearance:none;display:grid;place-items:center;width:36px;height:36px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--ink-2);cursor:pointer;transition:color .2s,background-color .2s}
.dial-step:hover{background:var(--paper-2);color:var(--ink)}
.dial-prev{grid-column:1}
.dial-next{grid-column:3}

/* turning: the list repeated either side, moved as one, the links fading towards the ends */
.dial.is-live .dial-view{overflow:hidden;touch-action:pan-y;cursor:grab;-webkit-user-select:none;user-select:none;-webkit-mask-image:linear-gradient(90deg,transparent,#000 17%,#000 83%,transparent);mask-image:linear-gradient(90deg,transparent,#000 17%,#000 83%,transparent)}
.dial.is-live .dial-track{justify-content:flex-start;min-width:0;padding:0;will-change:transform}
.dial.is-dragging .dial-view{cursor:grabbing}
.dial.is-live .dial-item.is-centre a{color:var(--ink)}
.dial.is-live .dial-item.is-centre.is-current a{color:var(--accent)}
.dial.is-live::after{content:"";position:absolute;left:50%;bottom:0;width:22px;height:2px;margin-left:-11px;border-radius:2px;background:var(--accent);pointer-events:none} /* the middle of the dial */
@media (prefers-reduced-motion:no-preference){
  .dial.is-live .dial-item{transform:scale(calc(1 - var(--d,0)*.2));opacity:calc(1 - var(--d,0)*.5)}
}

/* phones: a smaller picture under the buttons, the dial for a thumb */
@media (max-width:600px){
  .head-stage{--stage-face:84px;--dial-gap:20px}
  .head-stage.is-home{--stage-face:104px}
  .stage-bar .head-row{min-height:56px}
  .stage{margin-top:-4px}
  .dial-step{display:none}
  .dial{grid-template-columns:0 minmax(0,1fr) 0;gap:0}
  .dial-item a{padding:12px 2px}
}
