/*
 * © 2026 Code Precision. All rights reserved.
 * Copying, redistribution, modification, extraction, or reuse of this Code Precision-authored file,
 * in whole or substantial part, is prohibited without prior express written permission from Code Precision.
 * No permission is granted for AI/ML training, fine-tuning, dataset creation, text/data mining,
 * embedding/index construction for generative systems, synthetic-data generation, or image-model training.
 * NoAI · NoAIImage · NoMLTraining
 */
/* ==========================================================
   Constellation Dial — compact Three.js case switcher
   Named system stylesheet for the popup navigation control.
   Loaded after case styles so the feature can be understood and edited
   independently from case story layouts.

   Debug / code element names:
   - dial root: .constellation-dial
   - ambient fog / mobile darkening layer: .constellation-dial::before
   - secondary ambient fog: .constellation-dial::after
   - title badge / mobile project title: .constellation-dial__label
   - aura / viewport: .constellation-dial__viewport
   - dial aura spot: .constellation-dial__debug-aura-spot
   - inner orbit guide: .constellation-dial__viewport::before
   - center guide line: .constellation-dial__viewport::after
   - three.js wheel canvas: .constellation-dial canvas
   - prev hit zone: .constellation-dial__hit--prev
   - next hit zone: .constellation-dial__hit--next
   - touchpoints ring: .constellation-dial__dots
   - touchpoint / selected state: .constellation-dial__dot / .is-selected
   - bottom project title: .constellation-dial__preview
   - abort zone: .constellation-dial__cancel
   - keyboard hint: .constellation-dial__keyboard-hint
   ========================================================== */
/* Shared fixed-position offset: the dial, the external "?" button and the
   help tip are siblings, so the coordinate token must live above all of them. */
:root {
  --constellation-dial-narrow-desktop-shift: 0px;
  --constellation-dial-panel-offset: calc(
    max(clamp(54px, 4.6vw, 82px), calc((100vw - 1360px) / 2 + clamp(54px, 4.6vw, 82px)))
    + var(--constellation-dial-narrow-desktop-shift)
  );
}

/* On compact desktop widths the title badge and the panel-level close button
   otherwise share the same top-right space. Move the complete Dial group —
   including its help trigger and tip — rather than shrinking or offsetting
   individual children, so interaction geometry and internal alignment stay
   unchanged. The stacked/mobile layout and wider desktops are untouched. */
@media only screen and (orientation: landscape) and (min-width: 1024px) and (max-width: 1366px) and (min-height: 600px) {
  :root {
    --constellation-dial-narrow-desktop-shift: 44px;
  }
}

/* ELEMENT: dial root — fixed-position wrapper for the whole navigation control. */
.constellation-dial {
  --constellation-dial-accent: #66ccff;
  --constellation-dial-fixed-accent: var(--constellation-dial-accent);
  --constellation-dial-glow: #d4f7ff;
  --constellation-dial-aura: var(--constellation-dial-glow);
  position: fixed;
  top: calc(38px + clamp(22px, 2.2vw, 34px));
  right: var(--constellation-dial-panel-offset);
  z-index: 10036;
  display: grid;
  grid-template-rows: auto auto auto;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 10px;
  width: clamp(132px, 10.8vw, 178px);
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(238, 248, 255, 0.86);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, -8px, 0) scale(0.96);
  transition: opacity 0.28s ease, transform 0.28s ease, filter 0.28s ease;
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  overflow: visible;
  isolation: isolate;
}

.constellation-dial:focus {
  outline: none;
}

.constellation-dial__sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ELEMENT: ambient fog / mobile darkening layer — color aura on desktop, horizontal darkening layer on mobile. */
.constellation-dial::before,
/* ELEMENT: secondary ambient fog — secondary soft aura layer on desktop; hidden on mobile darkening mode. */
.constellation-dial::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 0;
  width: clamp(190px, 15.5vw, 270px);
  height: clamp(138px, 11.4vw, 198px);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: screen;
  filter: blur(18px) saturate(1.08);
  transform: translate3d(-50%, -50%, 0) rotate(-16deg) scale(0.92);
  background:
    radial-gradient(ellipse at 46% 48%, color-mix(in srgb, var(--constellation-dial-aura) 36%, transparent) 0 18%, transparent 56%),
    radial-gradient(ellipse at 63% 44%, color-mix(in srgb, var(--constellation-dial-glow) 24%, transparent) 0 14%, transparent 52%),
    radial-gradient(ellipse at 35% 62%, color-mix(in srgb, var(--constellation-dial-aura) 20%, transparent) 0 12%, transparent 48%);
  animation: case-dial-fog-drift 5.8s ease-in-out infinite alternate;
}

.constellation-dial::after {
  width: clamp(160px, 12.4vw, 224px);
  height: clamp(112px, 8.8vw, 164px);
  opacity: 0.14;
  filter: blur(24px) saturate(1.16);
  transform: translate3d(-46%, -42%, 0) rotate(21deg) scale(0.86);
  animation-duration: 7.2s;
  animation-direction: alternate-reverse;
}

.constellation-dial:hover::before,
.constellation-dial:focus-visible::before,
.constellation-dial.is-keyboard-open::before,
.constellation-dial.is-mouse-open::before,
.constellation-dial.is-swiping::before {
  opacity: 0.34;
}


.constellation-dial.is-activating::before {
  opacity: 0.58;
  filter: blur(16px) saturate(1.28) brightness(1.08);
  animation-duration: 1.45s;
}

.constellation-dial.is-activating::after {
  opacity: 0.32;
  filter: blur(26px) saturate(1.32) brightness(1.1);
  animation-duration: 1.15s;
}

@keyframes case-dial-fog-drift {
  0% { transform: translate3d(-53%, -50%, 0) rotate(-18deg) scale(0.88); }
  48% { transform: translate3d(-49%, -53%, 0) rotate(-9deg) scale(1.02); }
  100% { transform: translate3d(-45%, -47%, 0) rotate(7deg) scale(0.94); }
}


.case-overlay > .constellation-dial,
body > .constellation-dial {
  position: fixed;
}

.constellation-dial.is-visible {
  opacity: 0.88;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
}

/* During an inter-case tiled transition the Dial is already an established
   navigation instrument and must remain visually continuous. First-open reveal
   still owns the frame because that lifecycle carries .is-dial-deferred. */
.case-overlay.is-resolving:not(.is-dial-deferred) > .constellation-dial.is-visible {
  z-index: 10064;
}

.case-overlay.is-resolving:not(.is-dial-deferred) > .constellation-dial__help.is-visible,
.case-overlay.is-resolving:not(.is-dial-deferred) > .constellation-dial__help-tip.is-visible {
  z-index: 10065;
}

/* Developer presentation walkthrough. Lift the live production Dial above the
   capture surface and give it a larger demo-only presentation scale. The
   renderer, interaction states, and production geometry outside this mode stay
   untouched; only the capture transform changes. */
