/* 좋은얼굴신종연치과의원 — a page with its own scene (art/scenes/CONTRACT.md): the dock (계절 picker + 움직임 멈추기 + 자연의 소리, home's
 * block and css/seasons.css) on a page of text. Loaded with the dock at the page's load event (tools/build-pages.cjs).
 * The page head's own <style> holds what the first paint needs: the instant still and the band (--band = where the first
 * sheet's torn top edge sits).
 *
 * The dock belongs to the picture: it sits in the band, at its lower right just above the torn edge, and scrolls away
 * with the place, so it never lies over the text the reader is reading (home's dock is fixed to the corner; here it is
 * not; while the sound plays and the dock has scrolled away, a 소리 끄기 pill waits in home's corner, css/site.css). Desk:
 * one opaque row. Phone: one round button (wearing a sounding mark while the sound is on) that opens the picker, the motion
 * button and the sound button beside it (on a portrait phone the motion button sits above the sound button), today's
 * season marked by a dot inside its chip rather than a tag above it. z-index 19: as it scrolls up it passes UNDER the fixed
 * site bar (20) and its menu button, never over them; still over the sheets (main, 10). */

#scene[data-scene] ~ .dock { position: absolute; z-index: 19; top: calc(var(--band) - 62px); bottom: auto; visibility: visible;
  right: max(clamp(14px, 3vw, 30px), env(safe-area-inset-right, 0px)); display: flex; flex-direction: row; align-items: center; gap: 10px; }
#scene[data-scene] ~ .dock .dock-open { display: none; }
/* the round button's name is for screen readers only (seasons.css hides .sr inside .seasons alone) */
#scene[data-scene] ~ .dock .dock-open .sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
#scene[data-scene] ~ .dock .dock-panel { display: contents; }
/* opaque paper: nothing of the picture ghosts through the controls */
#scene[data-scene] ~ .dock .seasons, #scene[data-scene] ~ .dock #sound, #scene[data-scene] ~ .dock #motion,
#scene[data-scene] ~ .dock .dock-open { background: #F3E9D7; }
#scene[data-scene] ~ .dock #sound[aria-pressed="true"] { background: #3B3530; color: #F7EFE0; }
/* the sound is on: the phone's round button wears a small sounding speaker, so the state shows with the panel shut */
#scene[data-scene] ~ .dock .dock-open { position: relative; }
#scene[data-scene] ~ .dock.sounding .dock-open::after { content: ""; position: absolute; top: -4px; right: -4px; width: 22px; height: 22px;
  border-radius: 50%; box-shadow: 0 0 0 2px #F3E9D7; background: #3B3530 no-repeat center / 16px
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F7EFE0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9.5h3.2L12 5.5v13l-4.8-4H4z'/%3E%3Cpath d='M15.5 9a4.2 4.2 0 0 1 0 6'/%3E%3Cpath d='M18.2 6.5a8 8 0 0 1 0 11'/%3E%3C/svg%3E"); }
#scene[data-scene] ~ .dock .s-today { background: #F3E9D7; }
/* the sound credit is the footer sheet's last paragraph now (page.css), not a box of its own under it; the page keeps the
   length it had, so a short page (404) still scrolls far enough for its camera to reach the reading view's mist */
#scene[data-scene] ~ .site-footer { padding-bottom: calc(clamp(28px, 4vw, 52px) + 56px); }
/* the keyboard ring: pine on a hanji halo, never on the painted scene alone (WCAG 1.4.11; css/seasons.css) */
#scene[data-scene] ~ .dock :is(#sound, #motion, .dock-open):focus-visible { outline: 3px solid var(--pine); outline-offset: 2px;
  box-shadow: 0 0 0 7px #F3E9D7, 0 8px 24px -10px rgba(40, 30, 20, .5); }

/* phones, tablets and a phone on its side: one round button; the panel opens to its left, the seasons on top and the motion
   and sound buttons on the round button's own line (one row of all four ran off a 320 px screen). Tablets too:
   the desk row (about 400 px wide) would lie across the establishing view's focal point (the hub: the gate's arch) */
@media (max-width: 1099px), (orientation: landscape) and (max-height: 460px) {
  #scene[data-scene] ~ .dock { gap: 8px; }
  #scene[data-scene] ~ .dock .dock-open { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px;
    padding: 0; border: 0; border-radius: 50%; color: var(--ink); cursor: pointer;
    box-shadow: 0 8px 24px -10px rgba(40, 30, 20, .5), inset 0 0 0 1px rgba(43, 38, 34, .18); }
  #scene[data-scene] ~ .dock .dock-open svg { width: 24px; height: 24px; }
  #scene[data-scene] ~ .dock.open .dock-open { background: rgba(43, 38, 34, .86); color: #F7EFE0; }
  #scene[data-scene] ~ .dock .dock-panel { display: none; }
  #scene[data-scene] ~ .dock.open .dock-panel { display: grid; position: absolute; right: 56px; top: auto; bottom: 0;
    grid-template-columns: auto auto; justify-content: end; justify-items: end; align-items: center; gap: 6px; }
  #scene[data-scene] ~ .dock .seasons { grid-column: 1 / -1; flex-direction: row; border-radius: 999px; }
  #scene[data-scene] ~ .dock .s-label { display: none; }
  #scene[data-scene] ~ .dock .s-chip { min-width: 44px; padding: 0 8px; font-size: 15px; }
  #scene[data-scene] ~ .dock #sound { width: 48px; min-width: 0; height: 48px; justify-content: center; padding: 0; }
  #scene[data-scene] ~ .dock #sound span { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  /* 오늘: a dot inside today's chip (its word stays for screen readers) */
  #scene[data-scene] ~ .dock .s-today { left: auto; right: 5px; top: 6px; bottom: auto; transform: none; width: 7px; height: 7px;
    padding: 0; overflow: hidden; font-size: 0; color: transparent; background: var(--persimmon, #C8502D); box-shadow: none; }
}
@media (max-width: 359px) {
  #scene[data-scene] ~ .dock .s-chip { min-width: 44px; padding: 0 5px; font-size: 14px; }
  #scene[data-scene] ~ .dock.open .dock-panel { right: 52px; gap: 4px; }
}