.constellation-dial.is-demo-presenting {
  z-index: 10056;
  pointer-events: none;
  transform: translate3d(var(--constellation-demo-x, 0px), var(--constellation-demo-y, 0px), 0)
    scale(var(--constellation-demo-scale, 1));
  transition: none;
}

/* First case-open onboarding. The live dial is translated from its authored
   fixed anchor to the viewport centre, enlarged, demonstrated, then the class
   is removed so it travels directly back to the real desktop/mobile position. */
.constellation-dial.is-first-use-demo {
  z-index: 10056;
  opacity: 1;
  pointer-events: none;
  transform: translate3d(var(--constellation-intro-x, 0px), var(--constellation-intro-y, 0px), 0)
    scale(var(--constellation-intro-scale, 1.5));
  /* Keep the WebGL child on its own sharp layer. A filter on this transformed
     ancestor makes browsers rasterise the whole dial before scaling it. */
  filter: none;
  transition:
    opacity 0.24s ease,
    transform 0.72s cubic-bezier(0.18, 0.82, 0.22, 1),
    filter 0.28s ease;
}

.constellation-dial.is-first-use-settling {
  transition:
    opacity 0.24s ease,
    transform 0.76s cubic-bezier(0.18, 0.82, 0.22, 1),
    filter 0.32s ease;
}

.constellation-dial.is-first-use-demo::before {
  opacity: 0.7;
  filter: blur(10px) saturate(1.28) brightness(1.12);
  animation: none;
}

.constellation-dial.is-first-use-demo::after {
  opacity: 0.38;
  filter: blur(14px) saturate(1.28) brightness(1.1);
  animation: none;
}

.constellation-dial.is-first-use-demo .constellation-dial__viewport {
  /* Brightness/saturation filters flatten the canvas into the transformed
     compositor layer. Glow lives in box-shadow instead, preserving detail. */
  filter: none;
  box-shadow:
    inset 0 0 24px color-mix(in srgb, var(--constellation-dial-aura) 30%, transparent),
    0 0 25px color-mix(in srgb, var(--constellation-dial-aura) 46%, transparent);
  animation: none;
}

.constellation-dial.is-first-use-demo .constellation-dial__label {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translate3d(0, -4px, 0) scale(0.96) !important;
  transition-delay: 0s !important;
}

/* Abort belongs to a real live swipe. The onboarding only previews the ring
   and always restores the original case, so showing Abort during that staged
   gesture is both noisy and misleading. Preserve its grid row to avoid a
   geometry jump, but remove the control visually and semantically. */
.constellation-dial.is-first-use-demo .constellation-dial__cancel {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.case-overlay::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 10055;
  background:
    radial-gradient(circle at 50% 47%, rgba(7, 15, 34, 0.16) 0 18%, rgba(2, 5, 14, 0.60) 62%, rgba(1, 3, 10, 0.72) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.34s ease;
}

.case-overlay.is-first-use-dial-demo::after {
  opacity: 1;
  pointer-events: auto;
}

.constellation-dial:hover,
.constellation-dial:focus-visible,
.constellation-dial.is-activating {
  opacity: 1;
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--constellation-dial-accent) 58%, transparent));
}

@media only screen and (orientation: landscape) and (min-width: 1024px) and (min-height: 600px) {
  .constellation-dial.is-visible {
    opacity: 1;
    filter: drop-shadow(0 0 14px color-mix(in srgb, var(--constellation-dial-accent) 58%, transparent));
  }

  .constellation-dial.is-visible:not(.is-first-use-demo)::before {
    opacity: 0.39;
  }

  .constellation-dial.is-visible:not(.is-first-use-demo)::after {
    opacity: 0.17;
  }

  .constellation-dial.is-visible .constellation-dial__viewport {
    filter: brightness(1.08) saturate(1.04);
  }

  .constellation-dial.is-visible.is-first-use-demo {
    filter: none;
  }

  .constellation-dial.is-visible.is-first-use-demo::before {
    opacity: 0.7;
  }
}

/* ELEMENT: aura / viewport — circular CSS aura around the Three.js wheel canvas. */
.constellation-dial.is-mouse-open .constellation-dial__viewport,
.constellation-dial.is-keyboard-open .constellation-dial__viewport {
  filter: brightness(1.08) saturate(1.04);
}

.constellation-dial:focus-visible .constellation-dial__viewport {
  outline: 2px solid rgba(255, 255, 255, 0.96);
  outline-offset: 4px;
}

/* ELEMENT: title badge — desktop label; mobile project-title badge. */
.constellation-dial__label {
  position: relative;
  grid-row: 1;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: max-content;
  max-width: min(260px, calc(100vw - 220px));
  min-height: 0;
  box-sizing: border-box;
  padding: 4px 8px 3px;
  border: 1px solid color-mix(in srgb, var(--constellation-dial-accent) 35%, transparent);
  border-radius: 999px;
  background: rgba(4, 9, 22, 0.34);
  /* Title text stays white in every layout (mobile already forced this);
     the theme accent survives in the border and glow, but brand-tinted
     text was reported as undesirable on desktop. */
  color: #ffffff;
  font: 600 10px/1.1 var(--font-mono, 'JetBrains Mono', monospace);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 0 10px color-mix(in srgb, var(--constellation-dial-accent) 72%, transparent);
  white-space: nowrap;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.constellation-dial__viewport {
  position: relative;
  grid-row: 2;
  z-index: 2;
  display: block;
  width: clamp(120px, 9.6vw, 164px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--constellation-dial-aura) 18%, transparent) 0 20%, transparent 58%),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.055), transparent 64%);
  box-shadow:
    inset 0 0 24px color-mix(in srgb, var(--constellation-dial-aura) 18%, transparent),
    0 0 22px color-mix(in srgb, var(--constellation-dial-aura) 24%, transparent);
  overflow: visible;
}


/* ELEMENT: dial aura spot — debug-only marker for the colored aura spot inside the viewport. */
.constellation-dial__debug-aura-spot {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 72%;
  height: 72%;
  border-radius: 50%;
  transform: translate3d(-50%, -50%, 0);
  pointer-events: none;
}

.constellation-dial.is-debug-labels .constellation-dial__debug-aura-spot {
  outline: 1px dashed rgba(255,255,255,0.32);
  outline-offset: 1px;
}

.constellation-dial.is-debug-labels .constellation-dial__debug-aura-spot::after {
  top: 50%;
  left: 50%;
  transform: translate3d(-50%, calc(-100% - 12px), 0);
}

/* ELEMENT: inner orbit guide — thin tilted ring inside the viewport. */
.constellation-dial__viewport::before {
  content: '';
  position: absolute;
  inset: 8%;
  border: 1px solid color-mix(in srgb, var(--constellation-dial-glow) 22%, transparent);
  border-radius: 50%;
  transform: rotateX(58deg) rotateZ(18deg);
  opacity: 0.46;
  box-shadow: 0 0 18px color-mix(in srgb, var(--constellation-dial-aura) 30%, transparent);
}


/* ELEMENT: hit zones — invisible left/right areas used for previous/next interaction. */
.constellation-dial__hit {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  width: 50%;
  border-radius: inherit;
  pointer-events: none;
}

.constellation-dial__hit--prev { left: 0; }
.constellation-dial__hit--next { right: 0; }

/* ELEMENT: touchpoints ring — DOM layer that holds all case touchpoint dots. */
.constellation-dial__dots {
  position: absolute;
  inset: -12%;
  z-index: 4;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.2, 0.82, 0.22, 1);
  pointer-events: none;
}

.constellation-dial.is-mouse-open .constellation-dial__dots,
.constellation-dial.is-keyboard-open .constellation-dial__dots,
.constellation-dial.is-swiping-ready .constellation-dial__dots,
.constellation-dial.is-swiping .constellation-dial__dots,
.constellation-dial.is-activating .constellation-dial__dots {
  opacity: 1;
  transform: scale(1);
}

/* ELEMENT: touchpoint — one CSS dot around the dial, colored by case identityColor. */
.constellation-dial__dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(7px, 0.58vw, 10px);
  height: clamp(7px, 0.58vw, 10px);
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: color-mix(in srgb, #ffffff 12%, var(--dot-color, var(--constellation-dial-accent)));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, #ffffff 42%, var(--dot-color, var(--constellation-dial-accent)) 18%),
    0 0 0 1px rgba(255,255,255,0.24),
    0 0 8px color-mix(in srgb, var(--dot-color, var(--constellation-dial-accent)) 58%, transparent);
  opacity: 0.84;
  overflow: hidden;
  transform: rotate(var(--dot-angle)) translateY(calc(clamp(120px, 9.6vw, 164px) * -0.58)) rotate(var(--dot-angle-inverse)) scale(1);
  transition: transform 0.18s cubic-bezier(0.2, 0.82, 0.22, 1), opacity 0.18s ease, box-shadow 0.18s ease;
}

.constellation-dial__dot::before,
.constellation-dial__dot::after {
  content: '';
  position: absolute;
  pointer-events: none;
}

.constellation-dial__dot::before {
  inset: -1px;
  border-radius: inherit;
  border: 1px solid color-mix(in srgb, #ffffff 46%, var(--dot-color, var(--constellation-dial-accent)) 18%);
  opacity: 0.38;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--dot-color, var(--constellation-dial-accent)) 55%, transparent));
  z-index: 1;
}

.constellation-dial__dot::after {
  top: -38%;
  left: -120%;
  width: 62%;
  height: 176%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.96) 48%, transparent 100%);
  opacity: 0;
  transform: rotate(24deg) translate3d(-135%, 0, 0);
  filter: blur(0.2px) drop-shadow(0 0 4px rgba(255,255,255,0.7));
  z-index: 2;
}

.constellation-dial.is-activating .constellation-dial__dot {
  opacity: 1;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, #ffffff 52%, var(--dot-color, var(--constellation-dial-accent)) 18%),
    0 0 0 1px rgba(255,255,255,0.34),
    0 0 13px color-mix(in srgb, var(--dot-color, var(--constellation-dial-accent)) 74%, transparent);
}

.constellation-dial.is-activating .constellation-dial__dot::after {
  animation: constellation-dot-shine-commit 0.72s cubic-bezier(0.12, 0.72, 0.18, 1) both;
}

.constellation-dial.is-activating .constellation-dial__dot:nth-child(2)::after { animation-delay: 0.025s; }
.constellation-dial.is-activating .constellation-dial__dot:nth-child(3)::after { animation-delay: 0.05s; }
.constellation-dial.is-activating .constellation-dial__dot:nth-child(4)::after { animation-delay: 0.075s; }
.constellation-dial.is-activating .constellation-dial__dot:nth-child(5)::after { animation-delay: 0.1s; }
.constellation-dial.is-activating .constellation-dial__dot:nth-child(6)::after { animation-delay: 0.125s; }
.constellation-dial.is-activating .constellation-dial__dot:nth-child(7)::after { animation-delay: 0.15s; }
.constellation-dial.is-activating .constellation-dial__dot:nth-child(8)::after { animation-delay: 0.175s; }
.constellation-dial.is-activating .constellation-dial__dot:nth-child(9)::after { animation-delay: 0.2s; }
.constellation-dial.is-activating .constellation-dial__dot:nth-child(10)::after { animation-delay: 0.225s; }
.constellation-dial.is-activating .constellation-dial__dot:nth-child(11)::after { animation-delay: 0.25s; }
.constellation-dial.is-activating .constellation-dial__dot:nth-child(12)::after { animation-delay: 0.275s; }

@keyframes constellation-dot-shine-commit {
  0% {
    opacity: 0;
    transform: rotate(24deg) translate3d(-145%, 0, 0);
  }
  16% {
    opacity: 1;
  }
  52% {
    opacity: 0.82;
  }
  100% {
    opacity: 0;
    transform: rotate(24deg) translate3d(430%, 0, 0);
  }
}

/* ELEMENT STATE: selected touchpoint — enlarged/brightened active dot. */
.constellation-dial__dot.is-selected {
  opacity: 1;
  transform: rotate(var(--dot-angle)) translateY(calc(clamp(120px, 9.6vw, 164px) * -0.58)) rotate(var(--dot-angle-inverse)) scale(1.48);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.66),
    0 0 18px color-mix(in srgb, var(--dot-color, var(--constellation-dial-accent)) 82%, transparent),
    0 0 30px color-mix(in srgb, var(--dot-color, var(--constellation-dial-accent)) 36%, transparent);
}

/* ELEMENT: bottom project title — desktop/swipe preview title; hidden on current mobile layout. */
.constellation-dial__preview {
  position: relative;
  grid-row: 3;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(190px, 88vw);
  max-width: min(190px, 88vw);
  min-height: 2.32em;
  padding: 2px 8px;
  color: #ffffff;
  font: 600 clamp(9px, 0.75vw, 11px)/1.1 var(--font-mono, 'JetBrains Mono', monospace);
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 0 12px color-mix(in srgb, var(--constellation-dial-accent) 58%, transparent);
  white-space: normal;
  opacity: 0;
  transform: translate3d(0, -5px, 0) scale(0.96);
  transition: opacity 0.16s ease, transform 0.16s cubic-bezier(0.2, 0.82, 0.22, 1);
  pointer-events: none;
}

/* ELEMENT: abort zone — cancel target for swipe gestures. */
.constellation-dial__cancel {
  position: relative;
  grid-row: 4;
  grid-column: 1;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  min-height: 24px;
  padding: 4px 12px 3px;
  border: 1px solid color-mix(in srgb, #ffffff 20%, transparent);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 40%, rgba(255,255,255,0.08), transparent 68%),
    rgba(4, 9, 22, 0.26);
  color: rgba(238, 248, 255, 0.62);
  font: 600 9px/1 var(--font-mono, 'JetBrains Mono', monospace);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: inset 0 0 16px rgba(255,255,255,0.035);
  opacity: 0;
  transform: translate3d(0, -6px, 0) scale(0.92);
  transition: opacity 0.16s ease, transform 0.16s cubic-bezier(0.2, 0.82, 0.22, 1), border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  pointer-events: none;
}

.constellation-dial.is-mouse-open .constellation-dial__preview,
.constellation-dial.is-keyboard-open .constellation-dial__preview,
.constellation-dial.is-swiping-ready .constellation-dial__preview,
.constellation-dial.is-swiping .constellation-dial__preview,
.constellation-dial.is-swiping-ready .constellation-dial__cancel,
.constellation-dial.is-swiping .constellation-dial__cancel {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* Keyboard mode keeps selection and activation deliberately separate:
   arrows preview the highlighted signal, Enter/Space commits it. */
.constellation-dial__keyboard-hint {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: max-content;
  max-width: 224px;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--constellation-dial-fixed-accent) 46%, rgba(255,255,255,0.5));
  border-radius: 999px;
  background: rgba(4, 9, 22, 0.82);
  color: rgba(255,255,255,0.94);
  font: 600 8px/1.1 var(--font-mono, 'JetBrains Mono', monospace);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: inset 0 0 12px rgba(255,255,255,0.04), 0 0 13px rgba(0,0,0,0.22);
  opacity: 0;
  visibility: hidden;
  transform: translate3d(-50%, -4px, 0) scale(0.96);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
  pointer-events: none;
  white-space: nowrap;
}

.constellation-dial__keyboard-hint kbd,
.constellation-dial__keyboard-keys {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 15px;
  padding: 1px 4px;
  border: 1px solid rgba(255,255,255,0.58);
  border-bottom-color: rgba(255,255,255,0.86);
  border-radius: 4px;
  background: rgba(255,255,255,0.09);
  color: #fff;
  font: 600 8px/1 var(--font-mono, 'JetBrains Mono', monospace);
  letter-spacing: 0;
  text-transform: none;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.16);
}

.constellation-dial.is-keyboard-open .constellation-dial__keyboard-hint {
  opacity: 1;
  visibility: visible;
  transform: translate3d(-50%, 0, 0) scale(1);
  transition-delay: 0s;
}

.constellation-dial.is-cancelling .constellation-dial__preview {
  opacity: 0.42;
  transform: translate3d(0, -3px, 0) scale(0.96);
}

.constellation-dial.is-cancelling .constellation-dial__cancel {
  border-color: color-mix(in srgb, #ffffff 42%, var(--constellation-dial-accent) 18%);
  background:
    radial-gradient(circle at 50% 42%, rgba(255,255,255,0.16), transparent 68%),
    color-mix(in srgb, var(--constellation-dial-accent) 12%, rgba(4, 9, 22, 0.48));
  color: rgba(255,255,255,0.9);
  box-shadow:
    inset 0 0 18px rgba(255,255,255,0.07),
    0 0 16px color-mix(in srgb, var(--constellation-dial-accent) 36%, transparent);
  transform: translate3d(0, 0, 0) scale(1.08);
}

.constellation-dial.is-swiping .constellation-dial__viewport {
  filter: brightness(1.14) saturate(1.08);
}

/* The demo also carries .is-swiping during its authored ring pass. Keep its
   high-resolution canvas unfiltered even in that transient state. */
.constellation-dial.is-first-use-demo .constellation-dial__viewport {
  filter: none;
}

/* ELEMENT: center guide line — prev/next split guide, visible only while a press is armed (or debug). */
.constellation-dial__viewport::after {
  content: '';
  position: absolute;
  inset: 14% 49.5%;
  z-index: 2;
  width: 1px;
  border-radius: 999px;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--constellation-dial-glow) 32%, transparent), transparent);
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

/* Do not reveal this from :hover: coarse-pointer browsers can leave hover
   latched after a touch, making the divider look permanently active. */
.constellation-dial.is-swiping-ready .constellation-dial__viewport::after {
  opacity: 0.42;
}

/* ELEMENT: three.js wheel canvas — actual rendered wheel/core/beads. */
.constellation-dial canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.constellation-dial.is-activating .constellation-dial__viewport {
  animation: constellation-dial-lock-pulse 1.06s cubic-bezier(0.2, 0.82, 0.22, 1) both;
}

@keyframes constellation-dial-lock-pulse {
  0% { transform: scale(1); }
  32% { transform: scale(1.06); filter: brightness(1.34); }
  68% { transform: scale(0.985); filter: brightness(1.1); }
  100% { transform: scale(1); filter: brightness(1); }
}

/* Layout-mode contract (project-map.json → Layout Mode): the compact
   bottom-centered dial follows the overlay's stacked presentation, not a
   private width breakpoint — landscape phones and portrait tablets get the
   same touch-first dial the portrait phone gets. */
@media only screen and (orientation: portrait), only screen and (max-width: 1023.98px), only screen and (max-height: 599.98px) {
  .constellation-dial {
    top: auto;
    right: auto;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 26px);
    width: 188px;
    height: 248px;
    margin: 0;
    grid-template-rows: auto auto 0 auto;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 8px;
    transform: translate3d(-50%, 10px, 0) scale(1);
    box-sizing: border-box;
  }

  .constellation-dial.is-visible {
    transform: translate3d(-50%, 0, 0) scale(1);
  }

  .constellation-dial.is-visible.is-demo-presenting {
    transform: translate3d(calc(-50% + var(--constellation-demo-x, 0px)), var(--constellation-demo-y, 0px), 0)
      scale(var(--constellation-demo-scale, 1));
    transition: none;
  }

  .constellation-dial.is-first-use-demo {
    transform: translate3d(calc(-50% + var(--constellation-intro-x, 0px)), var(--constellation-intro-y, 0px), 0)
      scale(var(--constellation-intro-scale, 1.34));
  }

  .constellation-dial.is-first-use-demo::before {
    left: 50%;
    top: 42%;
    width: 230px;
    max-width: none;
    height: 190px;
    border-radius: 50%;
    opacity: 0.7;
    mix-blend-mode: screen;
    filter: blur(11px) saturate(1.28) brightness(1.12);
    transform: translate3d(-50%, -50%, 0) rotate(-16deg) scale(0.92);
    background:
      radial-gradient(ellipse at 46% 48%, color-mix(in srgb, var(--constellation-dial-aura) 46%, transparent) 0 18%, transparent 58%),
      radial-gradient(ellipse at 63% 44%, color-mix(in srgb, var(--constellation-dial-glow) 34%, transparent) 0 14%, transparent 54%);
  }

  /* Honest touch target: only the wheel itself owns touches. The root box
     (188x248 incl. label, preview title, grid gaps and the 100vw ::before
     band) previously carried pointer-events: auto + touch-action: none, so
     any scroll flick that started on it was captured by beginDrag() and the
     page refused to scroll. Root now passes touches through; the browser
     scroll gesture only yields inside the wheel circle. */
  .constellation-dial,
  .constellation-dial.is-visible {
    pointer-events: none;
    touch-action: auto;
  }

  .constellation-dial .constellation-dial__viewport {
    pointer-events: auto;
    touch-action: none;
  }

  /* Scroll-quiet: while the popup content scrolls underneath, the dial (and
     its ::before contrast band) recedes and stops intercepting touches, so
     mid-scroll momentum can't be grabbed by the wheel. constellation-dial.js
     toggles the class from a passive capture scroll listener and restores
     ~0.4s after scroll idle. Root already transitions opacity/transform.
     This is the ONLY mitigation for "dial sits over the story's last lines":
     an earlier attempt reserved a permanent ~292px blank band at the bottom
     of every story via padding on .case-overlay__shell (plus a forced
     min-height to patch the transparent gap that padding produced on short
     stories) so text could scroll clear of the dial entirely. Reverted at
     the person's request 2026-07-15 — it broke the popup's original
     edge-to-edge full-height feel on mobile. The dial may still overlap the
     final lines of a story at rest; scroll-quiet is the accepted trade-off. */
  .constellation-dial.is-visible.is-scroll-quiet {
    opacity: 0.3;
    transform: translate3d(-50%, 6px, 0) scale(0.98);
  }

  .constellation-dial.is-scroll-quiet .constellation-dial__viewport {
    pointer-events: none;
  }

  .constellation-dial__viewport {
    width: 146px;
    justify-self: center;
    box-sizing: border-box;
  }

  .constellation-dial::before {
    left: 50%;
    top: 50%;
    width: 100vw;
    max-width: 100vw;
    height: 184px;
    border-radius: 999px;
    opacity: 1;
    mix-blend-mode: normal;
    filter: blur(24px);
    transform: translate3d(-50%, -50%, 0);
    background: linear-gradient(
      90deg,
      rgba(0, 0, 0, 0) 0%,
      rgba(4, 7, 12, 0.42) 12%,
      rgba(4, 7, 12, 0.66) 28%,
      rgba(4, 7, 12, 0.82) 50%,
      rgba(4, 7, 12, 0.66) 72%,
      rgba(4, 7, 12, 0.42) 88%,
      rgba(0, 0, 0, 0) 100%
    );
    animation: none;
  }

  .constellation-dial::after {
    opacity: 0;
  }

  /* Mobile sits over arbitrary case photo/video content scrolling underneath,
     not the controlled flat frame gradient desktop gets -- the aura's normal
     18-24% color-mix alpha is tuned for that calmer desktop backdrop, so it
     gets a real boost here, compounding with the darker ::before band above. */
  .constellation-dial__viewport {
    background:
      radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--constellation-dial-aura) 30%, transparent) 0 22%, transparent 60%),
      radial-gradient(circle at 50% 50%, rgba(255,255,255,0.08), transparent 66%);
    box-shadow:
      inset 0 0 26px color-mix(in srgb, var(--constellation-dial-aura) 30%, transparent),
      0 0 26px color-mix(in srgb, var(--constellation-dial-aura) 40%, transparent);
  }

  /* Slightly stronger resting-state color aura. The full-width ::before
     layer is a contrast bed already at opacity 1, so increasing that would
     only darken the story; strengthen the colored viewport glow instead. */
  .constellation-dial.is-visible:not(.is-first-use-demo) .constellation-dial__viewport {
    background:
      radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--constellation-dial-aura) 34%, transparent) 0 22%, transparent 60%),
      radial-gradient(circle at 50% 50%, rgba(255,255,255,0.09), transparent 66%);
    box-shadow:
      inset 0 0 26px color-mix(in srgb, var(--constellation-dial-aura) 34%, transparent),
      0 0 27px color-mix(in srgb, var(--constellation-dial-aura) 46%, transparent);
  }

  .constellation-dial__label {
    grid-row: 1;
    display: inline-flex;
    justify-self: center;
    width: auto;
    min-height: 0;
    max-width: min(188px, calc(100vw - 28px));
    padding: 4px 8px 3px;
    border-radius: 999px;
    background: rgba(4, 9, 22, 0.46);
    /* The badge shows the current/selected case title over arbitrary case
       imagery here; brand-tinted text can vanish on matching backgrounds,
       so the title is always white with a neutral dark halo on mobile. */
    color: #ffffff;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.62);
    font-size: var(--text-10);
    line-height: 1.1;
    letter-spacing: 0.08em;
    white-space: normal;
    text-align: center;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transform: translate3d(0, 5px, 0) scale(0.96);
    transition: opacity 0.14s ease, transform 0.14s cubic-bezier(0.2, 0.82, 0.22, 1), visibility 0s linear 0.14s;
    pointer-events: none;
  }

  .constellation-dial.is-mouse-open .constellation-dial__label,
  .constellation-dial.is-keyboard-open .constellation-dial__label,
  .constellation-dial.is-swiping-ready .constellation-dial__label,
  .constellation-dial.is-swiping .constellation-dial__label,
  .constellation-dial.is-activating .constellation-dial__label {
    opacity: 1;
    visibility: visible;
    transform: translate3d(0, 0, 0) scale(1);
    transition-delay: 0s;
  }

  /* A real touch release must always return the mobile Dial title to idle.
     This defeats sticky synthetic :hover/focus on touch browsers without
     changing the updates56 pointer/swipe engine. Mouse/keyboard states win. */
  .constellation-dial.is-touch-preview-resting:not(.is-mouse-open):not(.is-keyboard-open) .constellation-dial__label {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translate3d(0, 5px, 0) scale(0.96) !important;
    transition-delay: 0s !important;
  }

  /* Touchpoints: the desktop clamp(7px, 0.58vw, 10px) collapses to 7px on
     phones. The mobile orbit radius is 120px * 0.58 ≈ 70px, so the 7 dots
     sit ≈ 62px apart along the ring — a 12px dot (≈18px selected at 1.48x)
     stays comfortably clear of its neighbours while being easy to see. */
  .constellation-dial__dot {
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
  }

  .constellation-dial__dots {
    inset: 0;
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    width: 146px;
    height: 146px;
    transform: translate3d(-50%, -50%, 0) scale(0.92);
    box-sizing: border-box;
  }

  .constellation-dial.is-mouse-open .constellation-dial__dots,
  .constellation-dial.is-keyboard-open .constellation-dial__dots,
  .constellation-dial.is-swiping-ready .constellation-dial__dots,
  .constellation-dial.is-swiping .constellation-dial__dots,
  .constellation-dial.is-activating .constellation-dial__dots {
    transform: translate3d(-50%, -50%, 0) scale(1);
  }

  .constellation-dial__preview {
    display: none;
    width: 0;
    min-height: 0;
    padding: 0;
    margin: 0;
    opacity: 0 !important;
    transform: none !important;
    overflow: hidden;
  }

  .constellation-dial__cancel {
    grid-row: 4;
    justify-self: center;
    min-width: 70px;
    min-height: 24px;
    padding-inline: 11px;
    font-size: var(--text-9);
    background:
      radial-gradient(circle at 50% 40%, rgba(255,255,255,0.12), transparent 68%),
      rgba(4, 9, 22, 0.74);
    box-sizing: border-box;
  }

  .constellation-dial__keyboard-hint {
    max-width: min(188px, calc(100vw - 24px));
    padding-inline: 7px;
    gap: 3px;
    font-size: 7.5px;
  }
}

@media only screen and (max-width: 900px) and (hover: hover) and (pointer: fine) {
  .constellation-dial:hover .constellation-dial__label,
  .constellation-dial:focus-visible .constellation-dial__label {
    opacity: 1;
    visibility: visible;
    transform: translate3d(0, 0, 0) scale(1);
    transition-delay: 0s;
  }
}

/* Desktop keeps the same top label as mobile. In idle it reads
   "Constellation Dial"; during preview/selection it switches to the
   current project title, so the lower duplicate title can stay hidden. */
@media only screen and (orientation: landscape) and (min-width: 1024px) and (min-height: 600px) {
  .constellation-dial {
    /* Symmetric control clearance is derived from the actual orbit geometry:
       - point centres sit at 58% of viewport diameter, so they overhang the
         50% viewport edge by 8% of the diameter;
       - the selected point is scale(1.48), giving a visual radius of
         0.5 * 1.48 = 0.74 of its dot size;
       - add 7px of clean optical air beyond the point itself. This is the
         midpoint between the old 16px boundary gap (slight point overlap)
         and the previous 38px+ gap (visually detached controls).
       The same computed gap is used above and below the wheel. */
    --constellation-dial-point-overhang:
      calc(clamp(9.6px, 0.768vw, 13.12px) + clamp(5.18px, 0.4292vw, 7.4px));
    --constellation-dial-control-clearance: 7px;
    --constellation-dial-control-gap:
      calc(var(--constellation-dial-point-overhang) + var(--constellation-dial-control-clearance));

    /* v12 had an effective 16px label→viewport distance (10px grid gap +
       6px label margin). Compensate the fixed root top by exactly the delta
       so increasing the symmetric gaps does not push the wheel itself down. */
    top: calc(38px + clamp(22px, 2.2vw, 34px) - var(--constellation-dial-control-gap) + 16px);
    grid-template-rows: auto auto auto;
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0;
    height: auto;
  }

  .constellation-dial__label {
    transition: opacity 0.16s ease, transform 0.16s cubic-bezier(0.2, 0.82, 0.22, 1), visibility 0s linear 0s;
    margin-bottom: var(--constellation-dial-control-gap);
    white-space: nowrap;
    text-align: center;
  }

  .constellation-dial__preview {
    display: none;
    grid-row: auto;
    width: 0;
    min-height: 0;
    padding: 0;
    margin: 0;
    opacity: 0 !important;
    transform: none !important;
    overflow: hidden;
  }

  .constellation-dial__cancel {
    grid-row: 3;
    margin-top: var(--constellation-dial-control-gap);
  }
}





/* Debug labels for Constellation Dial.
   Toggle with keyboard key "D" while a case popup is open. */
.constellation-dial.is-debug-labels {
  outline: 1px dashed rgba(255,255,255,0.42);
  outline-offset: 4px;
}

.constellation-dial.is-debug-labels [data-debug-label] {
  outline: 1px dashed rgba(255,255,255,0.34);
  outline-offset: 2px;
}

.constellation-dial.is-debug-labels [data-debug-label]::after {
  content: attr(data-debug-label);
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 160px;
  padding: 3px 6px 2px;
  border: 1px solid rgba(255,255,255,0.38);
  border-radius: 999px;
  background: rgba(2, 5, 12, 0.86);
  color: rgba(255,255,255,0.92);
  font: 600 9px/1.1 var(--font-mono, 'JetBrains Mono', monospace);
  letter-spacing: 0.04em;
  text-transform: none;
  white-space: nowrap;
  text-shadow: none;
  pointer-events: none;
  transform: translate3d(-50%, calc(-100% - 5px), 0);
  box-shadow: 0 6px 18px rgba(0,0,0,0.32);
}

.constellation-dial.is-debug-labels::after {
  content: 'D: debug labels';
  position: absolute;
  left: 50%;
  bottom: -22px;
  z-index: 40;
  padding: 3px 7px 2px;
  border: 1px solid rgba(255,255,255,0.32);
  border-radius: 999px;
  background: rgba(2, 5, 12, 0.82);
  color: rgba(255,255,255,0.78);
  font: 600 9px/1.1 var(--font-mono, 'JetBrains Mono', monospace);
  letter-spacing: 0.04em;
  transform: translateX(-50%);
  pointer-events: none;
}

.constellation-dial.is-debug-labels::before {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14);
}

.constellation-dial.is-debug-labels .constellation-dial__viewport::after {
  opacity: 0.72;
}

.constellation-dial.is-debug-labels .constellation-dial__hit {
  background: rgba(255,255,255,0.045);
}

.constellation-dial.is-debug-labels .constellation-dial__hit--prev::after {
  left: 0;
  top: 50%;
  transform: translate3d(-8px, -50%, 0);
}

.constellation-dial.is-debug-labels .constellation-dial__hit--next::after {
  left: auto;
  right: 0;
  top: 50%;
  transform: translate3d(8px, -50%, 0);
}

.constellation-dial.is-debug-labels .constellation-dial__dots::after {
  top: auto;
  bottom: 0;
  transform: translate3d(-50%, calc(100% + 6px), 0);
}

.constellation-dial.is-debug-labels .constellation-dial__dot::after {
  content: attr(data-debug-label);
  left: 50%;
  top: 50%;
  width: auto;
  height: auto;
  min-width: 0;
  border-radius: 999px;
  background: rgba(2, 5, 12, 0.86);
  opacity: 1;
  filter: none;
  transform: translate3d(-50%, calc(-100% - 10px), 0);
  animation: none;
}

.constellation-dial.is-debug-labels .constellation-dial__dot::before {
  outline: 1px solid rgba(255,255,255,0.42);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .constellation-dial {
    transition-duration: 700ms, 700ms, 700ms;
  }

  .constellation-dial::before,
  .constellation-dial::after,
  .constellation-dial.is-activating::before,
  .constellation-dial.is-activating::after,
  .constellation-dial.is-activating .constellation-dial__dot::after,
  .constellation-dial.is-activating .constellation-dial__viewport {
    animation: none !important;
  }

  .constellation-dial.is-first-use-demo,
  .constellation-dial.is-first-use-settling {
    transition-duration: 480ms, 1150ms, 520ms;
  }

  .constellation-dial__hand-icon {
    transition: none !important;
  }
}

/* ==========================================================
   Manual "how to use this" hint: "?" trigger, instructional
   tip, and the virtual-hand demo cursor it plays inside the
   dial viewport. All three are siblings of .constellation-dial
   (never inside it -- it's a <button>, so nesting another
   interactive control in there would be invalid HTML).
   ========================================================== */

/* ELEMENT: help trigger — small "?" badge near the dial's top-right corner. */
.constellation-dial__help {
  position: fixed;
  /* 75% down the responsive dial height, centered on the 26px button. */
  top: calc(38px + clamp(22px, 2.2vw, 34px) + clamp(148.5px, 11.85vw, 192px) - 13px);
  /* The button starts just beyond the root edge; the orbit itself is inset
     another 6–7px, leaving a small clear gap without the previous wide offset. */
  right: calc(var(--constellation-dial-panel-offset) - 16px);
  z-index: 10037;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--constellation-dial-accent, #fff) 78%, rgba(255, 255, 255, 0.34));
  border-radius: 50%;
  background: rgba(3, 10, 25, 0.94);
  color: #ffffff;
  box-shadow:
    inset 0 0 8px rgba(255, 255, 255, 0.12),
    0 0 0 1px color-mix(in srgb, var(--constellation-dial-accent, #fff) 22%, transparent),
    0 0 13px color-mix(in srgb, var(--constellation-dial-accent, #fff) 42%, transparent);
  font: 600 13px/1 var(--font-mono, 'JetBrains Mono', monospace);
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transition: opacity 0.28s ease, transform 0.28s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  transform: scale(0.9);
}

.constellation-dial__help.is-visible {
  /* Slightly clearer than the dial's 0.88 resting opacity so the persistent
     help shortcut remains discoverable without reading as fully opaque UI. */
  opacity: 0.92;
  pointer-events: auto;
  transform: scale(1);
}

.constellation-dial__help:hover,
.constellation-dial__help:focus-visible {
  opacity: 1;
  background: rgba(7, 21, 45, 0.98);
  border-color: color-mix(in srgb, var(--constellation-dial-accent, #fff) 72%, #fff 28%);
  box-shadow:
    inset 0 0 9px rgba(255, 255, 255, 0.2),
    0 0 0 1px color-mix(in srgb, var(--constellation-dial-accent, #fff) 28%, transparent),
    0 0 18px color-mix(in srgb, var(--constellation-dial-accent, #fff) 54%, transparent);
  transform: scale(1.08);
}

/* ELEMENT: help tip — short instructional text shown while the hand demo
   plays (or alone, as the reduced-motion fallback with no animated hand). */
.constellation-dial__help-tip {
  position: fixed;
  top: calc(38px + clamp(22px, 2.2vw, 34px) - 6px);
  right: calc(var(--constellation-dial-panel-offset) + 28px);
  z-index: 10037;
  max-width: 232px;
  padding: 6px 10px;
  border: 1px solid rgba(238, 248, 255, 0.22);
  border-radius: 12px;
  background: rgba(4, 9, 22, 0.82);
  color: rgba(238, 248, 255, 0.92);
  font: 600 11px/1.35 var(--font-mono, 'JetBrains Mono', monospace);
  text-align: right;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(4px, 0, 0);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.constellation-dial__help-tip.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.constellation-dial__help-tip.is-first-use-demo {
  top: max(116px, var(--constellation-intro-tip-top, calc(50% - 190px)));
  right: auto;
  bottom: auto;
  left: 50%;
  z-index: 10057;
  width: min(460px, calc(100vw - 28px));
  max-width: min(460px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  box-shadow: none;
  font: 600 clamp(13px, 1vw, 15px)/1.38 var(--font-mono, 'JetBrains Mono', monospace);
  text-align: center;
  pointer-events: none;
  transform: translate3d(-50%, calc(-100% - 7px), 0) scale(0.98);
}

.constellation-dial__help-tip.is-first-use-demo.is-visible {
  pointer-events: auto;
  transform: translate3d(-50%, calc(-100% - 12px), 0) scale(1);
}

.constellation-dial__help-tip-text {
  box-sizing: border-box;
}

.constellation-dial__help-tip.is-first-use-demo .constellation-dial__help-tip-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 34px;
  padding: 7px 14px;
  border: 1px solid color-mix(in srgb, var(--constellation-dial-accent, #fff) 46%, rgba(255, 255, 255, 0.34));
  border-radius: 999px;
  background: rgba(4, 9, 22, 0.84);
  color: #fff;
  text-shadow: 0 1px 7px rgba(0, 0, 0, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 5px 18px rgba(0, 0, 0, 0.26),
    0 0 14px color-mix(in srgb, var(--constellation-dial-accent, #fff) 16%, transparent);
}

.case-overlay.is-first-use-dial-demo .constellation-dial__help {
  opacity: 0;
  pointer-events: none;
}

/* The help trigger is the dial's immediate next sibling. Keep it unavailable
   until the enlarged control has finished travelling back to its real anchor,
   otherwise a rapid second click can start from mid-FLIP geometry. */
.constellation-dial.is-first-use-settling + .constellation-dial__help {
  opacity: 0;
  pointer-events: none;
}

/* ELEMENT: prev/next half highlight — demo-only visualization of the plain
   tap zones activate() actually reads (left half = prev, right half = next).
   Sized and clipped to match .constellation-dial__viewport's own circle. */
.constellation-dial__half {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--constellation-dial-accent) 58%, transparent), transparent 76%);
  transition: opacity 0.22s ease;
}

.constellation-dial__half--prev { clip-path: inset(0 50% 0 0); }
.constellation-dial__half--next { clip-path: inset(0 0 0 50%); }

.constellation-dial__half.is-visible { opacity: 0.5; }
.constellation-dial__half.is-pressing { opacity: 0.82; }

/* Real prev/next tap feedback on every pointer-capable layout. Kept separate
   from the first-use demo classes so live interaction cannot disturb it. */
.constellation-dial__half.is-feedback {
  opacity: 0.62;
  transition-duration: 0.14s;
}

.constellation-dial__half::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  border: 1px solid color-mix(in srgb, var(--constellation-dial-accent, #fff) 42%, transparent);
  border-radius: 50%;
  background-color: color-mix(in srgb, var(--constellation-dial-accent, #fff) 16%, rgba(4, 10, 24, 0.42));
  background-position: 50% 50%;
  background-repeat: no-repeat;
  background-size: 13px 13px;
  box-shadow: 0 0 10px color-mix(in srgb, var(--constellation-dial-accent, #fff) 22%, transparent);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.86);
  transition: opacity 90ms ease-out, transform 150ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.constellation-dial__half--prev::after {
  left: 25%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14.5 5.5 8 12l6.5 6.5' fill='none' stroke='%23f2f8ff' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.constellation-dial__half--next::after {
  left: 75%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m9.5 5.5 6.5 6.5-6.5 6.5' fill='none' stroke='%23f2f8ff' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.constellation-dial__half.is-feedback::after {
  opacity: 0.94;
  transform: translate(-50%, -50%) scale(1);
}

/* ELEMENT: virtual hand cursor. Its index-finger tip is aligned with the
   sampled ring point, so the authored path visibly demonstrates the real
   hover/swipe gesture rather than moving an abstract dot around the wheel. */
.constellation-dial__hand {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.constellation-dial__hand.is-visible {
  opacity: 1;
}

.constellation-dial__hand-icon {
  position: absolute;
  left: -13px;
  top: -3px;
  width: 30px;
  height: 39px;
  overflow: visible;
  transform-origin: 13px 3px;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 5px rgba(255, 255, 255, 0.44));
  transition: transform 0.16s cubic-bezier(0.2, 0.82, 0.22, 1), filter 0.16s ease;
}

.constellation-dial__hand-shape {
  fill: rgba(248, 252, 255, 0.98);
  stroke: rgba(3, 9, 22, 0.98);
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.constellation-dial__hand-detail {
  fill: none;
  stroke: rgba(12, 23, 38, 0.72);
  stroke-width: 1.25;
  stroke-linecap: round;
}

.constellation-dial__hand.is-pressing .constellation-dial__hand-icon {
  transform: translate3d(0, 2px, 0) rotate(-3deg) scale(0.9);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.54)) drop-shadow(0 0 7px rgba(255, 255, 255, 0.58));
}

/* ELEMENT STATE: demo target — the dot currently being pressed/targeted by
   the virtual hand. Reuses the same ring language as .is-selected so the
   demo visually previews the real selected state. */
.constellation-dial__dot.is-demo-target {
  opacity: 1;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.6),
    0 0 14px color-mix(in srgb, var(--dot-color, var(--constellation-dial-accent)) 78%, transparent),
    0 0 24px color-mix(in srgb, var(--dot-color, var(--constellation-dial-accent)) 32%, transparent);
}



@media only screen and (orientation: portrait), only screen and (max-width: 1023.98px), only screen and (max-height: 599.98px) {
  .constellation-dial__help {
    top: auto;
    right: auto;
    /* Match the desktop relationship to the control: the badge centre sits
       11px beyond the dial root's right edge and 75% down its height. */
    left: calc(50% + 86px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 75px);
  }

  /* The help trigger is the dial's immediate sibling and therefore consumes
     the exact same scroll-quiet state without a second scroll listener. It
     recedes on the same 0.28s cadence, but keeps a higher opacity floor than
     the dial (0.56 vs 0.30) because this shortcut must remain discoverable. */
  .constellation-dial.is-visible.is-scroll-quiet + .constellation-dial__help.is-visible {
    opacity: 0.56;
    pointer-events: none;
    transform: translate3d(0, 6px, 0) scale(0.98);
  }

  .constellation-dial__help-tip {
    top: auto;
    right: auto;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 26px + 222px);
    max-width: min(220px, calc(100vw - 32px));
    text-align: center;
    transform: translate3d(-50%, 4px, 0);
  }

  .constellation-dial__help-tip.is-visible {
    transform: translate3d(-50%, 0, 0);
  }
}

/* ==========================================================
   Constellation Dial — CSS fallback visual backend
   ----------------------------------------------------------
   The controller/interaction model is shared with the WebGL dial. When the
   canonical renderer router selects fallback, only the central visual machine
   changes: the four tilted 3D rings are projected to 2D ellipses, sphere beads
   become luminous CSS points, and the sphere-like WebGL core becomes a circular 2D core.
   ========================================================== */

.constellation-dial__css-wheel {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  overflow: visible;
  pointer-events: none;
  contain: layout style;
}

.constellation-dial__css-wheel[hidden] {
  display: none !important;
}

.constellation-dial.is-css-fallback canvas {
  display: none !important;
}

.constellation-dial.is-css-fallback .constellation-dial__viewport::before {
  /* The fallback backend already draws the four authored orbit lines. Keep
     the generic guide from doubling the innermost ellipse. */
  opacity: 0.16;
}

.constellation-dial__css-orbits {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.constellation-dial__css-orbit {
  fill: none;
  stroke: color-mix(in srgb, var(--constellation-dial-accent) 42%, transparent);
  stroke-width: 0.34;
  vector-effect: non-scaling-stroke;
  opacity: 0.22;
  filter: drop-shadow(0 0 1.5px color-mix(in srgb, var(--constellation-dial-aura) 18%, transparent));
  transition: stroke 0.24s ease, filter 0.24s ease, opacity 0.18s ease;
}

.constellation-dial__css-bead {
  --css-bead-size: 1;
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: calc(clamp(2.4px, 0.19vw, 3.3px) * var(--css-bead-size));
  height: calc(clamp(2.4px, 0.19vw, 3.3px) * var(--css-bead-size));
  border-radius: 50%;
  background: var(--constellation-dial-accent);
  /* WebGL uses emissive MeshStandardMaterial without a bloom pass. Keep the
     fallback halo tight: a tiny specular lift plus a short emissive falloff. */
  box-shadow:
    0 0 0 0.38px color-mix(in srgb, #ffffff 38%, var(--constellation-dial-accent)),
    0 0 1.9px color-mix(in srgb, var(--constellation-dial-accent) 42%, transparent);
  opacity: 0.96;
  transform: translate3d(-50%, -50%, 0);
  transform-origin: center;
  transition: background-color 0.24s ease, box-shadow 0.24s ease;
  will-change: left, top, transform, opacity;
}

.constellation-dial__css-bead.is-highlight {
  background: var(--constellation-dial-glow);
  box-shadow:
    0 0 0 0.42px rgba(255,255,255,0.58),
    0 0 2.3px color-mix(in srgb, var(--constellation-dial-glow) 54%, transparent);
}

.constellation-dial__css-core {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 9;
  width: clamp(20px, 1.54vw, 27px);
  height: clamp(20px, 1.54vw, 27px);
  transform: translate3d(-50%, -50%, 0);
  transform-origin: 50% 50%;
  border-radius: 50%;
  background: var(--constellation-dial-accent);
  border: 0;
  box-shadow: none;
  transition: background-color 0.24s ease, transform 0.18s ease;
  will-change: transform;
}

.constellation-dial.is-css-fallback.is-activating .constellation-dial__css-orbit {
  stroke: color-mix(in srgb, var(--constellation-dial-glow) 68%, transparent);
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--constellation-dial-aura) 38%, transparent));
}

.constellation-dial.is-css-fallback.is-activating .constellation-dial__css-bead {
  /* Mirrors the WebGL jump from resting emissiveIntensity ~0.66 to 1.18,
     without introducing a synthetic bloom halo. */
  box-shadow:
    0 0 0 0.46px rgba(255,255,255,0.62),
    0 0 3px color-mix(in srgb, var(--constellation-dial-accent) 60%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .constellation-dial__css-orbit,
  .constellation-dial__css-bead,
  .constellation-dial__css-core {
    transition-duration: 0.01ms;
  }
}
